/* ==========================================================================
   MASSAED factory site — the landing-type pages (T127)

   Everything between the hero and the footer: hero, trust strip, the audience
   and product cards, refurbishment, the process timeline, quality, the finish
   swatches, gallery and lightbox, the projects filter, the visit CTA, the lead
   form and the FAQ accordion.

   Loaded by the pages that actually have those sections — the two landing
   pages, the two fabrication pages, privacy and 404 — and NOT by the 3D
   customizer, which has none of them. Always loaded after shell.css, never
   instead of it.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative; color: var(--white); overflow: hidden;
  min-height: min(88vh, 780px); display: flex; align-items: flex-end;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* T015: darker top stops so the eyebrow pill and headline clear 4.5:1 against the bright sky */
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(33,14,10,0.75) 0%, rgba(33,14,10,0.55) 35%, rgba(28,10,7,0.92) 100%);
}
.hero__content { position: relative; z-index: 2; padding-block: var(--space-7) var(--space-5); width: 100%; }
/* T015: dark translucent pill (was translucent white, 1.9:1); the white border is kept */
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em; background: rgba(20,8,6,0.66);
  border: 1px solid rgba(255,255,255,0.45); padding: 0.4rem 0.9rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em; margin-block-end: var(--space-3);
  text-transform: uppercase; backdrop-filter: blur(3px);
}
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); flex-shrink: 0; }
@media (max-width: 560px) { .hero__eyebrow { font-size: 0.76rem; letter-spacing: 0.02em; padding: 0.35rem 0.8rem; } }
/* (the ≤400 px hero overrides live below the base .hero__lead / .hero__actions rules — same specificity, so order decides) */
/* The headline names the products (interiors, door frames, shaft cladding), so it is longer:
   a slightly smaller scale plus balanced wrapping keeps it to tidy lines on phones and desktop.
   Measures are in em, never ch (T141, as .cc-hero h1 in configurator.css): ch is the width of '0', and on the
   Arabic pages '0' comes from Cairo's LATIN file — while only the Arabic file had arrived, 22ch fell to 0.5em,
   the headline went from 3 lines to 4 and the hero jumped (CLS 0.032, 0.099 when the fallback painted first).
   Each em value is the old ch measure × Cairo's '0' at the element's weight (0.560em at 400, 0.559 at 600,
   0.556 at 700), so the settled layout is unchanged: 22ch → 12.232em, 56ch → 31.36em. */
.hero h1 {
  color: var(--white); max-width: 12.232em; margin-block-end: var(--space-2);
  font-size: clamp(2rem, 1.35rem + 2.3vw, 3.25rem); text-wrap: balance;
}
.hero__lead { max-width: 31.36em; font-size: var(--fs-lead); color: var(--gray-100); margin-block-end: var(--space-4); }
/* CTA hierarchy: one maroon primary first, the two secondaries outlined beside it, then quiet contact links */
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem 1rem; margin-block-end: var(--space-3); }
.hero__actions .btn-primary { order: -1; }
.hero__actions .btn-secondary { border-color: rgba(255,255,255,0.75); font-weight: 600; }
.hero__actions .btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: var(--white); }
@media (max-width: 560px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}
/* 561-880 px (T141, MASSAED's decision of 28 Sep 2026): the primary hero button has a row of its own and the
   secondaries share the next one — the layout Cairo already gave at 561-595 px, now the same in every font. A
   freely wrapping row breaks where the button texts run out of room, and those widths depend on the font: the
   Arabic fallback in rtl.css draws these short bold labels 3-6% wider than Cairo, so near a wrap point the row
   wrapped in the fallback and un-wrapped when Cairo landed (/ar/factory/ 776-804 and 596-616 px, CLS up to 0.55;
   the Arabic fabrication page 564-580 px; the English landing page 620 and 820-824 px, the other way round). A
   grid does not wrap: from 561 px the secondaries fit side by side with 81 px to spare, above 880 px all the
   buttons fit on one line with 40 px to spare (English, 15 px scrollbar), and up to 560 px they stack.
   EN and AR alike, so the pages stay mirror images. Labels may wrap inside their buttons only when a larger
   browser font (Chrome's 'Large' 20 px, 'Very large' 24 px) leaves no room — .hero is overflow: hidden, so a
   row wider than the hero would be cut off; at 16 px they never do. Pinned in tests/static/font-loading.test.js. */
@media (min-width: 561px) and (max-width: 880px) {
  .hero .hero__actions { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); justify-items: start; }
  .hero .hero__actions .btn-primary { grid-column: 1 / -1; }
  .hero .hero__actions .btn { white-space: normal; text-align: center; max-width: 100%; }
}
/* Small phones: the pill stays on one line in both languages, and less headroom above it so the
   stacked CTAs sit higher on first paint (the hero is content-tall here, so trimming the top
   padding, not the bottom, is what lifts the third button clear of the sticky bar).
   Measured at 360×800 (sticky bar from y=743): the third CTA ended at 755 (EN) / 809 (AR) — both
   primaries wrap to two lines there. Tighter lead, gaps, eyebrow margin and primary padding bring it
   to ≈673 (EN) / ≈712 (AR); the H1 size is deliberately left alone. (A 375×667 phone is too short
   for header + hero + bar whatever the spacing — that needs the bar hidden while the hero CTAs are
   on screen, TODO T063.) This block must stay after the base .hero__lead / .hero__actions rules. */
@media (max-width: 400px) {
  .hero__eyebrow { font-size: 0.7rem; letter-spacing: 0; padding: 0.3rem 0.7rem; margin-block-end: var(--space-2); }
  .hero__content { padding-block-start: var(--space-4); }
  .hero__lead { font-size: 1rem; margin-block-end: var(--space-3); }
  .hero__actions { gap: 0.6rem; }
  .hero__actions .btn-lg { padding-block: 0.9rem; } /* still the largest button: 1.08rem text vs 0.98rem */
}
.hero__links { font-size: 0.9rem; color: var(--gray-200); margin-block-end: var(--space-4); }
.hero__links a { color: var(--white); font-weight: 600; }
.hero__links a:hover { color: var(--gold-500); }
.hero__credibility {
  display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; font-weight: 600; color: var(--gray-100);
  border-inline-start: 3px solid var(--color-accent); padding-inline-start: 0.9rem;
}

/* ---------------------------------------------------------------------- */
/* Trust strip                                                             */
/* ---------------------------------------------------------------------- */
.trust-strip { background: var(--maroon-900); color: var(--white); padding-block: var(--space-4); }
.trust-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3);
  text-align: center;
}
.trust-grid__item { padding-inline: 0.5rem; }
.trust-grid__value { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 800; color: var(--color-accent); display: block; }
.trust-grid__label { font-size: 0.88rem; color: var(--gray-200); }
.trust-grid__item + .trust-grid__item { border-inline-start: 1px solid rgba(255,255,255,0.15); }
@media (max-width: 720px) { .trust-grid__item + .trust-grid__item { border-inline-start: none; } }
/* Text values (e.g. Arabic «مصنع رأس الخيمة») can wrap to two lines while the numbers beside them don't.
   Value and label share row tracks across each grid row, so labels in a row always start at the same height. */
.trust-grid__value { text-wrap: balance; }
@supports (grid-template-rows: subgrid) {
  .trust-grid__item { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
  .trust-grid__value { align-self: end; }
  .trust-grid__label { line-height: calc(var(--fs-body) * var(--lh-normal)); } /* same leading as before it became a grid item */
}

/* ---------------------------------------------------------------------- */
/* Direct factory orders band (#orders) — light maroon tint, audience chips */
/* ---------------------------------------------------------------------- */
.section--orders {
  background: linear-gradient(180deg, var(--maroon-050) 0%, var(--white) 100%);
  border-block-end: 1px solid var(--maroon-100); padding-block: var(--space-5);
}
.section--orders .section-head { margin-block-end: var(--space-3); }
.section--orders h2 { max-width: 13.344em; } /* = 24ch in Cairo at 700; em, not ch — see .hero h1 (T141) */
.orders__chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 0 0 var(--space-3); }
.orders__chips a, .orders__chip {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.5rem 1.05rem; border-radius: 999px;
  background: var(--white); border: 1.5px solid var(--maroon-100); color: var(--color-brand); font-weight: 700; font-size: 0.9rem;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.orders__chips a:hover { background: var(--color-brand); border-color: var(--color-brand); color: var(--white); text-decoration: none; transform: translateY(-1px); }
.orders__chips svg { width: 1em; height: 1em; flex-shrink: 0; }
.orders__line { font-size: var(--fs-lead); font-weight: 600; color: var(--color-brand-strong); max-width: 33.54em; margin: 0; } /* = 60ch in Cairo at 600 (T141) */

/* ---------------------------------------------------------------------- */
/* Who we serve (#who-we-serve) — five audience cards                        */
/* ---------------------------------------------------------------------- */
.serve-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 980px) { .serve-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .serve-grid { grid-template-columns: minmax(0, 1fr); } }
.serve-card {
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3);
  display: flex; flex-direction: column; gap: 0.6rem; height: 100%; scroll-margin-block-start: calc(var(--header-h) + 16px);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.serve-card:hover, .serve-card:target { box-shadow: var(--shadow-md); border-color: var(--maroon-100); }

/* Illustration inside a family card: a concept render of the product type, NOT MASSAED's own work
   (content/images.json type "illustration"). The caption is part of the picture, not a footnote —
   it stays visible at every width and is never hidden, faded out or truncated, because the whole
   point is that nobody mistakes the render for a photograph of a MASSAED product. */
.illus { margin: 0 0 0.4rem; }
.illus img {
  width: 100%; height: 170px; object-fit: cover; object-position: center;
  border-radius: var(--radius-sm); background: var(--gray-100); display: block;
}
.illus__note {
  margin-block-start: 0.35rem; font-size: 0.75rem; line-height: 1.4; color: var(--gray-700);
  display: flex; align-items: center; gap: 0.35rem;
}
.illus__note::before {
  content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--gray-400);
}
@media (max-width: 720px) { .illus img { height: 200px; } }
.serve-card:target { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.serve-card__icon, .serve-card .card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--maroon-050);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.serve-card__icon svg, .serve-card .card__icon svg { width: 28px; height: 28px; color: var(--color-brand); }
.serve-card h3 { font-size: 1.15rem; margin: 0; }
.serve-card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }
.serve-card ul, .serve-card__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; font-size: 0.92rem; color: var(--gray-800); flex-grow: 1; }
.serve-card ul li, .serve-card__list li { position: relative; padding-inline-start: 1.3em; }
.serve-card ul li::before, .serve-card__list li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent);
}
.serve-card .btn, .serve-card__cta { margin-block-start: auto; align-self: flex-start; }
.serve-card .btn { white-space: normal; max-width: 100%; text-align: center; } /* long labels ("Request the Elevator Interiors Specification Pack") wrap inside the card */
.serve-card .btn-block, .serve-card__cta.btn-block { align-self: stretch; }
.serve-card__tagline { font-size: 0.85rem; font-style: italic; color: var(--gold-700); margin: 0; }
/* Villa packages (rendered only when flags.packagesApproved) */
.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-block-start: var(--space-4); }
@media (max-width: 720px) { .packages { grid-template-columns: minmax(0, 1fr); } }
.packages__tier { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3); background: var(--white); }
.packages__tier--featured { border-color: var(--color-brand); box-shadow: var(--shadow-md); }
.packages__tier h4 { font-size: 1.05rem; margin-block-end: 0.5rem; }
.packages__tier ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; font-size: 0.9rem; color: var(--gray-800); }
.packages__price { font-weight: 800; color: var(--color-brand-strong); font-size: 1.2rem; }

/* ---------------------------------------------------------------------- */
/* Cabin refurbishment (#refurbishment) — split copy + before/after slot    */
/* ---------------------------------------------------------------------- */
.refurb, #refurbishment .split { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-5); align-items: center; }
@media (max-width: 860px) { .refurb, #refurbishment .split { grid-template-columns: 1fr; gap: var(--space-4); } }
.refurb__body .btn, #refurbishment .btn { margin-block-start: var(--space-2); }
.refurb__list { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; gap: 0.6rem; }
.refurb__list li { display: flex; gap: 0.6rem; align-items: flex-start; }
.refurb__list li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); margin-block-start: 0.6em; }
/* Before / after pair (only when flags.caseStudiesAvailable) */
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.before-after figure { margin: 0; position: relative; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); }
.before-after img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; }
.before-after figcaption {
  position: absolute; inset-inline-start: 0.6rem; top: 0.6rem; background: rgba(20,8,6,0.7); color: var(--white);
  font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
/* Empty slot when no case study exists yet: a quiet framed panel instead of a photo */
.refurb__media--empty, .refurb__placeholder {
  border: 1.5px dashed var(--maroon-100); border-radius: var(--radius-lg); background: var(--maroon-050);
  min-height: 220px; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-3);
  color: var(--color-text-muted); font-size: 0.95rem;
}

/* ---------------------------------------------------------------------- */
/* Cards: capabilities / products / certs                                  */
/* ---------------------------------------------------------------------- */
.grid { display: grid; gap: var(--space-3); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }
/* T070: the award cards and the why cards are short — a badge and two lines — so the
   blanket one-column rule above wasted half the width and made the awards the tallest
   block on the phone page (3,192 px for eight of them). Two-up reads fine and halves
   it. Anything with real body copy keeps one column. */
@media (max-width: 620px) {
  #quality .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  #quality .cert-card { padding: var(--space-2); }
  #quality .cert-card__badge { width: 48px; height: 48px; margin-block-end: 0.6rem; }
  #quality .cert-card__badge svg { width: 24px; height: 24px; }
  #quality .cert-card__year { font-size: 1rem; margin-block-end: 0.25rem; }
  #quality .cert-card__name { font-size: 0.85rem; }
}
@media (max-width: 340px) {
  /* below this the two-up award cards start breaking words. 340 and not 400: the
     phones that matter here are 360-390 px wide, and a 400 px floor cancelled the
     two-up layout on every one of them. */
  #quality .grid--4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-3); transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  height: 100%; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--maroon-100); }
.card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--maroon-050);
  display: flex; align-items: center; justify-content: center; margin-block-end: var(--space-2); flex-shrink: 0;
}
.card__icon svg { width: 28px; height: 28px; color: var(--color-brand); }
.card h3, .card h4 { font-size: 1.15rem; margin-block-end: 0.4rem; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; flex-grow: 1; }
.card__link { font-weight: 700; font-size: 0.9rem; margin-block-start: 0.75rem; display: inline-flex; align-items: center; gap: 0.3em; }

/* Machine capability rows (fabrication pages): material on the start side, the
   figure on the end side, so the thicknesses line up down the card in both
   writing directions. Logical properties only — rtl.css needs no counterpart. */
.cap-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.cap-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-block: 0.45rem; font-size: 0.95rem; color: var(--color-text-muted);
  border-block-start: 1px solid var(--color-border);
}
.cap-list li:first-child { border-block-start: 0; padding-block-start: 0; }
.cap-list b { font-weight: 700; color: var(--color-text); white-space: nowrap; }
.cap-note { color: var(--color-text-muted); font-size: 0.9rem; margin-block-start: 0.75rem; }

/* T135: the qualifier under a product card's bullets — the "scope confirmed per
   project" line and its siblings, which are the honest limits on each range. */
/* scoped under the body so .card p (0,1,1: 0.95rem, bigger than the 0.9rem bullets, and flex-grow: 1) loses */
.product-card__body .product-card__note { font-size: 0.85rem; color: var(--color-text-muted); margin: 0 0 var(--space-2); flex-grow: 0; }
.product-card { overflow: hidden; padding: 0; }
.product-card__media { aspect-ratio: 4/3; overflow: hidden; background: var(--gray-100); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.product-card:hover .product-card__media img { transform: scale(1.05); }
/* T135: the body fills the card and the button sits on its floor, so three cards with
   5, 3 and 4 bullets still line their buttons up. align-self keeps the button its own
   width instead of stretching across the column. */
.product-card__body { padding: var(--space-3); flex: 1; display: flex; flex-direction: column; }
/* .btn is nowrap; a long label (Arabic especially) must wrap inside the card, never overflow it */
.product-card__body > .btn { margin-block-start: auto; align-self: flex-start; max-width: 100%; white-space: normal; text-align: center; }
.product-card__benefits { list-style: none; padding: 0; margin: 0.6rem 0 0.9rem; font-size: 0.9rem; color: var(--color-text-muted); }
.product-card__benefits li { padding-inline-start: 1.4em; position: relative; margin-block-end: 0.35em; }
.product-card__benefits li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.5em; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-accent);
}

/* ---------------------------------------------------------------------- */
/* Factory overview / split sections                                       */
/* ---------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--space-4); } }
.split--reverse .split__media { order: 2; }
@media (max-width: 860px) { .split--reverse .split__media { order: 0; } }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.split__list { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: 0.9rem; }
.split__list li { display: flex; gap: 0.75rem; align-items: flex-start; }
.split__list .check, .visit-cta ul .check {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--maroon-050);
  color: var(--color-brand); display: flex; align-items: center; justify-content: center; margin-block-start: 0.1em;
}
.split__list .check svg, .visit-cta ul .check svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------- */
/* Process timeline                                                        */
/* ---------------------------------------------------------------------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4) var(--space-3); counter-reset: step; position: relative; }
@media (max-width: 980px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  /* T070: swipe instead of scroll. Eight stacked steps were ~1,500 px of a phone page
     that already ran to 28,000. overflow-x here keeps the sideways scroll inside this
     element — the page body must never scroll horizontally. */
  .timeline {
    grid-template-columns: repeat(8, 78vw);
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    gap: var(--space-3);
    padding-block-end: var(--space-2);
  }
  .timeline__step { scroll-snap-align: start; }
  /* The reveal animation is driven by an IntersectionObserver against the viewport.
     A step scrolled sideways out of this scroller never intersects it, so steps 2-8
     would sit at opacity 0 for ever — invisible the moment a visitor swiped. Inside
     the scroller the reveal is simply off; the steps are there from the start. */
  .js-reveal .timeline [data-animate],
  .js-reveal .timeline__step { opacity: 1; transform: none; }
  /* a scrollable region must be reachable by keyboard; browsers focus it themselves
     once it actually overflows, and this makes that focus visible */
  .timeline:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 4px; }
}
@media (max-width: 560px) and (prefers-reduced-motion: reduce) {
  .timeline { scroll-snap-type: none; }
}
.timeline__step { position: relative; padding-block-start: var(--space-2); }
.timeline__num {
  counter-increment: step; width: 42px; height: 42px; border-radius: 50%; background: var(--color-brand);
  color: var(--white); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-block-end: 0.9rem;
}
.timeline__num::before { content: counter(step); }
.timeline__step h3 { font-size: 1rem; margin-block-end: 0.3rem; }
.timeline__step p { font-size: 0.88rem; color: var(--color-text-muted); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Quality / certificates                                                   */
/* ---------------------------------------------------------------------- */
.cert-card { text-align: center; align-items: center; }
.cert-card__badge {
  width: 64px; height: 64px; border-radius: 50%; background: var(--maroon-050); color: var(--color-brand);
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-2);
}
.cert-card__badge svg { width: 32px; height: 32px; }
/* Award cards: one H4 (year + award name) under the Awards H3; renders exactly like the former h3 + p pair */
.cert-card__title { font-size: inherit; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; flex-grow: 1; }
.cert-card__year { display: block; font-size: 1.15rem; font-weight: 700; line-height: var(--lh-tight); color: var(--color-brand-strong); margin-block-end: 0.4rem; }
.cert-card__name { display: block; font-size: 0.95rem; color: var(--color-text-muted); margin-block-end: var(--space-2); }

/* ---------------------------------------------------------------------- */
/* Customization                                                           */
/* ---------------------------------------------------------------------- */
/* T067: a static library of the six documented finishes replaced the colour-dot tabs, which only changed a
   "Selected:" label. Each finish says where it was used (Projects cards, company profile) and opens the 3D
   customizer with that wall finish already applied (?wall=<id>, read by cabin-configurator.js). */
.finish-library {
  list-style: none; padding: 0; margin: var(--space-3) 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2);
}
@media (max-width: 860px) { .finish-library { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .finish-library { grid-template-columns: minmax(0, 1fr); } }
.finish {
  display: flex; gap: var(--space-2); align-items: flex-start;
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-2);
}
.finish__swatch {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.finish__swatch[data-finish="black-hairline"] { background: repeating-linear-gradient(0deg, #2b2b2c 0 2px, #3b3b3d 2px 3px); }
.finish__swatch[data-finish="grey-mirror"] { background: linear-gradient(135deg, #e6e9ec 0%, #aeb3b8 42%, #dde1e4 52%, #9fa4a9 100%); }
.finish__swatch[data-finish="champagne-brushed"] { background: repeating-linear-gradient(0deg, #c9a97a 0 1px, #d5b98e 1px 3px); }
.finish__swatch[data-finish="gold-mirror"] { background: linear-gradient(135deg, #f7e6ad 0%, #d6b45b 42%, #f0d68b 52%, #c7a049 100%); }
.finish__swatch[data-finish="mirror-polished"] { background: linear-gradient(135deg, #ffffff 0%, #c7ccd1 42%, #f3f5f7 52%, #b7bcc1 100%); }
.finish__swatch[data-finish="white-powder"] { background: #f5f2ee; }
.finish__name { font-size: 1rem; margin: 0 0 0.2rem; }
.finish__use { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 0.35rem; }
.finish__link { font-size: 0.9rem; font-weight: 700; }
.finish-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.finish-notes p { margin: 0; }
@media (max-width: 860px) { .finish-notes { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } }

/* ---------------------------------------------------------------------- */
/* Gallery + lightbox                                                       */
/* ---------------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery__item {
  position: relative; border: none; padding: 0; background: none; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 1/1; display: block; width: 100%;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.gallery__item:hover img { transform: scale(1.08); }
.gallery__item::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(20,8,6,0.75) 100%);
  opacity: 0; transition: opacity var(--transition);
}
.gallery__item:hover::after, .gallery__item:focus-visible::after { opacity: 1; } /* the white caption shows on focus too, so its dark gradient must as well */
.gallery__caption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 0.6rem 0.7rem; color: var(--white); font-size: 0.78rem;
  font-weight: 600; opacity: 0; transform: translateY(6px); transition: var(--transition); text-align: start; z-index: 2;
}
.gallery__item:hover .gallery__caption, .gallery__item:focus-visible .gallery__caption { opacity: 1; transform: translateY(0); }
.gallery__item.gallery__video::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,0.9) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2353140C"><path d="M8 5v14l11-7z"/></svg>') center/22px no-repeat;
  z-index: 3;
}

.lightbox {
  position: fixed; inset: 0; z-index: 900; background: rgba(15,6,4,0.94); display: none;
  align-items: center; justify-content: center; padding: var(--space-3);
}
.lightbox.is-open { display: flex; }
.lightbox__frame { max-width: min(1100px, 92vw); max-height: 84vh; text-align: center; }
.lightbox__frame img { max-height: 78vh; width: auto; margin-inline: auto; border-radius: var(--radius-sm); }
.lightbox__caption { color: var(--gray-100); margin-block-start: 0.8rem; font-size: 0.95rem; }
/* T069: "3 / 12" before the caption. dir="ltr" on the element keeps the digits and the
   slash in that order inside the Arabic caption line. */
.lightbox__pos {
  font-variant-numeric: tabular-nums; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--gray-400); margin-inline-end: 0.5rem;
}
.lightbox__close, .lightbox__prev, .lightbox__next {
  position: absolute; background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.4); color: var(--white);
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,0.22); }
.lightbox__close { top: var(--space-3); inset-inline-end: var(--space-3); }
.lightbox__prev { inset-inline-start: var(--space-3); top: 50%; transform: translateY(-50%); }
.lightbox__next { inset-inline-end: var(--space-3); top: 50%; transform: translateY(-50%); }
[dir="rtl"] .lightbox__prev svg, [dir="rtl"] .lightbox__next svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------------- */
/* Projects filter                                                         */
/* ---------------------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-block-end: var(--space-4); }
.filter-chip {
  padding: 0.5rem 1.05rem; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--white);
  font-weight: 700; font-size: 0.88rem; color: var(--gray-700);
}
.filter-chip[aria-pressed="true"] { background: var(--color-brand); border-color: var(--color-brand); color: var(--white); }
.project-card__tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-brand); background: var(--maroon-050); padding: 0.25rem 0.6rem; border-radius: 999px; margin-block-end: 0.6rem;
}
/* The project cards' meta line (TODO T066): emirate · year · landings, then the building type as a
   tag. It renders only for a card with a verified field in content/site.json → projects
   (content/README.md §2c), and sits at the card's foot — the description keeps the spare height. */
.card .project-card__meta { flex-grow: 0; margin-block-start: 0.75rem; font-size: 0.85rem; font-weight: 600; }
.project-card__meta .project-card__tag { margin-block-end: 0; }

/* ---------------------------------------------------------------------- */
/* Why Massaed                                                             */
/* ---------------------------------------------------------------------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
@media (max-width: 860px) { .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* T070: two-up rather than one, down to 400 px — these cards are an icon, a heading
   and a line, and one column made this 1,366 px of an already very long phone page. */
@media (max-width: 340px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Factory visit CTA                                                       */
/* ---------------------------------------------------------------------- */
.visit-cta {
  background: linear-gradient(120deg, var(--maroon-900) 0%, var(--maroon-800) 100%);
  color: var(--white); border-radius: var(--radius-lg); padding: var(--space-5);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-4); align-items: center;
}
.visit-cta h2 { color: var(--white); }
.visit-cta p, .visit-cta li { color: var(--gray-100); }
.visit-cta--dark { background: linear-gradient(120deg, var(--gray-900) 0%, var(--gray-800) 100%); grid-template-columns: 1.4fr auto; }
/* minmax(0, 1fr), not 1fr: a bare 1fr track cannot shrink below its content's min-content width, and the
   Arabic download card ran 3 px past a 310 px viewport — a desktop at 400% zoom with its scrollbar (T081) */
@media (max-width: 860px) { .visit-cta, .visit-cta--dark { grid-template-columns: minmax(0, 1fr); padding: var(--space-4) var(--space-3); } }
.visit-cta ul { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; gap: 0.6rem; }
.visit-cta ul li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.visit-cta__map { border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
.visit-cta__map iframe { width: 100%; height: 260px; border: 0; display: block; }
/* Address + "Open in Google Maps" under the map: still there when the embed is blocked (T035). Text colour comes from .visit-cta p;
   gold-500 on the maroon panel is ≈6-7:1 */
.visit-cta__address { margin: 0.75rem 0 0; font-size: 0.95rem; }
.visit-cta__address a { color: var(--gold-500); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------------- */
/* Lead form                                                                */
/* ---------------------------------------------------------------------- */
.form-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--space-4); border: 1px solid var(--color-border);
}
@media (max-width: 560px) { .form-card { padding: var(--space-3) var(--space-2); border-radius: var(--radius-md); } }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); margin-block-end: var(--space-3); }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; min-width: 0; }
.hp-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); }
.field .req { color: var(--color-brand); }
.field input, .field select, .field textarea {
  padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border-strong);
  font-family: inherit; font-size: 0.95rem; background: var(--white); color: var(--gray-900);
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* The focus halo replaces the outline, so it must itself reach 3:1 on the white card (WCAG 1.4.11):
   rgba(83,20,12,0.55) blends to ≈#a07e79 ≈ 3.6:1 (the previous 0.35 blended to ≈2.1:1) */
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--color-brand); box-shadow: 0 0 0 3px rgba(83, 20, 12, 0.55); outline: none;
}
/* The native checkbox (privacy consent) has no border to recolour, so it keeps the global keyboard
   focus outline instead of the ring above (WCAG 2.4.7) */
.field input[type="checkbox"]:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; box-shadow: none; }
.field textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 0.8rem; color: var(--color-text-muted); }
.field-error { font-size: 0.82rem; color: var(--error); display: none; font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); }
.field.has-error .field-error { display: block; }
/* Mobile / email group: one of the two is required — the shared note carries the error */
.field.contact-missing input { border-color: var(--error); }
.form-note {
  font-size: 0.88rem; color: var(--color-text-muted);
  margin: 0 0 calc(var(--space-1) - var(--space-3)); /* sits close to the two fields it describes */
}
.form-note .req { color: var(--color-brand); }
.form-note.is-error { color: var(--error); font-weight: 600; }
.form-note.is-error .req { color: inherit; }
/* "If this form doesn't respond, email … or call …" — main.js hides it once the submit handler is bound (DEG-02) */
.form-nojs-note { font-size: 0.88rem; color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.field--file { border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-sm); padding: var(--space-2); text-align: center; }
/* File picker in the page language (T079): the native control shows browser-language text ("Choose File"), so it is
   visually hidden but stays focusable; the <label class="btn … file-btn"> after it opens the dialog and shows its focus */
.file-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.75rem; }
.field--file input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; box-shadow: none; } /* outranks .field input */
.file-btn { cursor: pointer; }
.field--file .file-btn { font-size: 0.88rem; color: var(--color-brand); } /* .field label (gray, 0.9rem) would otherwise win over .btn-outline / .btn-sm */
.field--file input[type="file"]:focus-visible ~ .file-btn { outline: 3px solid var(--color-focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--white); }
.field--file.has-error .file-btn { border-color: var(--error); color: var(--error); }
.file-name { font-size: 0.85rem; color: var(--color-text-muted); min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
/* "Remove file" (FE-10): not stretched to the full width of the .field column */
.field--file [data-file-clear] { align-self: center; }
/* The "attach it in the email that opens" sentence is only true without a backend (kept in a span the build can strip) */
.field-hint [data-mailto-only] { display: inline; }
/* Without JavaScript the form does a plain POST to action="#lead-form" — no email app opens, so the sentence is false (DEG-02) */
html:not(.js) .field-hint [data-mailto-only] { display: none; }
/* Conditional fields (data-show-for) are hidden with the attribute by main.js; when shown they keep the grid flow */
.field[data-show-for] { grid-column: 1 / -1; }
@media (min-width: 721px) { .field[data-show-for] { grid-column: auto; } }
.checkbox-row { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; color: var(--color-text-muted); }
.checkbox-row input { margin-block-start: 0.25em; flex-shrink: 0; }
.field--consent { margin-block: var(--space-2) var(--space-3); }

/* Design attached from the 3D cabin configurator (shown by main.js) */
.design-attached, .visit-note {
  background: var(--maroon-050); border: 1.5px solid var(--maroon-100); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); margin-block-end: var(--space-3);
}
.design-attached__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem var(--space-2); }
.design-attached__title { color: var(--color-brand-strong); }
/* Padding widens the tap target to ~40px; the matching negative margin keeps the layout unchanged */
.design-attached__edit { font-weight: 700; font-size: var(--fs-small); padding-block: 0.6rem; margin-block: -0.6rem; }
.design-attached__list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.design-attached__list li {
  background: var(--white); border: 1px solid var(--color-border); border-radius: 1.1rem; /* stays rounded if a long finish name wraps */
  padding: 0.25rem 0.7rem; font-size: 0.85rem; line-height: 1.4;
  min-width: 0; max-width: 100%; overflow-wrap: anywhere; /* a very long finish name wraps instead of widening the page */
}
/* "Factory visit request" note, added above the fields by main.js on a visit intent */
.visit-note { margin-block-start: 0; padding: 0.75rem var(--space-2); font-weight: 600; font-size: 0.9rem; color: var(--color-brand-strong); }
.design-attached__label { color: var(--color-text-muted); margin-inline-end: 0.15rem; } /* plus the space text node added by main.js */
/* "Attach my saved 3D cabin design (D-xxxxxx)" — shown by main.js only for a valid design saved in this browser */
.design-offer { margin: 0 0 var(--space-3); }
.design-offer .btn { white-space: normal; text-align: start; max-width: 100%; } /* the long label wraps instead of scrolling the page sideways at 390 px */

/* Optional project details, collapsed by default */
details.form-more {
  border-block: 1px solid var(--color-border); padding-block: var(--space-2); margin-block-end: var(--space-3);
}
details.form-more > summary {
  display: flex; align-items: center; gap: 0.6rem; /* full-width row = large tap target on phones */
  padding-block: 0.75rem; margin-block: -0.75rem; /* ~49px tall to tap, same visual position (inside the details padding) */
  cursor: pointer; font-weight: 700; color: var(--color-brand); list-style: none; border-radius: 4px;
}
details.form-more > summary::-webkit-details-marker { display: none; }
details.form-more > summary::marker { content: ""; }
/* Plus sign in a ring that turns into a minus when open — symmetric, so it needs no RTL flip */
details.form-more > summary::before {
  content: ""; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--color-border);
  background:
    linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat;
  transition: transform var(--transition), background-size var(--transition);
}
details.form-more[open] > summary::before {
  transform: rotate(180deg);
  background-size: 10px 2px, 2px 0;
}
details.form-more > summary:hover { color: var(--maroon-700); }
details.form-more > summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 0; }
details.form-more > .form-grid { margin-block: var(--space-3) 0; }

.form-fallback { margin-block-start: var(--space-2); display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* Confirmation after a live send (#thank-you): optional approved response time, "more drawings" line and next actions */
.thank-you__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-block-start: var(--space-2); }
.thank-you__more, .thank-you__sla { margin-block-start: var(--space-2); }
.form-status { display: none; padding: 1rem 1.1rem; border-radius: var(--radius-sm); margin-block-end: var(--space-3); font-weight: 600; }
.form-status.is-success { display: block; background: #eaf6ef; color: var(--success); border: 1px solid #bfe4cf; }
.form-status.is-error { display: block; background: #fbeceb; color: var(--error); border: 1px solid #f0c6c3; }
/* Email-app hand-off: a neutral "next step" notice, deliberately not green — the request is not sent until the visitor presses Send */
.form-status.is-info {
  display: block; background: var(--color-info-bg); color: var(--color-info-text); border: 1px solid var(--color-info-border);
  border-inline-start: 4px solid var(--color-info-text);
}
.form-status.is-info a { color: inherit; }
.form-status .form-status__ref { font-family: ui-monospace, Consolas, "Courier New", monospace; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.form-status .form-status__attach { display: block; margin-block-start: 0.5rem; font-weight: 700; }
.form-status p { color: inherit; margin: 0 0 0.5rem; }
.form-status p:last-child { margin: 0; }

/* ---------------------------------------------------------------------- */
/* FAQ accordion                                                           */
/* ---------------------------------------------------------------------- */
.accordion { border-block-start: 1px solid var(--color-border); max-width: 900px; }
.accordion-item { border-block-end: 1px solid var(--color-border); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: none; padding: 1.2rem 0.25rem; text-align: start; font-weight: 700; font-size: 1.02rem; color: var(--gray-900);
}
.accordion-trigger .plus { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--color-border); position: relative; }
.accordion-trigger .plus::before, .accordion-trigger .plus::after {
  content: ""; position: absolute; background: var(--color-brand); top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.accordion-trigger .plus::before { width: 12px; height: 2px; }
.accordion-trigger .plus::after { width: 2px; height: 12px; transition: transform var(--transition); }
.accordion-trigger[aria-expanded="true"] .plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.accordion-panel { padding: 0 0.25rem 1.3rem; color: var(--color-text-muted); max-width: 39.2em; } /* = 70ch in Cairo at 400 (T141) */
/* Answers collapse only once main.js has run (html.js); without it every FAQ answer stays readable */
.js .accordion-panel { display: none; }
.js .accordion-panel.is-open { display: block; }
