/*
  Digital Mastery media layer — Version 7 / Lucid Authority: Living Architecture
  Keeps responsive imagery and logo presentation separate from the approved
  Version 4 master design system.
*/

.c-media-frame {
  position: relative;
  display: block;
  min-height: 17rem;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  background: var(--dm-midnight);
  border-radius: 0;
}

.c-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-media-frame--hero {
  min-height: min(34rem, 56vw);
  aspect-ratio: 5 / 4;
  box-shadow: var(--shadow-lg);
}

.c-media-frame--landscape {
  min-height: 12rem;
  aspect-ratio: 16 / 9;
}

.c-media-frame--compact {
  min-height: 18rem;
  aspect-ratio: 16 / 10;
}

.c-hero__media-stack {
  display: grid;
  gap: var(--space-5);
}

.c-media-frame--ink { border-color: rgb(255 255 255 / .2); }

.c-media-frame--portrait {
  min-height: 24rem;
  aspect-ratio: 4 / 5;
}

.c-media-frame--portrait img { object-position: center 24%; }

/* About hero image visibility ---------------------------------------------
   The wide artwork already contains Ruaan on desktop. Keep the separate
   portrait hidden until the dedicated mobile layout takes over.
*/
.page-about .c-hero__media--mobile {
  display: none;
}

.c-media-frame--board {
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: var(--color-surface-soft);
}

/* My Most Trusted case-study narrative media ------------------------------
   Keep the three primary story images consistent without affecting gallery
   boards or any other case-study page. */
.page-case-study--mmt .c-case-study-figure {
  margin: 0;
}

.page-case-study--mmt .c-case-study-media {
  min-height: 0;
  aspect-ratio: 5 / 4;
  background: var(--color-surface-soft);
}

.page-case-study--mmt .c-case-study-media img {
  object-fit: cover;
  object-position: center;
}

.c-media-frame--contain img,
.c-media-frame--board img { object-fit: contain; }

.c-media-frame--panorama {
  min-height: 0;
  aspect-ratio: auto;
}

.c-media-frame--panorama img {
  height: auto;
  object-fit: contain;
}

.c-media-frame--tall {
  min-height: 30rem;
  aspect-ratio: 2 / 5;
  background: var(--color-surface-soft);
}

.c-media-frame--tall img { object-fit: contain; }

.c-work-card .c-media-frame {
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

/* Shared portfolio preview treatment. Keep complete interface screenshots
   visible at an exact 16:9 ratio on Home, Work and Website Design. */
.c-work-card__media {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: #eef2f7;
  border-radius: 0;
}

.c-work-card__media-link {
  display: block;
  width: 100%;
  height: 100%;
}

.c-work-card__media-link:focus-visible {
  outline-offset: -4px;
}

.c-work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none !important;
}

.page-home .c-work-card__media img,
.page-work .c-work-card__media img {
  transition: transform 320ms cubic-bezier(.2, .7, .2, 1);
}

.page-home .c-work-card__media-link:focus-visible img,
.page-work .c-work-card__media-link:focus-visible img {
  transform: scale(1.04) !important;
}

@media (hover: hover) and (pointer: fine) {
  .page-home .c-work-card__media-link:hover img,
  .page-work .c-work-card__media-link:hover img {
    transform: scale(1.04) !important;
  }
}

.c-work-card--placeholder .c-work-card__media {
  background: #e3e6e9;
}

.c-work-card--placeholder .c-work-card__media img {
  object-fit: cover;
  filter: grayscale(1);
}

/* Home Featured Work: dark full-section artwork with light content cards. */
.c-home-featured-work {
  color: var(--color-white);
  background-color: var(--dm-midnight);
  background-image: url("../images/featured-work-background.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.c-home-featured-work .c-section-heading p {
  color: rgb(255 255 255 / .82);
}

.c-home-featured-work .c-section-heading .c-eyebrow {
  color: rgb(245 247 250 / .82);
}

.c-home-featured-work .c-work-card {
  color: var(--color-text);
}

.c-home-featured-work .c-work-card p {
  color: var(--color-text-soft);
}

/* Home Services: independent dark artwork with governed card contrast. */
.c-home-services {
  color: var(--color-white);
  background-color: var(--dm-midnight);
  background-image: url("../images/featured-work-background.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.c-home-services .c-section-heading .c-eyebrow {
  color: rgb(245 247 250 / .82);
}

.c-home-services .c-card:not(.c-card--emphasis):not(.c-card--dark) {
  color: var(--color-text);
}

.c-home-services .c-card:not(.c-card--emphasis):not(.c-card--dark) p {
  color: var(--color-text-soft);
}

/* Homepage refinements: clearer approach, proportionate portrait and stronger cards. */
.c-home-expect .c-section-heading {
  max-width: 50rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.c-home-expect .l-grid {
  align-items: stretch;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.c-home-expect .c-card {
  height: 100%;
  border-top: 0;
  box-shadow: 0 14px 38px rgb(7 17 31 / .07);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.c-home-expect .c-card:hover,
.c-home-expect .c-card:focus-within {
  border-color: var(--color-border);
  box-shadow: 0 18px 44px rgb(7 17 31 / .11);
}

.c-home-expect .c-card:focus-visible {
  outline: 3px solid var(--color-action);
  outline-offset: 4px;
}

.c-home-expect .c-card__index {
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-5);
  background: var(--color-accent-soft);
  font-size: .9rem;
}

.c-home-expect .c-card h3 {
  margin-bottom: .8rem;
}

@media (min-width: 48.01rem) {
  .c-home-approach .c-steps__item {
    min-height: 10.25rem;
    padding: 2rem 1.5rem 2rem 7.25rem;
  }

  .c-home-approach .c-steps__item::before {
    top: 1.35rem;
    width: 5.4rem;
    font-size: 3.82rem;
    line-height: 1;
  }
}

@media (min-width: 70.01rem) {
  .c-home-about > .l-container {
    grid-template-columns: minmax(15rem, .5fr) minmax(0, 1.5fr);
    gap: clamp(2rem, 5vw, 5rem);
  }

  .c-home-about__copy {
    grid-column: 2;
    grid-row: 1;
  }

  .c-home-about__portrait {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    width: 100%;
    justify-self: start;
  }
}

@media (max-width: 48rem) {
  .c-home-approach .c-steps__item {
    padding-left: clamp(5rem, 22vw, 6rem);
  }

  .c-home-approach .c-steps__item::before {
    width: clamp(3.2rem, 16vw, 4.2rem);
    font-size: clamp(2.3rem, 10vw, 2.8rem);
    line-height: 1;
  }
}

/* Home HBSOS feature: full-width desktop scene with text in the calm zone. */
.c-home-hbsos {
  position: relative;
  min-height: clamp(34rem, 35vw, 44rem);
  display: flex;
  align-items: center;
  background-color: var(--dm-midnight);
  background-image: url("../images/hbsos-home-desktop.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.c-home-hbsos__inner {
  display: flex;
  min-height: inherit;
  align-items: center;
  justify-content: flex-end;
}

.c-home-hbsos__copy {
  width: min(50%, 44rem);
}

.c-home-hbsos__mobile-media {
  display: none;
  margin: 0;
}

.c-asset-card .c-media-frame {
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

.c-site-footer .c-brand__logo--footer {
  width: min(10.5rem, 100%);
}

/* Light case-study hero artwork needs dark metadata at every viewport. */
.c-case-study-hero--background .c-project-facts li {
  border-top-color: rgb(7 17 31 / .18);
  color: var(--color-text-soft);
}

.c-case-study-hero--background .c-project-facts strong {
  color: var(--color-text);
}

@media (max-width: 70rem) {
  .c-media-frame--hero {
    min-height: 26rem;
    aspect-ratio: 16 / 10;
  }
  .page-articles .c-media-frame--hero,
  .page-posts .c-media-frame--hero,
  .page-contact .c-media-frame--hero,
  .page-website-design .c-media-frame--hero { aspect-ratio: 16 / 9; }
}

@media (max-width: 48rem) {
  :root {
    --font-size-h1: clamp(1.969rem, 9.123vw, 2.799rem);
  }

  /* Mobile hero hierarchy: eyebrow, H1, image, description and actions. */
  .c-hero__inner,
  .c-hero--compact .c-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0;
  }

  .c-hero__copy {
    display: contents;
  }

  .c-hero__copy > .c-eyebrow {
    order: 1;
    justify-self: start;
  }

  .c-hero__copy > h1 {
    order: 2;
  }

  .c-hero__inner > .c-media-frame,
  .c-hero__inner > .c-hero__visual {
    order: 3;
    width: 100%;
    margin: .5rem 0 var(--space-5);
    border-radius: 0;
  }

  .c-hero__copy > :not(.c-eyebrow):not(h1) {
    order: 4;
  }

  .c-hero .c-lead {
    margin-top: 0;
  }

  .c-home-hbsos {
    min-height: 0;
    display: block;
    background-image: none;
  }

  .c-home-hbsos__inner {
    display: block;
    min-height: 0;
  }

  .c-home-hbsos__copy {
    width: 100%;
  }

  .c-home-hbsos__mobile-media {
    display: block;
    width: 100%;
    margin: var(--space-6) 0;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
  }

  .c-home-hbsos__mobile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .page-about .c-hero__media--desktop {
    display: none;
  }

  .page-about .c-hero__media--mobile {
    display: grid;
    min-height: 24rem;
    aspect-ratio: 4 / 5;
  }

  .c-media-frame--hero {
    min-height: 24rem;
    aspect-ratio: 4 / 5;
  }

  .c-site-footer .c-brand__logo--footer { width: 9rem; }

  .c-media-frame--compact {
    min-height: 22rem;
    aspect-ratio: 4 / 5;
  }

  .page-case-study--mmt .c-case-study-media {
    min-height: 0;
    aspect-ratio: 4 / 5;
  }
}

/* Desktop full-bleed hero backgrounds ------------------------------------
   The primary commercial pages use wide artwork on desktop. The
   existing landscape/mobile sources remain in normal document flow below
   70rem, preserving the approved responsive experience.
*/
@media (min-width: 70.01rem) {
  .page-home .c-hero__copy h1 {
    width: min(44rem, 44vw);
    max-width: none;
  }

  .page-home .c-home-hero-title__line {
    display: block;
  }

  .c-hero--background {
    isolation: isolate;
  }

  .c-hero--background .c-hero__inner,
  .c-hero--background.c-hero--compact .c-hero__inner {
    min-height: clamp(40rem, 46vw, 52rem);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .c-hero--background .c-hero__copy {
    grid-column: 1;
    max-width: 46rem;
  }

  .page-home .c-hero--background::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(90deg, rgb(7 17 31 / .72) 0%, rgb(7 17 31 / .54) 36%, rgb(7 17 31 / .10) 55%, transparent 70%);
    content: "";
    pointer-events: none;
  }

  .page-home .c-hero--background .c-hero__inner {
    grid-template-columns: minmax(0, min(44rem, 44vw)) minmax(0, 1fr);
  }

  .page-home .c-hero--background .c-hero__copy {
    z-index: 2;
    max-width: min(44rem, 44vw);
  }

  .page-home .c-hero--background .c-lead {
    max-width: 42rem;
  }

  .page-home .c-hero--background .c-button--secondary {
    color: var(--color-white);
    border-color: rgb(255 255 255 / .42);
    background: transparent;
  }

  .page-home .c-hero--background .c-button--secondary:hover {
    color: var(--color-white);
    border-color: rgb(255 255 255 / .72);
    background: rgb(255 255 255 / .08);
  }

  .c-hero--background > .c-hero__inner > .c-media-frame--hero {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .c-hero--background > .c-hero__inner > .c-media-frame--hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }

  .c-hero--background .fx-image-zoom:hover > img {
    transform: none;
  }

  .c-hero--background.c-hero--ink::before {
    display: none;
  }

  /* Match the Work hero's ink palette on dark desktop backgrounds only. */
  .page-marketing-strategy .c-hero--background,
  .page-advertising .c-hero--background,
  .page-social-media .c-hero--background {
    color: var(--color-white);
    background: var(--dm-midnight);
  }

  .page-marketing-strategy .c-hero--background p,
  .page-advertising .c-hero--background p,
  .page-social-media .c-hero--background p {
    color: rgb(255 255 255 / .78);
  }

  .page-marketing-strategy .c-hero--background .c-eyebrow,
  .page-advertising .c-hero--background .c-eyebrow,
  .page-social-media .c-hero--background .c-eyebrow {
    color: rgb(245 247 250 / .82);
  }

  .page-marketing-strategy .c-hero--background .c-button--primary,
  .page-advertising .c-hero--background .c-button--primary,
  .page-social-media .c-hero--background .c-button--primary {
    color: var(--color-white);
    background: var(--color-action);
    box-shadow: 0 10px 26px rgb(39 104 158 / .24);
  }

  .page-marketing-strategy .c-hero--background .c-button--primary:hover,
  .page-advertising .c-hero--background .c-button--primary:hover,
  .page-social-media .c-hero--background .c-button--primary:hover {
    border-color: var(--color-action-hover);
    color: var(--color-white);
    background: var(--color-action-hover);
  }

  .page-marketing-strategy .c-hero--background .c-button--secondary,
  .page-advertising .c-hero--background .c-button--secondary,
  .page-social-media .c-hero--background .c-button--secondary {
    color: var(--color-white);
    border-color: rgb(255 255 255 / .35);
    background: transparent;
  }

  .page-marketing-strategy .c-hero--background .c-button--secondary:hover,
  .page-advertising .c-hero--background .c-button--secondary:hover,
  .page-social-media .c-hero--background .c-button--secondary:hover {
    color: var(--color-white);
    border-color: rgb(255 255 255 / .72);
    background: rgb(255 255 255 / .08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .c-work-card__media img,
  .page-work .c-work-card__media img {
    transition: none;
  }

  .page-home .c-work-card__media-link:hover img,
  .page-home .c-work-card__media-link:focus-visible img,
  .page-work .c-work-card__media-link:hover img,
  .page-work .c-work-card__media-link:focus-visible img {
    transform: none !important;
  }
}


/* Desktop split-background hero treatment --------------------------------
   Used where the approved source image is portrait/compact rather than a
   full 5:3 canvas. The visual becomes part of the hero surface on the right,
   while the left 50% remains clean and text-safe. Tablet/mobile retain their
   existing in-flow artwork.
*/
@media (min-width: 70.01rem) {
  .c-hero--split-background {
    isolation: isolate;
  }

  .c-hero--split-background .c-hero__inner,
  .c-hero--split-background.c-hero--compact .c-hero__inner {
    min-height: clamp(40rem, 46vw, 52rem);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .c-hero--split-background .c-hero__copy {
    grid-column: 1;
    max-width: 48rem;
    align-self: center;
  }

  .c-hero--split-background > .c-hero__inner > .c-hero__visual {
    position: absolute;
    z-index: 0;
    inset: 0 0 0 50%;
    width: 50%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
  }

  .c-hero--split-background > .c-hero__inner > .c-hero__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }

  .c-hero--split-background > .c-hero__inner > .c-hero__visual--portrait img {
    object-position: 50% 38%;
  }

  .c-hero--split-background > .c-hero__inner > .c-hero__visual::before {
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    width: 11%;
    background: linear-gradient(90deg, var(--color-surface), rgb(245 247 250 / 0));
    content: "";
    pointer-events: none;
  }

  .c-hero--split-background.c-hero--ink > .c-hero__inner > .c-hero__visual::before {
    background: linear-gradient(90deg, var(--dm-midnight), rgb(7 17 31 / 0));
  }

  .c-hero--split-background .fx-image-zoom:hover > img {
    transform: none;
  }

  .c-hero--split-background.c-hero--ink::before {
    display: none;
  }

  .c-hero__media--tablet {
    display: none !important;
  }
}

@media (max-width: 70rem) {
  .c-hero--split-background .c-hero__media--desktop {
    display: none;
  }

  .c-hero__media--tablet {
    display: grid;
  }
}

@media (max-width: 48rem) {
  .c-hero__media--tablet {
    display: none;
  }
}

.c-hero__guidance {
  max-width: 42rem;
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.c-hero__guidance h3 {
  margin-bottom: .55rem;
}

.c-hero--ink .c-hero__guidance {
  border-top-color: rgb(255 255 255 / .18);
}

/* Desktop hero title refinement -------------------------------------------
   Reduce hero H1 scale by 24% from the supplied build on large screens.
   Global H1 tokens are reduced by the same 24% across responsive breakpoints. */
@media (min-width: 70.01rem) {
  .c-hero h1,
  .c-hero--compact h1 {
    font-size: clamp(2.09rem, 3.344vw, 3.61rem);
  }
}


/* Shared charcoal wall for dark content sections and calls to action.
   Preserve the dedicated homepage HBSOS artwork and all hero scenes. */
.l-section--ink:not(.c-home-hbsos),
.c-quote-band,
.c-home-featured-work,
.c-home-services {
  background-color: #19232c;
  background-image: url("../images/backgrounds/charcoal-wall-window-shadow.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* Copy and enquiry revision: respect narrow screens and hidden form context. */
[data-enquiry-context][hidden] { display: none; }
.c-offer-card .c-price { overflow-wrap: anywhere; }
.c-route-card strong { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.c-form small { display: block; }

.c-home-approach__portrait { max-width: 18rem; aspect-ratio: 1; margin: 1.5rem 0; }

@media (min-width: 70.01rem) {
  .page-hbsos .c-hero--background .c-hero__copy { max-width: min(30rem, 36vw); }
  .page-hbsos .c-hero--background::after,
  .page-packages .c-hero--background::after,
  .page-quote .c-hero--background::after {
    position: absolute; z-index: 1; inset: 0; content: ""; pointer-events: none;
    background: linear-gradient(90deg, rgb(7 17 31 / .58) 0%, rgb(7 17 31 / .34) 35%, transparent 58%);
  }
}
