/* MFC — page sections shared by Home and Projects: hero, section head, project rail, stages, CTA */
/* ───────── 1. Hero ───────── */
.p-hero { position: relative; min-height: max(640px, 100svh); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; overflow: hidden; background: var(--navy); isolation: isolate; }
.p-hero__media { position: absolute; inset: 0; z-index: -2; }
.p-hero__media img, .p-hero__media video { display: block; width: 100%; height: 115%; object-fit: cover; object-position: 50% 45%; transform: scale(1.08); transition: transform 2.6s var(--ease); will-change: transform; }
.p-hero.is-loaded .p-hero__media img, .p-hero.is-loaded .p-hero__media video { transform: scale(1); }
.p-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(1, 14, 40, .5) 0%, rgba(1, 14, 40, .06) 26%, rgba(1, 14, 40, .22) 52%, rgba(1, 14, 40, .9) 100%), linear-gradient(90deg, rgba(1, 14, 40, .38) 0%, rgba(1, 14, 40, 0) 55%); }
:root[dir="rtl"] .p-hero::after { background: linear-gradient(180deg, rgba(1, 14, 40, .5) 0%, rgba(1, 14, 40, .06) 26%, rgba(1, 14, 40, .22) 52%, rgba(1, 14, 40, .9) 100%), linear-gradient(270deg, rgba(1, 14, 40, .38) 0%, rgba(1, 14, 40, 0) 55%); }
.p-hero__body { display: grid; gap: 28px; padding-bottom: clamp(40px, 6vh, 72px); }
.p-hero .t-label { color: rgba(255, 255, 255, .72); }
.p-hero__aside { max-width: 34ch; color: rgba(255, 255, 255, .82); font-size: 17px; line-height: 1.5; font-weight: 300; margin: 0; }
.p-hero__bar { display: grid; grid-template-columns: repeat(3, auto) 1fr; align-items: end; gap: clamp(24px, 4vw, 72px); padding: 22px 0 max(22px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .22); }
.stat__n { display: block; font-size: clamp(28px, 2.6vw, 44px); line-height: 1; font-weight: 300; letter-spacing: var(--track-h2); font-variant-numeric: tabular-nums; }
.stat__l { display: block; margin-top: 10px; font-size: 13px; line-height: 1; color: rgba(255, 255, 255, .64); }
.p-hero__scroll { justify-self: end; width: 52px; height: 52px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: rgba(255, 255, 255, .06); transition: background-color .3s var(--ease); }
.p-hero__scroll:hover { background: rgba(255, 255, 255, .18); }
.p-hero__scroll svg { width: 20px; height: 20px; animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@media (min-width: 840px) {
  .p-hero__body { grid-template-columns: 1fr auto; align-items: end; gap: 48px; }
  .p-hero__head { display: grid; gap: 28px; }
}
@media (max-width: 559px) {
  .p-hero__bar { grid-template-columns: repeat(3, 1fr); }
  .p-hero__scroll { display: none; }
}

/* ───────── Section head (shared on this page) ───────── */
.s-head { display: grid; gap: 20px; margin-bottom: clamp(28px, 3.2vw, 48px); }
.s-head > .btn, .s-head > .rail-nav { justify-self: start; }
.s-head__side { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
@media (min-width: 840px) {
  .s-head { grid-template-columns: 1fr auto; align-items: end; }
}

/* ───────── 2. Selected (horizontal) ───────── */
.p-featured { padding: var(--section) 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(86vw, 1080px); gap: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--margin); padding-inline: var(--margin); scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.is-dragging a { pointer-events: none; }
@media (min-width: 840px) { .rail { grid-auto-columns: min(64vw, 1180px); } }
.feat { position: relative; display: block; scroll-snap-align: start; text-decoration: none; color: #fff; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); }
@media (min-width: 840px) { .feat { aspect-ratio: 16 / 10; } }
.feat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.feat:hover img { transform: scale(1.04); }
.feat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(1, 14, 40, .38) 0%, rgba(1, 14, 40, 0) 30%, rgba(1, 14, 40, 0) 52%, rgba(1, 14, 40, .78) 100%); }
.feat__top, .feat__bottom { position: absolute; inset-inline: clamp(20px, 2.4vw, 36px); z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.feat__top { top: clamp(20px, 2.4vw, 36px); align-items: flex-start; }
.feat__bottom { bottom: clamp(20px, 2.4vw, 36px); }
.feat .t-label { color: rgba(255, 255, 255, .8); }
.feat__name { font-size: clamp(28px, 3vw, 52px); line-height: 1.02; letter-spacing: var(--track-h2); font-weight: 300; margin: 0; }
.feat__city { margin: 10px 0 0; font-size: 15px; color: rgba(255, 255, 255, .78); }
.glass-tag { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; font-size: 13px; letter-spacing: .01em; font-variant-numeric: tabular-nums; color: #fff; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.glass-arrow { flex: none; width: 52px; height: 52px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24); transition: background-color .3s var(--ease), color .3s var(--ease); }
.glass-arrow svg { width: 20px; height: 20px; transition: transform .45s var(--ease); }
.feat:hover .glass-arrow { background: #fff; color: var(--navy); }
.feat:hover .glass-arrow svg { transform: translate(2px, -2px); }
:root[dir="rtl"] .glass-arrow svg { transform: scaleX(-1); }
:root[dir="rtl"] .feat:hover .glass-arrow svg { transform: scaleX(-1) translate(2px, -2px); }
.rail-foot { display: flex; align-items: center; gap: 24px; margin-top: 32px; }
.rail-progress { flex: 1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.rail-progress span { position: absolute; inset-block: 0; inset-inline-start: 0; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--p, .2)); transition: transform .3s var(--ease); }
:root[dir="rtl"] .rail-progress span { transform-origin: right; }
.rail-nav { display: flex; gap: 8px; }

/* ───────── 4. Stages (construction first) ───────── */
.p-stages { padding: var(--section) 0; }
.stages { display: grid; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .stages { grid-template-columns: repeat(4, 1fr); } }
.stage { position: relative; display: flex; flex-direction: column; gap: 24px; padding: 28px 0 40px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.stage::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: calc(-1 * var(--gutter)); width: 1px; background: var(--line); display: none; }
@media (min-width: 640px) { .stages { column-gap: calc(2 * var(--gutter)); } .stage:nth-child(2n)::before { display: block; } }
@media (min-width: 1100px) { .stage::before { display: block; } .stage:first-child::before { display: none; } }
.stage__n { font-size: clamp(56px, 5.4vw, 96px); line-height: .9; font-weight: 200; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stage__media { position: relative; aspect-ratio: 4 / 5; background: var(--surface); }
.stage__media img { width: 100%; height: 100%; object-fit: cover; }
.stage:hover .stage__media img { transform: scale(1.04); }
.stage__media.reveal-img.is-in img { transition: transform 1.2s var(--ease); }
.stage .t-body { max-width: 30ch; }
.stage__go { margin-top: auto; align-self: stretch; width: 100%; }
.stage:hover .stage__go { background: var(--g-bg-hover); }
.stage:hover .stage__go .btn__icon { transform: translate(2px, -2px); }
:root[dir="rtl"] .stage:hover .stage__go .btn__icon { transform: translate(-2px, -2px); }
/* Photo still to come: a quiet drafting grid with a label */
.slot { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 18px; color: var(--muted);
  background-color: var(--surface);
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px; }
.slot .t-label { color: var(--accent); }
.slot span:last-child { font-size: 13px; }

/* ───────── 5. CTA (navy with pattern) ─────────
   Pattern file goes in --cta-pattern. Size: SVG preferred (any size).
   If raster: laptop 3840 × 1600 px, phone 1170 × 1560 px (both cover-cropped from the centre). */
.p-cta { position: relative; overflow: hidden; color: #fff; background-color: var(--navy); isolation: isolate; }
/* Background pattern supplied by MFC (vector, from the PDF): wide version on laptop, tall version on phone */
.p-cta__pattern { position: absolute; inset: 0; z-index: -1; background: var(--navy) url("patterns/cta-pattern-laptop.svg") center / cover no-repeat; }
@media (max-width: 839px) { .p-cta__pattern { background-image: url("patterns/cta-pattern-phone.svg"); } }
.p-cta__in { display: grid; gap: 40px; padding: var(--section) 0; }
.p-cta__text { display: grid; align-content: space-between; gap: 40px; }
.p-cta h2 { font-size: clamp(34px, 3.8vw, 68px); line-height: 1.02; letter-spacing: var(--track-h2); font-weight: 300; margin: 0; }
:root[dir="rtl"] .p-cta h2 { line-height: 1.25; }
.p-cta__foot { display: grid; gap: 28px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .18); }
.p-cta__foot p { margin: 0; max-width: 36ch; color: rgba(255, 255, 255, .78); font-size: clamp(17px, 1.2vw, 20px); line-height: 1.5; font-weight: 300; }
.p-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* Photo place in the CTA: 4:5, min 1600 × 2000 px */
.p-cta__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.p-cta__media img { width: 100%; height: 100%; object-fit: cover; }
.slot--dark { color: rgba(255, 255, 255, .72); background-color: rgba(255, 255, 255, .06);
  background-image: linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
@media (min-width: 840px) {
  .p-cta__in { grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: stretch; }
  .p-cta__text { grid-column: 1 / span 6; }
  .p-cta__media { grid-column: 8 / span 5; }
}

/* Each project card carries its own "View project" button (glass, like every button) */
.feat .feat__cta { flex: none; --g-bg: rgba(255, 255, 255, .14); --g-bg-hover: rgba(255, 255, 255, .24); --g-edge: rgba(255, 255, 255, .3); --g-ink: #fff; }
.feat:hover .feat__cta { background: var(--g-bg-hover); }
.feat:hover .feat__cta .btn__icon { transform: translate(2px, -2px); }
:root[dir="rtl"] .feat:hover .feat__cta .btn__icon { transform: translate(-2px, -2px); }
@media (max-width: 639px) {
  .feat__bottom { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* Phone: the four fields become a swipe slider (one card and a peek of the next) */
@media (max-width: 639px) {
  .stages { grid-auto-flow: column; grid-auto-columns: 82%; column-gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--margin)); padding-inline: var(--margin); scroll-padding-inline: var(--margin); border-top: 0; scrollbar-width: none; }
  .stages::-webkit-scrollbar { display: none; }
  .stage { scroll-snap-align: start; border-bottom: 0; border-top: 1px solid var(--line); padding: 24px 0 8px; }
  .stage::before { display: none; }
}

/* Phone: the hero title sits at the top, in the sky; numbers and buttons stay at the bottom */
@media (max-width: 839px) {
  .p-hero > .container { flex: 1; display: flex; flex-direction: column; }
  .p-hero .p-hero__body { margin-bottom: auto; padding-top: calc(var(--hdr-row) + env(safe-area-inset-top) + 40px); padding-bottom: 32px; }
  .p-hero::after { background: linear-gradient(180deg, rgba(1, 14, 40, .55) 0%, rgba(1, 14, 40, .12) 38%, rgba(1, 14, 40, .2) 60%, rgba(1, 14, 40, .88) 100%); }
}

/* Sections alternate: white, then light grey, then white… so every section reads as its own band.
   Photo places swap to the opposite tone so they stay visible. */
.alt { background: var(--surface); }
.alt .slot, .alt .stage__media { background-color: var(--bg); }
.alt .toolbar { background: color-mix(in srgb, var(--surface) 72%, transparent); }
