/* Keep authored colors when the phone switches its appearance. */
:root { color-scheme: only dark; }
.phone-word, .phone-scene-hold { display: contents; }



@media (max-width: 800px) {
  :root {
    --phone-screen: 100vh;
    --phone-edge: 6vw;
    --phone-bottom: max(26px, calc(env(safe-area-inset-bottom) + 12px));
    --phone-heading: clamp(32px, min(10.5vw, 8.1svh), 66px);
    --phone-title: clamp(28px, min(8.5vw, 6.8svh), 51px);
  }
  @supports (height: 100dvh) { :root { --phone-screen: 100dvh; } }

  header.new-header :is(.header-contact, .desktop-nav) { display: none !important; }
  header.new-header, header.new-header.scrolled {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .site-menu #mobile-nav {
    inset: calc(100% + 5px) 0 auto auto;
    width: min(190px, 68vw);
    max-height: calc(var(--phone-screen) - 86px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 7px;
    gap: 2px;
    border: 1px solid #ffffff29;
    border-radius: 24px;
    background: #161616a6;
    box-shadow: 0 15px 50px #0008, inset 0 1px #ffffff21;
    transform-origin: top right;
    animation: phone-menu-in .25s cubic-bezier(.2,.8,.2,1) both;
  }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-menu #mobile-nav {
      background: #14141435;
      -webkit-backdrop-filter: blur(24px) saturate(155%);
      backdrop-filter: blur(24px) saturate(155%);
    }
  }
  .site-menu #mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 39px;
    justify-content: flex-end;
    padding: 6px 10px !important;
    border: 1px solid transparent;
    border-radius: 14px !important;
    background: transparent;
    color: #fff;
    font: 550 13px/1.22 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif !important;
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s cubic-bezier(.2,.8,.22,1.45), background-color .2s, box-shadow .2s;
  }
  .site-menu #mobile-nav a[aria-current="page"] { background-color: #ffffff15; }
  .site-menu #mobile-nav a:is(:active, :focus-visible) {
    transform: scale(1.035);
    border-color: #ffffff68;
    background-color: #ffffff2b;
    box-shadow: 0 5px 22px #0006, inset 0 1px #ffffff58;
  }
  .site-menu #mobile-nav .mobile-contact {
    border-color: #ffffff5c;
    margin-top: 5px;
    justify-content: flex-end;
    gap: 7px;
  }

  body.fresh-home .flight-stage,
  body .expertise-canvas,
  body.inner-page[data-page="expertise"] .service-stage,
  body.inner-page[data-page="projects"] .projects-canvas,
  body .solutions-canvas,
  body .about-canvas,
  body .device-sticky,
  body[data-page="expertise"] .brands-scroll-hold .brands,
  body .ecosystem-video {
    height: var(--phone-screen) !important;
    min-height: 0 !important;
  }
  .fresh-home #imported-home .imported-hero {
    min-height: 0;
    padding: 0 var(--phone-edge) calc(var(--phone-bottom) + 30px);
    align-items: flex-end;
    justify-content: flex-start;
  }
  .fresh-home #imported-home .hero-content {
    position: relative;
    inset: auto;
    transform: none;
    margin: 0;
    max-width: 100%;
  }
  .fresh-home #imported-home h1.hero-two-lines {
    font-size: clamp(34px, min(12.4vw, 9.5svh), 72px) !important;
    margin: 0 !important;
  }
  body.fresh-home .ecosystem-section {
    min-height: var(--phone-screen) !important;
    padding: 70px var(--phone-edge) 50px !important;
    justify-content: center;
  }
  .ecosystem-section > .kicker { font-size: 13px !important; }
  .ecosystem-section #ecosystem-title {
    font-size: var(--phone-heading) !important;
    white-space: normal !important;
  }
  .ecosystem-section .ecosystem-intro { margin-top: 12px !important; line-height: 1.5; }
  .ecosystem-section .ecosystem-benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px !important;
    margin-top: 19px !important;
  }
  .ecosystem-section .ecosystem-benefits > article { min-height: 0; padding: 10px; }
  .ecosystem-benefits h3 { font-size: 17px; margin-bottom: 5px !important; }
  .ecosystem-benefits p { font-size: 11px; line-height: 1.35; }

  body .solutions-canvas > .story-intro,
  body .about-canvas > .story-intro,
  body.inner-page[data-page="projects"] .projects .section-heading {
    height: auto;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    text-align: left;
    padding: var(--phone-edge) var(--phone-edge) calc(var(--phone-bottom) + 30px) !important;
    gap: 8px !important;
  }
  body .solutions-canvas > .story-intro > :is(h1, p:not(.intro-scroll-hint)),
  body .about-canvas > .story-intro > :is(h1, p),
  body .projects .section-heading > :is(h2, p:not(.intro-scroll-hint)) {
    margin: 0 !important;
    max-width: 100%;
  }
  body .story-intro h1,
  body .projects .section-heading h2,
  body .device-story .device-sticky h2,
  body[data-page="contact"] .contact h2 {
    font-size: var(--phone-heading) !important;
    line-height: .99 !important;
    overflow-wrap: normal;
    word-break: normal;
  }
  .story-intro .phone-word, .projects .section-heading .phone-word { display: inline-block; }
  body .story-intro > .intro-scroll-hint,
  body .projects .section-heading > .intro-scroll-hint {
    left: var(--phone-edge) !important;
    transform: none !important;
  }
  body .solutions-canvas > .story-intro { z-index: 1; }
  body .solutions-canvas .solution-split { min-height: var(--phone-screen); }
  body .solutions-canvas .solution-split-image {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
  body .solutions-canvas .solution-split .solution-split-copy,
  body .service-slide .service-copy,
  body .service-slide:nth-child(even) .service-copy,
  body .projects .project > div:last-child {
    inset: auto var(--phone-edge) var(--phone-bottom) !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    gap: 8px;
    text-align: left;
    background: transparent !important;
    z-index: 4;
    text-shadow: 0 1px 8px #000, 0 2px 22px #000;
  }
  body .solutions-canvas .solution-split-copy h2,
  body .service-copy h3,
  body .projects .project h3,
  body .about-canvas .about-final h2 {
    font-size: var(--phone-title) !important;
    line-height: 1.05;
    margin: 0 0 6px;
  }
  body .service-copy h4 { font-size: 17px; margin: 0 0 7px; }
  body .service-copy p { margin: 0 0 6px; }
  body .solutions-canvas .solution-split-image::after,
  body .projects .project .media-slot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #000e, #0008 23%, transparent 61%);
    pointer-events: none;
  }

  body[data-page="expertise"] .service-stage > .media-slot::before {
    content: "";
    display: block !important;
    position: absolute;
    inset: 0;
    background: var(--clip-poster) center / cover no-repeat;
    filter: blur(18px) brightness(.45);
    transform: scale(1.1);
  }
  body[data-page="expertise"] .service-stage > .media-slot video,
  body[data-page="expertise"] .service-slide:last-child .service-stage > .media-slot video {
    top: 4%;
    height: 65%;
    object-position: center !important;
    object-fit: contain !important;
    transform: none !important;
  }
  body[data-page="expertise"] .service-slide .media-slot::after {
    background: linear-gradient(0deg, #070708, #070708d9 17%, transparent 49%, transparent 87%, #0707085c);
  }
  body[data-page="expertise"] .brands-scroll-hold { height: auto !important; }
  body[data-page="expertise"] .brands-scroll-hold .brands { position: relative !important; }

  body .device-story .device-sticky {
    align-items: flex-start;
    justify-content: flex-end;
    padding: var(--phone-edge) var(--phone-edge) var(--phone-bottom);
    text-align: left;
  }
  body .device-story .device-stack::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(0deg, #000d, #0007 27%, transparent 64%);
    pointer-events: none;
  }
  body .device-story .device-sticky :is(h2, .eyebrow, .device-caption, .device-contact) {
    position: relative;
    inset: auto;
    align-self: flex-start;
    margin: 0 0 7px;
    max-width: 100%;
  }
  body .device-story .device-sticky h2 {
    font-size: clamp(36px, min(12vw, 9svh), 72px) !important;
    margin-bottom: 12px;
  }
  body .device-story .device-sticky {
    padding-bottom: calc(var(--phone-bottom) + 18px);
  }
  body .device-story .device-caption { display: none !important; }
  body .device-story .device-contact { margin: 7px 0 0; }

  body[data-page="about"] .about-canvas > .about-note {
    background: var(--masterwork-wallpaper) center / cover no-repeat !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding: var(--phone-edge) var(--phone-edge) max(var(--phone-bottom), 7svh) !important;
  }
  body[data-page="about"] .about-canvas > .about-note > p {
    font-size: clamp(15px, 4.5vw, 23px);
    line-height: 1.4;
    max-width: 100% !important;
  }
  body .about-canvas > .about-panel { max-height: var(--phone-screen); }
  body .about-canvas > .execution-steps {
    overflow: hidden;
    padding: clamp(12px, 4svh, 30px) var(--phone-edge) !important;
    justify-content: center;
  }
  body .about-canvas > .execution-steps > h2 {
    font-size: clamp(20px, min(6vw, 4.2svh), 32px);
    margin: 5px 0 clamp(8px, 2svh, 17px);
  }
  body .about-canvas .steps-grid { gap: clamp(7px, 1.6svh, 15px) !important; }
  body .about-canvas .steps-grid article { min-width: 0; padding-top: 5px; }
  body .about-canvas .steps-grid article h3 { margin: 3px 0; line-height: 1.1; }
  body .about-canvas .steps-grid article p { margin: 0; line-height: 1.3; }
  body .about-canvas .steps-grid article img {
    height: clamp(32px, 10svh, 88px);
    margin-bottom: 4px;
    border-radius: 8px;
    box-shadow: 0 0 15px #f3bf7740, 0 6px 16px #0009;
  }
  body .about-canvas .about-final {
    justify-content: flex-end !important;
    gap: 8px;
    padding: var(--phone-edge) var(--phone-edge) var(--phone-bottom) !important;
  }

  body[data-page="contact"], body[data-page="contact"] main {
    height: auto;
    overflow: visible !important;
  }
  body[data-page="contact"] .contact {
    display: block;
    height: auto;
    padding: 0 !important;
  }
  body[data-page="contact"] .contact-layout {
    display: block;
    width: 100%;
    max-width: none;
  }
  body[data-page="contact"] :is(.contact-intro, #enquiry-form) {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: var(--phone-screen);
    width: 100%;
    margin: 0;
    padding: 22px var(--phone-edge) var(--phone-bottom);
  }
  body[data-page="contact"] .contact-details {
    display: grid !important;
    gap: 7px !important;
    margin: 8px 0 0;
    padding: 0;
  }
  body[data-page="contact"] .contact-details a { font-size: 13px !important; }
  body[data-page="contact"] #enquiry-form { justify-content: center; }
  body[data-page="contact"] .form-brand img { max-height: min(12svh, 82px); }
  body[data-page="contact"] #enquiry-form .contact-form-fields {
    width: 100%;
    row-gap: clamp(9px, 2.2svh, 20px) !important;
  }
  body[data-page="contact"] #enquiry-form .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="contact"] #enquiry-form :is(input, select, textarea) {
    width: 100%;
    font-size: 16px;
    min-height: clamp(42px, 6.2svh, 60px) !important;
  }
  body[data-page="contact"] #enquiry-form textarea {
    height: clamp(74px, 15svh, 150px) !important;
  }
  body[data-page="contact"] .page-scroll-cue,
  body:not(.fresh-home) .page-scroll-cue,
  body.fresh-home.phone-past-opening .page-scroll-cue { display: none !important; }

  body.fresh-home .ecosystem-section.phone-in-flow {
    opacity: 1 !important;
    padding-block: 32px !important;
  }

  @media (prefers-reduced-motion: no-preference) {
    .fresh-home .phone-scene-hold {
      position: relative;
      display: flex;
      flex-direction: column;

    }
    .fresh-home .phone-scene-hold::after {
      content: "";
      flex: 0 0 clamp(80px, 21svh, 185px);
    }
    .fresh-home .phone-scene-hold > :is(.ecosystem-section, .ecosystem-video) {
      position: sticky;
      top: 0 !important;
    }
    body.inner-page[data-page="expertise"] .expertise { height: calc(var(--phone-screen) * 8.5) !important; }
    body.inner-page[data-page="projects"] .projects { height: calc(var(--phone-screen) * 7.5) !important; }
    body .device-story:last-child { height: calc(var(--phone-screen) * 4.5) !important; }
  }
  @media (max-height: 520px) {
    :root { --phone-bottom: 12px; }
    body .service-copy :is(h3, h4, p) { margin-bottom: 3px; }
    body[data-page="contact"] #enquiry-form { padding-block: 14px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .site-menu #mobile-nav { animation: none; }
    body.fresh-home .flight-stage,
    body .expertise-canvas,
    body.inner-page[data-page="projects"] .projects-canvas,
    body .solutions-canvas, body .about-canvas, body .device-sticky {
      height: auto !important;
    }
    body .about-canvas > .about-panel,
    body .projects .section-heading,
    body .story-intro,
    body .device-sticky { min-height: var(--phone-screen) !important; }
  }
}

@keyframes phone-menu-in {
  from { opacity: 0; transform: translateY(-7px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.site-menu {
  position: fixed;
  top: max(22px, env(safe-area-inset-top));
  right: max(4vw, env(safe-area-inset-right));
  z-index: 1101;
}
.site-menu .mobile-menu {
  display: flex;
  width: 44px;
  height: 44px;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  filter: drop-shadow(0 1px 5px #000);
}
.site-menu .mobile-menu span {
  width: 20px;
  height: 1px;
  background: currentColor;
  border-radius: 1px;
}

@media (min-width: 801px) {
  header.new-header .desktop-nav { display: none !important; }
  header.new-header,
  header.new-header.scrolled {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding-right: calc(4vw + 58px) !important;
  }
  .site-menu #mobile-nav {
    position: absolute;
    inset: calc(100% + 4px) 0 auto auto;
    width: 194px;
    padding: 7px;
    gap: 2px;
    border: 1px solid #ffffff29;
    border-radius: 18px;
    background: #161616a6;
    box-shadow: 0 15px 50px #0008;
    text-align: right;
    animation: phone-menu-in .25s ease-out both;
    transform-origin: top right;
  }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-menu #mobile-nav {
      background: #14141435;
      -webkit-backdrop-filter: blur(22px);
      backdrop-filter: blur(22px);
    }
  }
  .site-menu #mobile-nav a {
    padding: 9px 12px;
    border-radius: 10px;
    font: 500 14px/1.2 system-ui, sans-serif;
    transition: background-color .2s, transform .2s;
  }
  .site-menu #mobile-nav a:is(:hover, :focus-visible, [aria-current="page"]) { background: #ffffff1c; }
  .site-menu #mobile-nav a:active { transform: scale(1.035); }
  .site-menu #mobile-nav .mobile-contact { border: 1px solid #ffffff5c; margin-top: 4px; }
}

@media (max-width: 800px) {
  .site-menu { top: max(16px, env(safe-area-inset-top)); right: var(--phone-edge); }
  header.header-away + .site-menu { visibility: hidden; }
  .site-menu #mobile-nav { -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  .ecosystem-section #ecosystem-title :is(span, em) { display: block; white-space: nowrap; }
  .ecosystem-section #ecosystem-title { font-size: clamp(25px, 10vw, 63px) !important; }
  body.fresh-home .ecosystem-section {
    justify-content: flex-end;
    padding-bottom: calc(var(--phone-bottom) + 35px) !important;
  }

  .solutions-canvas > .story-intro h1,
  body .projects .section-heading h2 {
    font-size: clamp(38px, min(13vw, 10svh), 82px) !important;
    line-height: .99;
  }
  .solutions-canvas .story-intro .phone-word-space { width: .13em; }
  body .about-canvas > .execution-steps { justify-content: flex-end; }
  body .about-canvas > .execution-steps > h2 {
    font-size: clamp(25px, min(8vw, 5svh), 48px);
  }

  /* Stable canvas while Samsung Internet animates its browser controls. */
  @supports (height: 100lvh) {
    @media (prefers-reduced-motion: no-preference) {
      body.fresh-home .flight-stage { height: 100lvh !important; }
      .fresh-home #imported-home .imported-hero { bottom: calc(100lvh - 100svh); }
    }
  }
}

body[data-page="contact"] .contact-intro {
  --contact-intro-gap: clamp(12px, 1.8svh, 21px);
  --contact-row-gap: clamp(8px, 1.1svh, 13px);
}
body[data-page="contact"] .contact-layout .contact-intro > h2 {
  margin-bottom: var(--contact-intro-gap) !important;
}
body[data-page="contact"] .contact-layout .contact-intro > p {
  margin: 0 !important;
}
body[data-page="contact"] .contact-details {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(25px, 1fr);
  row-gap: var(--contact-row-gap) !important;
  margin: var(--contact-intro-gap) 0 0 !important;
}
body[data-page="contact"] .contact-details > a:is(.contact-method, .contact-social) {
  display: flex;
  align-items: center;
  margin: 0 !important;
}
body[data-page="contact"] .form-brand img {
  margin-bottom: clamp(10px, 1.5svh, 17px) !important;
}

@media (max-width: 800px) {
  body[data-page="contact"] .contact-intro,
  body[data-page="contact"] #enquiry-form {
    background: var(--masterwork-wallpaper) center / cover no-repeat;
  }
  body[data-page="contact"] #enquiry-form .form-brand {
    padding-bottom: clamp(15px, 2.6svh, 26px);
  }
  body[data-page="contact"] .contact-intro :is(h2, p, .contact-details),
  body[data-page="contact"] #enquiry-form :is(.form-brand p, label) {
    text-shadow: 0 1px 5px #000;
  }
}
body[data-page="contact"] .contact-layout .contact-intro > .contact-branches {
  margin: var(--contact-intro-gap) 0 0 !important;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.4;
}


@media (min-width: 801px) {
  /* Give animated descenders room inside their composited letter boxes. */
  .solutions-canvas > .story-intro > h1 {
    line-height: 1.2 !important;
  }
  .solutions-canvas .story-intro .intro-letter {
    padding-block: .08em .14em;
    overflow: visible;
  }
}

/* Current page in the hamburger menu. */
.site-menu #mobile-nav a[aria-current="page"] { color: #b8b8b8; }
