/* Pinecrest iPhone / Mobile-Only Polish & Left Slide-Out Navigation Drawer
   100% scoped inside @media (max-width: 760px) — zero impact on PC / desktop. */

/* Smooth native cross-document page crossfade (mobile-only animation; desktop stays instant) */
@view-transition {
  navigation: auto;
}

::view-transition,
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-old(*),
::view-transition-new(*) {
  pointer-events: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.001s;
}

@media (max-width: 760px) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.16s;
    animation-timing-function: cubic-bezier(.22, .8, .2, 1);
  }
}

@keyframes pc-mob-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* Keep mobile-only deck chrome strictly hidden on desktop */
.mobile-deck-count,
.mobile-deck-controls {
  display: none;
}

@media (max-width: 760px) {
  :root {
    --header: 88px;
    --mob-hdr-cut: 12px;
  }

  /* Avoid Chromium's top-layer dialog::backdrop dropout bug when root overflow is hidden during transition */
  html.pc-nav-switching,
  html.pc-nav-switching body {
    overflow: visible !important;
  }

  /* Keep below-the-fold scroll-reveal containers immediately visible on phones */
  .pc-reveals-ready .pc-reveal:not(.is-in),
  .timeline-year .year-story > p {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Zero-flicker GPU-composited bottom-up fade-in applied BEFORE first paint on every mobile page.
     Uses fill-mode: backwards so Frame 0 starts invisible (never flashes before sliding) and
     releases transform/stacking cleanly once the entrance finishes. */
  .crest-hero .crest-stage-track,
  .crest-copy h1,
  .crest-copy > p,
  .crest-copy .crest-actions,
  .pc-hero-copy .pc-kicker,
  .pc-hero-copy h1,
  .pc-hero-copy > p,
  .pc-hero-copy .pc-actions,
  body[data-page="/our-services/"] .services-flank--left,
  body[data-page="/our-services/"] .services-flank--right,
  body[data-page="/our-careers/"] .careers-board-intro,
  .page-hero .eyebrow,
  .page-hero h1,
  .page-hero .page-hero-copy > p,
  .page-hero .page-hero-copy > .text-link,
  .chapter-story .story-visual,
  .chapter-people .people-collage,
  .contact-intro .pc-kicker,
  .contact-intro h1,
  .contact-wizard-card,
  .contact-direct-list,
  .service-detail .service-breadcrumb,
  .service-detail h1,
  .service-detail .service-detail-video-subtitle,
  .service-detail .service-detail-video-layout,
  .service-detail .service-detail-media,
  .service-detail .service-detail-copy {
    animation: pc-mob-rise 0.44s cubic-bezier(.16, 1, .3, 1) var(--mob-enter-delay, 0s) backwards;
  }

  .crest-hero .crest-stage-track,
  .pc-hero-copy .pc-kicker,
  .page-hero .eyebrow,
  .contact-intro .pc-kicker,
  .service-detail .service-breadcrumb { --mob-enter-delay: 0.03s; }

  .crest-copy h1,
  .pc-hero-copy h1,
  .page-hero h1,
  .contact-intro h1,
  .service-detail h1 { --mob-enter-delay: 0.07s; }

  .crest-copy > p,
  .pc-hero-copy > p,
  .page-hero .page-hero-copy > p,
  .contact-wizard-card,
  .service-detail .service-detail-video-subtitle { --mob-enter-delay: 0.12s; }

  .crest-copy .crest-actions,
  .pc-hero-copy .pc-actions,
  .page-hero .page-hero-copy > .text-link,
  .chapter-story .story-visual,
  .service-detail .service-detail-video-layout,
  .service-detail .service-detail-media,
  .service-detail .service-detail-copy { --mob-enter-delay: 0.17s; }

  body[data-page="/our-services/"] .services-flank--left,
  .chapter-people .people-collage,
  .contact-direct-list,
  body[data-page="/our-careers/"] .careers-board-intro { --mob-enter-delay: 0.21s; }

  body[data-page="/our-services/"] .services-flank--right { --mob-enter-delay: 0.26s; }

  @media (prefers-reduced-motion: reduce) {
    .crest-hero .crest-stage-track,
    .crest-copy h1,
    .crest-copy > p,
    .crest-copy .crest-actions,
    .pc-hero-copy .pc-kicker,
    .pc-hero-copy h1,
    .pc-hero-copy > p,
    .pc-hero-copy .pc-actions,
    body[data-page="/our-services/"] .services-flank--left,
    body[data-page="/our-services/"] .services-flank--right,
    body[data-page="/our-careers/"] .careers-board-intro,
    .page-hero .eyebrow,
    .page-hero h1,
    .page-hero .page-hero-copy > p,
    .page-hero .page-hero-copy > .text-link,
    .chapter-story .story-visual,
    .chapter-people .people-collage,
    .contact-intro .pc-kicker,
    .contact-intro h1,
    .contact-wizard-card,
    .contact-direct-list,
    .service-detail .service-breadcrumb,
    .service-detail h1,
    .service-detail .service-detail-video-subtitle,
    .service-detail .service-detail-video-layout,
    .service-detail .service-detail-media,
    .service-detail .service-detail-copy {
      animation: none !important;
    }
  }

  body:has(.crest-hero),
  body.pc-modern {
    --hdr-pad: 12px;
    --hdr-cut: 0px;
  }

  /* Single-row mobile header: taller (88px) at top of page, shrinks smoothly to 76px
     on scroll with zero layout jump, uniform across every page. */
  html body .header,
  html body.pc-modern .header,
  html body:has(.crest-hero) .header,
  html body .site-header {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 0 8px;
    height: calc(var(--header) - var(--mob-hdr-s, 0) * var(--mob-hdr-cut, 12px));
    margin-bottom: calc(var(--mob-hdr-s, 0) * var(--mob-hdr-cut, 12px));
    padding: 0 12px;
  }

  /* Hide the 6 stacked inline navigation links on phone */
  html body .header > nav,
  html body .site-header > .desktop-nav {
    display: none !important;
  }

  /* Crisp white 3-line hamburger icon — exact integer dimensions so all 3 bars
     render with identical thickness and crispness on every Retina display */
  html body .header > .menu-open,
  html body .site-header > .menu-open {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 46px;
    height: 46px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s ease;
  }

  html body .header > .menu-open:active,
  html body .site-header > .menu-open:active {
    background: rgba(255, 255, 255, .12);
  }

  html body .header > .menu-open:focus-visible,
  html body .site-header > .menu-open:focus-visible {
    outline: 2px solid #00bfed;
    outline-offset: 2px;
  }

  html body .header > .menu-open span,
  html body .site-header > .menu-open span {
    display: block;
    flex: none;
    width: 26px;
    height: 2px;
    margin: 0;
    border-radius: 999px;
    background: #ffffff;
    pointer-events: none;
  }

  /* Pinecrest Group logo mathematically centered across every page, gently scaling
     down a touch as the header compacts from 88px to 76px on scroll */
  html body .header > .header-brand,
  html body.pc-modern .header > .header-brand,
  html body:has(.crest-hero) .header > .header-brand,
  html body .site-header > .header-brand {
    grid-column: auto;
    grid-row: auto;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(calc(1.04 - var(--mob-hdr-s, 0) * 0.04)) !important;
    transform-origin: center center !important;
    width: clamp(114px, 31.5vw, 130px);
    max-width: calc(100% - 172px);
    margin: 0;
    z-index: 2;
  }

  /* Uniform top-right "Let's talk" pill matching Home's exact spacing & width on every page */
  html body .header > .header-contact,
  html body.pc-modern .header > .header-contact,
  html body:has(.crest-hero) .header > .header-contact,
  html body .site-header > .header-contact {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: 38px;
    padding: 7px 11px;
    gap: 10px;
    font-size: 13.5px;
    font-family: Archivo, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0;
    transform: none !important;
  }

  html body .header .header-contact-icon svg,
  html body.pc-modern .header .header-contact-icon svg,
  html body:has(.crest-hero) .header .header-contact-icon svg,
  html body .site-header .header-contact-icon svg {
    width: 15px;
    height: 15px;
  }

  /* Keep the Home 3D crest softly visible behind the dimmed drawer backdrop */
  body:has(dialog[open]) #logo-canvas {
    opacity: 1;
  }

  /* Hide orbiting service icons on phones so the 3D crest stands clean and uncluttered */
  .crest-hero .crest-orbit {
    display: none !important;
  }

  /* ====== MOBILE HOME HERO & MANIFESTO ====== */
  body:has(.crest-hero) .crest-hero {
    min-height: calc(100vh - var(--header));
    min-height: calc(100dvh - var(--header));
    padding: clamp(30px, 5.4dvh, 52px) 0 max(36px, calc(env(safe-area-inset-bottom) + 26px));
    justify-content: flex-start;
  }

  body:has(.crest-hero) .crest-hero .logo-stage-track.crest-stage-track {
    flex: 0 0 auto;
    height: clamp(210px, 31dvh, 268px);
    min-height: 0;
  }

  body:has(.crest-hero) .crest-hero .crest-stage-track .logo-stage.crest-stage {
    inset: -10% 0;
    top: -10%;
  }

  /* 65% of previous mobile size (~230px tall on 390x844 instead of ~354px) */
  body:has(.crest-hero) .crest-hero .logo-target,
  body:has(.crest-hero) .crest-hero .logo-fallback {
    height: clamp(178px, 27.2dvh, 234px);
    max-width: 56vw;
  }

  body:has(.crest-hero) .crest-copy {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100% - 28px, 460px);
    padding-top: clamp(8px, 1.8dvh, 18px);
    --copy-drop: 0px;
  }

  body:has(.crest-hero) .crest-hero h1 {
    font-size: clamp(33px, 9.7vw, 44px);
    line-height: 1.02;
    letter-spacing: -.035em;
  }

  body:has(.crest-hero) .crest-copy > p {
    margin-top: clamp(16px, 2.5dvh, 26px);
    max-width: 34ch;
    font-size: clamp(15px, 4.1vw, 17px);
    line-height: 1.44;
  }

  body:has(.crest-hero) .crest-actions {
    margin-top: clamp(24px, 3.6dvh, 34px);
    padding-top: 0;
    gap: 12px 20px;
  }

  /* Remove the static Pinecrest logo from Passionate/Insatiable/Innovative on mobile & collapse its gap */
  body:has(.crest-hero) .manifesto-stage {
    display: none !important;
  }

  body:has(.crest-hero) .manifesto {
    padding: 48px 24px 56px;
  }

  body:has(.crest-hero) .manifesto-eyebrow {
    grid-row: 1;
    margin-bottom: 16px;
  }

  body:has(.crest-hero) .manifesto > h2 {
    grid-row: 2;
  }

  body:has(.crest-hero) .manifesto > p {
    grid-row: 3;
  }

  body:has(.crest-hero) .manifesto-cue {
    grid-row: 4;
  }

  /* ====== MOBILE "HOW WE WORK" SWIPEABLE CARD DECK ====== */
  body:has(.crest-hero) .field-runway.is-mobile-deck {
    height: auto;
    padding: 32px 0 42px;
    overflow: hidden;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-sticky {
    position: static;
    height: auto;
    overflow: visible;
    cursor: default;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 16px;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-heading-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-active-name {
    display: none;
  }

  body:has(.crest-hero) .mobile-deck-count {
    display: inline-flex;
    align-items: center;
    flex: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    color: rgba(188, 214, 250, .78);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-cards-stage {
    position: relative;
    display: block;
    width: 100%;
    height: calc(var(--deck-card-h, 520px) + 22px);
    padding: 0;
    margin: 0;
    clip: auto;
    clip-path: none;
    white-space: normal;
    pointer-events: auto;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    overflow: visible;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card {
    position: absolute;
    top: 0;
    left: 18px;
    width: calc(100% - 52px);
    height: var(--deck-card-h, 520px);
    margin: 0;
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 20px 18px 0;
    box-shadow: 0 18px 42px rgba(2, 8, 28, .44), 0 2px 10px rgba(2, 8, 28, .22);
    transform-origin: 50% 82%;
    will-change: transform, opacity;
    transition:
      transform .36s cubic-bezier(.16, 1, .3, 1),
      opacity .3s ease,
      filter .32s ease;
    cursor: grab;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card:active {
    cursor: grabbing;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card.is-deck-no-anim {
    transition: none !important;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card.is-deck-throwing {
    transition:
      transform .3s cubic-bezier(.22, .8, .2, 1),
      opacity .26s ease !important;
  }

  body:has(.crest-hero) .field-runway.is-deck-measuring .field-card {
    position: static;
    transform: none !important;
    transition: none !important;
  }

  /* Rich 3-surface card deck palette (white / cyan / cobalt) matching desktop */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="white"] {
    background: #ffffff;
    color: #081434;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 42px rgba(2, 8, 28, .44);
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="cyan"] {
    background: linear-gradient(155deg, #74d1ef 0%, #3da7d4 100%);
    color: #071433;
    box-shadow: inset 0 1px 0 rgba(200, 245, 255, .5), 0 18px 42px rgba(2, 8, 28, .44);
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="cobalt"] {
    background: linear-gradient(155deg, #2455da 0%, #102a82 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(130, 185, 255, .36), 0 18px 42px rgba(2, 8, 28, .44);
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card .department-info {
    flex: 0 0 auto;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card .section-kicker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .68;
    margin-bottom: 8px;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card h2 {
    margin: 0 0 8px;
    font-size: clamp(20px, 5.6vw, 23.5px);
    line-height: 1.09;
    letter-spacing: -.03em;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card p {
    margin: 0;
    font-size: 13.2px;
    line-height: 1.44;
    opacity: .86;
  }

  /* Full-bleed edge-to-edge portrait stage: larger, shoulder-to-shoulder duo framing
     anchored flush to left/right corners so zero outer photo-crop edges show. */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-portraits {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-height: 192px;
    max-height: 218px;
    margin: 2px -18px 0;
    overflow: hidden;
    pointer-events: none;
  }

  /* Subtle studio halo behind portraits on colored cards (matches desktop 3D plaques) */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="cyan"] .field-portraits::before,
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="cobalt"] .field-portraits::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 260px;
    height: 190px;
    transform: translateX(-50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="cyan"] .field-portraits::before {
    background: radial-gradient(circle, rgba(255, 255, 255, .26) 0%, transparent 70%);
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-deck-surface="cobalt"] .field-portraits::before {
    background: radial-gradient(circle, rgba(92, 195, 255, .2) 0%, transparent 70%);
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-portraits .team-cutout.is-baked-cutout {
    position: absolute;
    bottom: -2px;
    -webkit-mask-image: none;
    mask-image: none;
    mix-blend-mode: normal !important;
    margin: 0 !important;
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
    -webkit-user-drag: none;
  }

  /* Default full-bleed duo placement: anchored flush left & right, close together */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-portraits .team-cutout.is-baked-cutout:first-child {
    left: -6px;
    right: auto;
    z-index: 1;
  }

  body:has(.crest-hero) .field-runway.is-mobile-deck .field-portraits .team-cutout.is-baked-cutout:last-child {
    right: -6px;
    left: auto;
    z-index: 2;
  }

  /* Per-card custom duo framing, overlap layering, and seamless inner-edge feathering
     so every hard photo crop sits hidden past the card edge or behind a natural shoulder */

  /* Business Development: grouped together and anchored flush to the right edge
     so Judah's right cutoff sits seamlessly against the tile border at every phone width */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="business-development"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="business-development"] .team-cutout:first-child {
    left: auto;
    right: -2px;
    transform: translateX(-60%);
    height: 98%;
    z-index: 2;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="business-development"] .team-cutout:last-child {
    left: auto;
    right: -2px;
    transform: none;
    height: 112%;
    z-index: 1;
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* Onboarding: center-anchored close duo matching desktop at every phone width */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="onboarding"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="onboarding"] .team-cutout:first-child {
    left: 50%;
    right: auto;
    transform: translateX(-80%);
    height: 96%;
    z-index: 2;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="onboarding"] .team-cutout:last-child {
    left: 50%;
    right: auto;
    transform: translateX(-16%);
    height: 105%;
    z-index: 1;
  }

  /* Enrollment: center-anchored pair matching desktop, left cleanly in front covering right's inner edge with zero fade */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="enrollment"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="enrollment"] .team-cutout:first-child {
    left: 50%;
    right: auto;
    transform: translateX(-82%);
    height: 100%;
    z-index: 2;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="enrollment"] .team-cutout:last-child {
    left: 50%;
    right: auto;
    transform: translateX(-18%);
    height: 105%;
    z-index: 1;
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* Client Advisory: center-anchored pair matching desktop framing at every phone width */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="client-advisory"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="client-advisory"] .team-cutout:first-child {
    left: 50%;
    right: auto;
    transform: translateX(-86%);
    height: 100%;
    z-index: 1;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="client-advisory"] .team-cutout:last-child {
    left: 50%;
    right: auto;
    transform: translateX(-14%);
    height: 102%;
    z-index: 2;
  }

  /* Renewals: center-anchored close duo matching desktop at every phone width */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="renewals"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="renewals"] .team-cutout:first-child {
    left: 50%;
    right: auto;
    transform: translateX(-86%);
    height: 100%;
    z-index: 1;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="renewals"] .team-cutout:last-child {
    left: 50%;
    right: auto;
    transform: translateX(-14%);
    height: 106%;
    z-index: 2;
  }

  /* Product & Strategy: Cory anchored flush right in front, Josh (with AI-completed
     rounded suit shoulders) tucked right up against him — zero hard cutoffs on either side */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="product-strategy"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="product-strategy"] .team-cutout:first-child {
    left: auto;
    right: -14px;
    transform: translateX(-56%);
    height: 106%;
    z-index: 1;
    -webkit-mask-image: none;
    mask-image: none;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="product-strategy"] .team-cutout:last-child {
    left: auto;
    right: -14px;
    transform: none;
    height: 112%;
    z-index: 2;
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* Engineering: center-anchored back-to-back (Parker left, Aidan right)
     with Aidan's shoulder cleanly overlapping Parker's shoulder on EVERY phone width */
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="engineering"] .field-portraits {
    overflow: visible;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="engineering"] .team-cutout:first-child {
    left: 50%;
    right: auto;
    transform: translateX(-8%);
    height: 107%;
    z-index: 2;
  }
  body:has(.crest-hero) .field-runway.is-mobile-deck .field-card[data-dept="engineering"] .team-cutout:last-child {
    left: 50%;
    right: auto;
    transform: translateX(-92%);
    height: 109%;
    z-index: 1;
  }

  /* Clean mobile deck controls bar (arrows + expanding cyan pill dots + swipe cue) */
  body:has(.crest-hero) .mobile-deck-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 0;
  }

  body:has(.crest-hero) .mobile-deck-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  body:has(.crest-hero) .mobile-deck-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .07);
    color: #ffffff;
    font-size: 17px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s ease, border-color .2s ease, transform .15s ease;
  }

  body:has(.crest-hero) .mobile-deck-btn:active {
    background: #00bfed;
    border-color: #00bfed;
    color: #071433;
    transform: scale(.94);
  }

  body:has(.crest-hero) .mobile-deck-dots {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  body:has(.crest-hero) .mobile-deck-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .24);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: width .28s cubic-bezier(.16, 1, .3, 1), background .22s ease;
  }

  body:has(.crest-hero) .mobile-deck-dot.is-active {
    width: 24px;
    background: #00bfed;
  }

  body:has(.crest-hero) .mobile-deck-hint {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: rgba(190, 214, 248, .62);
    transition: opacity .4s ease;
  }

  body:has(.crest-hero) .mobile-deck-hint.is-faded {
    opacity: .32;
  }

  body:has(.crest-hero) .mobile-deck-hint-arrow {
    color: #00bfed;
    font-weight: 700;
  }

  /* ====== MOBILE CAREERS: HIDE LARGE 3D CREST HERO STAGE ====== */
  body[data-page="/our-careers/"] .careers-3d-stage {
    display: none !important;
  }

  body[data-page="/our-careers/"] .pc-hero {
    min-height: auto;
    padding: 40px 0 48px;
  }

  /* ====== MOBILE CONTACT: TIGHTEN TOP PADDING FOR FORM-FIRST LAYOUT ====== */
  body[data-page="/contact/"] .contact-hero-shell {
    padding: 38px 0 64px;
  }

  /* ====== LEFT SLIDE-OUT DRAWER MENU ====== */
  dialog.menu {
    position: fixed;
    inset: 0 auto 0 0;
    margin: 0;
    width: min(84vw, 340px);
    max-width: min(84vw, 340px);
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: max(18px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)) 24px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(180deg, #0d1d5c 0%, #091440 58%, #071033 100%);
    color: #ffffff;
    box-shadow: 24px 0 64px rgba(2, 6, 24, .58);
    overflow-y: auto;
    overscroll-behavior: contain;
    font-family: "Archivo Pinecrest", Archivo, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    transform: translate3d(-104%, 0, 0);
    transition: transform .26s cubic-bezier(.22, .8, .2, 1);
  }

  dialog.menu:not([open]) {
    display: none;
  }

  dialog.menu.is-open {
    transform: translate3d(0, 0, 0);
  }

  dialog.menu::backdrop {
    background: rgba(4, 10, 32, .68);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .24s ease;
  }

  dialog.menu.is-open::backdrop {
    opacity: 1;
  }

  /* Freeze drawer crisp & open at exact moment a nav link is tapped so @view-transition
     crossfades directly from the drawer into the new page with zero old-page flash */
  dialog.menu.is-nav-locked,
  dialog.menu.is-nav-locked::backdrop,
  dialog.menu.is-nav-locked nav a {
    transition: none !important;
    transition-delay: 0s !important;
  }

  dialog.menu.is-nav-locked {
    transform: translate3d(0, 0, 0);
  }

  dialog.menu.is-nav-locked::backdrop {
    opacity: 1;
    background: rgba(6, 14, 46, .82);
  }

  dialog.menu.is-nav-locked nav a {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  dialog.menu nav a.is-nav-selected,
  dialog.menu.is-nav-locked nav a.is-nav-selected {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    color: #00bfed;
  }

  dialog.menu .menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    flex: none;
  }

  dialog.menu .brand {
    width: 132px;
    max-width: calc(100% - 56px);
    margin: 0;
  }

  dialog.menu .menu-close {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .07);
    color: transparent;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transition: background .2s ease;
  }

  dialog.menu .menu-close::before,
  dialog.menu .menu-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    pointer-events: none;
  }

  dialog.menu .menu-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  dialog.menu .menu-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  dialog.menu .menu-close:active {
    background: rgba(255, 255, 255, .16);
  }

  dialog.menu nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin: 26px 0 auto;
    padding: 0;
    text-align: left;
  }

  dialog.menu nav a {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 8px 0;
    font-size: clamp(28px, 7.8vw, 34px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.035em;
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    text-align: left;
    opacity: 0;
    transform: translate3d(-14px, 0, 0);
    transition:
      opacity .3s cubic-bezier(.22, .8, .2, 1),
      transform .34s cubic-bezier(.22, .8, .2, 1),
      color .2s ease;
  }

  dialog.menu.is-open nav a {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  dialog.menu.is-open nav a:nth-child(1) { transition-delay: .02s; }
  dialog.menu.is-open nav a:nth-child(2) { transition-delay: .04s; }
  dialog.menu.is-open nav a:nth-child(3) { transition-delay: .06s; }
  dialog.menu.is-open nav a:nth-child(4) { transition-delay: .08s; }
  dialog.menu.is-open nav a:nth-child(5) { transition-delay: .10s; }
  dialog.menu.is-open nav a:nth-child(6) { transition-delay: .12s; }

  dialog.menu nav a:hover,
  dialog.menu nav a:focus-visible {
    color: #7ee3fd;
  }

  dialog.menu nav a[aria-current="page"] {
    color: #00bfed;
    padding-left: 14px;
  }

  dialog.menu nav a[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    bottom: 11px;
    width: 3px;
    border-radius: 999px;
    background: #00bfed;
  }

  html body dialog.menu .talk-button {
    margin-top: 24px;
    width: 100%;
    min-height: 52px;
    padding: 13px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 16.5px;
    border-radius: 999px;
    flex: none;
  }

  /* Restore the chat-bubble icon inside the mobile menu drawer even on pages loading actions.css */
  html body dialog.menu .talk-button > span {
    display: grid !important;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: none;
  }

  html body dialog.menu .talk-button > span svg {
    display: block;
    width: 22px;
    height: 22px;
  }

  @media (prefers-reduced-motion: reduce) {
    dialog.menu,
    dialog.menu::backdrop,
    dialog.menu nav a {
      transition: none !important;
      transition-delay: 0s !important;
    }
    dialog.menu[open] {
      transform: none;
    }
    dialog.menu[open] nav a {
      opacity: 1;
      transform: none;
    }
  }
}

/* Also hide orbiting icons when a phone is held sideways (landscape) */
@media (hover: none) and (pointer: coarse) and (max-height: 540px) {
  .crest-hero .crest-orbit {
    display: none !important;
  }
}
