/* Marwan Ghostine — Davies V2 portfolio overrides */

:root {
  --primary: #58B8C6;
  --primary-rgb: 88, 184, 198;
}

html, body {
  overflow-x: clip;
}

/* Header / identity */
.mg-logo {
  font-weight: 700;
  letter-spacing: -.06em;
  font-size: 18px;
  line-height: 1;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 41px;
}
.mg-hero-meta {
  max-width: 360px;
  color: rgba(255, 255, 255, .64);
  line-height: 1.5;
}
.mg-project-number { font-weight: 600; letter-spacing: .08em; }
.mg-view-label {
  color: rgba(255, 255, 255, .64);
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 500;
}
.mg-location {
  white-space: pre-line;
  color: rgba(255, 255, 255, .64);
  line-height: 1.6;
  text-transform: uppercase;
}
.mg-section-kicker { margin: 32px 0 24px; }
.mg-contact-mark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.08em;
  color: var(--primary);
}
.mg-contact-panel {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.mg-contact-line {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  align-items: center;
}
.mg-contact-line span {
  color: rgba(255, 255, 255, .48);
  font-size: 12px;
  letter-spacing: .12em;
}
.mg-contact-line a,
.mg-contact-line strong {
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 500;
  color: #fff;
  text-decoration: none;
}
.mg-contact-actions { padding: 32px 0; }

.preloader .site-name span {
  font-size: clamp(36px, 12vw, 80px);
  letter-spacing: -.06em;
}

/* ------------------------------------------------------------------ */
/* Hero: editorial portrait + original Davies MARWAN stroke/fill layers */
/* ------------------------------------------------------------------ */
.section-hero-v2 { overflow-x: clip; }
.section-hero-v2 .overlay { background: rgba(0, 0, 0, .79); }
.section-hero-v2 .image-wrap {
  overflow-x: clip;
  max-width: 100%;
}
.section-hero-v2 .image-wrap .img-item {
  position: relative;
  overflow: hidden;
  z-index: 1;
  width: clamp(220px, 24vw, 400px);
  max-width: min(70vw, 400px);
  margin-inline: auto;
}
.section-hero-v2 .image-wrap .img-item > img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: center 14%;
}
.section-hero-v2 .image-wrap .image-child,
.section-hero-v2 .img-item-2 {
  pointer-events: none;
}
.section-hero-v2 .image-wrap .image-child {
  opacity: .28;
  position: absolute;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(calc(100vw - 32px), 1296px);
  max-width: none;
  transform: translate(-50%, -50%);
}
.section-hero-v2 .img-item-2 {
  position: absolute;
  left: 50%;
  right: auto;
  top: 50%;
  width: min(100%, calc(100vw - 32px), 1296px);
  max-width: 100%;
  transform: translate(-50%, -50%);
  z-index: 0;
  overflow: hidden;
}
.section-hero-v2 .image-child img,
.section-hero-v2 .img-item-2 img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.section-hero-v2 .img-item-2::after {
  background-color: var(--primary);
}

@media (max-width: 1024px) {
  .section-hero-v2 .image-wrap .img-item {
    width: clamp(200px, 30vw, 340px);
    max-width: min(68vw, 340px);
  }
}
@media (max-width: 767px) {
  .mg-hero-meta { order: 3; width: 100%; max-width: none; }
  .section-hero-v2 .image-wrap .img-item {
    width: min(56vw, 268px);
    max-width: min(70vw, 268px);
  }
  .section-hero-v2 .image-wrap .img-item > img {
    object-position: center 8%;
  }
  .section-hero-v2 .image-wrap .image-child {
    width: min(calc(100vw - 24px), 1296px);
  }
  .section-hero-v2 .img-item-2 {
    width: min(100%, calc(100vw - 24px));
  }
}
@media (max-width: 430px) {
  .section-hero-v2 .image-wrap .img-item {
    width: min(62vw, 240px);
    max-width: min(72vw, 240px);
  }
}

/* ------------------------------------------------------------------ */
/* Selected work + film modal                                          */
/* ------------------------------------------------------------------ */
.section-selected-work-v2 .wg-work { cursor: default; }
.section-selected-work-v2 .wg-work .work-image {
  aspect-ratio: 2 / 1;
  overflow: hidden;
}
.section-selected-work-v2 .wg-work .work-image img {
  min-height: 0;
  height: 100%;
}
.section-selected-work-v2 a.wg-work {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.section-selected-work-v2 a.wg-work .work-image img {
  transition: transform .65s cubic-bezier(.2, .7, .2, 1), filter .5s ease;
}
.section-selected-work-v2 a.wg-work:hover .work-image img {
  transform: scale(1.018);
  filter: brightness(1.06);
}
.section-selected-work-v2 a.wg-work:hover .mg-view-label { color: var(--primary); }
@media (max-width: 767px) {
  .section-selected-work-v2 .wg-work .work-image { aspect-ratio: 16 / 10; }
  .section-selected-work-v2 .wg-work .work-content { padding: 16px; }
  .section-selected-work-v2 .wg-work h5 { font-size: 22px; }
}

.mg-film-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: rgba(3, 5, 6, .94);
  color: #fff;
  overflow: auto;
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 100000;
}
.mg-film-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mg-film-modal::backdrop {
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(12px);
}
.mg-film-modal.is-open { opacity: 1; }
.mg-film-shell {
  width: min(100%, 1320px);
  transform: scale(.97);
  transition: transform .25s ease;
}
.mg-film-modal.is-open .mg-film-shell { transform: scale(1); }
.mg-film-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.mg-film-title {
  font-size: clamp(12px, 1.2vw, 16px);
  letter-spacing: .06em;
  margin: 0;
  color: rgba(255, 255, 255, .72);
}
.mg-film-close {
  flex-shrink: 0;
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb), .4);
  padding: 10px 16px;
  min-height: 44px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
}
.mg-film-close:hover,
.mg-film-close:focus-visible {
  background: var(--primary);
  color: #000;
}
.mg-film-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 130px);
  background: #000;
}
.mg-film-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
html.mg-film-open,
html.mg-film-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
@media (max-width: 575px) {
  .mg-film-modal { padding: 16px; }
  .mg-film-header { gap: 12px; }
}

/* ------------------------------------------------------------------ */
/* About                                                               */
/* ------------------------------------------------------------------ */
.about-main .davies-video { overflow: hidden; }
.about-main .mg-about-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 86% 46%;
  transform: scale(1.08);
  filter: grayscale(1) contrast(1.18) brightness(.72);
}
.about-main .content h5 {
  max-width: 560px;
  font-size: clamp(21px, 2.6vw, 29px);
  line-height: 1.34;
}
@media (max-width: 767px) {
  .about-main .content h5 { font-size: 20px; }
  .mg-contact-line { grid-template-columns: 1fr; gap: 8px; }
}

/* ------------------------------------------------------------------ */
/* Tech Stack — keep Unicorn Studio 4×2 layout                         */
/* ------------------------------------------------------------------ */
.section-tech-stack-v2#techStackScroll .s-header { margin-bottom: 48px; }
.mg-tech-grid {
  grid-template-columns: repeat(4, minmax(0, 210px)) !important;
  gap: 22px !important;
  justify-content: center;
  place-items: center;
  max-width: 950px;
  margin: 0 auto;
}
.section-tech-stack-v2 .mg-tech-card {
  width: 210px !important;
  max-width: 210px !important;
  min-width: 0;
  padding: 18px;
}
.mg-tech-card .tech-content {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mg-tech-card .tech-name {
  margin: 0 0 12px !important;
  max-width: 170px;
  font-size: 18px;
  line-height: 1.15;
  text-align: center;
}
.mg-tech-card .tech-desc {
  margin: 0 0 18px !important;
  max-width: 165px;
  min-height: 34px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: rgba(255, 255, 255, .58);
}
.mg-tech-card .mg-tech-logo {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mg-tech-card .mg-tech-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: none;
  opacity: .95;
}
@media (max-width: 1199px) {
  .mg-tech-grid {
    grid-template-columns: repeat(4, minmax(0, 190px)) !important;
    max-width: 850px;
    gap: 18px !important;
  }
  .section-tech-stack-v2 .mg-tech-card {
    width: 190px !important;
    max-width: 190px !important;
  }
}
@media (max-width: 991px) {
  .mg-tech-grid {
    grid-template-columns: repeat(2, minmax(0, 210px)) !important;
    max-width: 470px;
    gap: 18px !important;
  }
  .section-tech-stack-v2 .mg-tech-card {
    width: 210px !important;
    max-width: 210px !important;
  }
}
@media (max-width: 520px) {
  .section-tech-stack-v2#techStackScroll .s-header { margin-bottom: 30px; }
  .mg-tech-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: none;
    width: 100%;
    gap: 12px !important;
  }
  .section-tech-stack-v2 .mg-tech-card {
    width: 100% !important;
    max-width: none !important;
    padding: 14px;
  }
  .mg-tech-card .tech-name { font-size: 15px; max-width: 130px; margin-bottom: 8px !important; }
  .mg-tech-card .tech-desc { font-size: 10px; max-width: 120px; min-height: 30px; margin-bottom: 12px !important; }
  .mg-tech-card .mg-tech-logo { height: 34px; }
  .mg-tech-card .mg-tech-logo img { width: 32px; height: 32px; }
}

/* ------------------------------------------------------------------ */
/* Areas of Practice — shared media well + existing slideshow          */
/* ------------------------------------------------------------------ */
.section-service-v2 .accordion-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 29%);
  align-items: start;
  gap: 30px 12px;
}
.section-service-v2 .content-right {
  min-width: 0;
  white-space: normal;
}
.section-service-v2 .accordion-content .image-left.mg-practice-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 200px;
  overflow: hidden;
  background: #f2f2f0;
}
.section-service-v2 .accordion-content .image-left.mg-practice-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  display: block;
}
.section-service-v2 #service-1 .mg-practice-media {
  background: #090909;
}
.section-service-v2 #service-3 .mg-practice-media {
  background: #080808;
}
.mg-practice-slider {
  isolation: isolate;
}
.mg-practice-slider .mg-slide {
  opacity: 0;
  z-index: 0;
  transition: opacity .8s ease;
}
.mg-practice-slider .mg-slide.is-active {
  opacity: 1;
  z-index: 1;
}
.section-service-v2 .mg-brand-slide {
  object-fit: contain;
  object-position: center;
  background: #f2f2f0;
  padding: clamp(16px, 4%, 36px);
  box-sizing: border-box;
}
.section-service-v2 .mg-paint-slide {
  object-fit: cover;
  object-position: center;
  background: #080808;
}
@media (max-width: 767px) {
  .section-service-v2 .accordion-content .image-left.mg-practice-media {
    aspect-ratio: 16 / 9;
  }
}
@media (max-width: 575px) {
  .section-service-v2 .accordion-content {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Selected Client Experience — light band, monochrome logos           */
/* ------------------------------------------------------------------ */
.section-brand .brand-list { align-items: stretch; }
.section-brand .mg-client-logo {
  --logo-scale: 1.45;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 196px;
  padding: 20px;
  background: transparent;
  overflow: hidden;
}
.section-brand .mg-client-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  filter: grayscale(1) brightness(.42) contrast(1.35);
  mix-blend-mode: multiply;
  opacity: 1;
  transform: scale(var(--logo-scale));
  transition: opacity .25s ease, transform .25s ease;
}
.section-brand .mg-client-logo:nth-child(2) { --logo-scale: 2.1; }
.section-brand .mg-client-logo:nth-child(6),
.section-brand .mg-client-logo:nth-child(7) { --logo-scale: 1.58; }
.section-brand .mg-client-logo:nth-child(5) { --logo-scale: 1.35; }
.section-brand .mg-client-logo:nth-child(8) { --logo-scale: 1.31; }
.section-brand .mg-client-logo:nth-child(9) { --logo-scale: 1.2; }
.section-brand .mg-client-logo:nth-child(10) { --logo-scale: 1.14; }
.section-brand .mg-logo-dafza { --logo-scale: .76; }
.section-brand .mg-logo-hmbsu { --logo-scale: .92; }
.section-brand .mg-logo-hectare { --logo-scale: .6; }
.section-brand .mg-logo-qatar-ittf { --logo-scale: .9; }
.section-brand .mg-logo-rotana { --logo-scale: .95; }
.section-brand .mg-logo-smbz { --logo-scale: 1.05; }
.section-brand .mg-logo-accor { --logo-scale: .6; }
.section-brand .mg-logo-panorama,
.section-brand .mg-logo-taif { --logo-scale: 1.68; }
.section-brand .mg-logo-un { --logo-scale: .65; }
.section-brand .mg-client-logo:hover img {
  opacity: 1;
  transform: scale(calc(var(--logo-scale) + .05));
}
@media (max-width: 1199px) {
  .section-brand .mg-client-logo { min-height: 168px; padding: 24px; }
}
@media (max-width: 767px) {
  .section-brand .brand-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .section-brand .mg-client-logo { min-height: 132px; padding: 16px; }
}

/* ------------------------------------------------------------------ */
/* Key Clients — Davies flip cards on dark grounds                     */
/* ------------------------------------------------------------------ */
.mg-key-clients .award-item { color: #171717; }
.mg-key-clients .col-right h5 { max-width: 520px; }
.mg-key-clients .flip-image {
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mg-key-clients .flip-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  filter: none;
}

/* ------------------------------------------------------------------ */
/* Footer wordmark                                                     */
/* ------------------------------------------------------------------ */
.tf-footer.style-2 .footer-bottom { overflow-x: clip; }
.tf-footer.style-2 .img-agency,
.tf-footer.style-2 .footer-bottom .img-agency {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
}
.mg-footer-outline {
  width: 100%;
  margin-inline: auto;
  text-align: center;
  font-size: clamp(72px, 17.2vw, 260px);
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: .82;
  color: transparent;
  -webkit-text-stroke: .55px rgba(255, 255, 255, .9);
  paint-order: stroke fill;
  white-space: nowrap;
  padding: 8px 0 20px;
}
@media (max-width: 767px) {
  .mg-footer-outline {
    font-size: clamp(64px, 18vw, 120px);
    -webkit-text-stroke: .4px rgba(255, 255, 255, .9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-film-modal,
  .mg-film-shell,
  .mg-practice-slider .mg-slide,
  .section-selected-work-v2 a.wg-work .work-image img,
  .section-brand .mg-client-logo img {
    transition: none;
  }
}
