/* ==========================================================================
   Phone menu (portrait screens up to 900 px): Menu button on the left, logo on
   the right, and stacked glass windows of icons and project tiles (js/mobile-nav.js).
   To go back to the previous menu, remove this file's <link> and js/mobile-nav.js
   from the pages (a copy of the old pages is in .backup/2026-10-04-phone-menu/).
   ========================================================================== */

.pm-burger, .pm-home { display: none; }

@media (max-width: 900px) and (orientation: portrait) {

  /* ---------- header: Menu on the left, logo on the right ---------- */
  .site-header .site-nav { display: none !important; }
  /* the Menu button: larger, in the logo's red */
  .site-header .menu-toggle {
    order: -1; gap: 11px; padding: 10px 6px 10px 0; color: var(--red);
    font-size: 20px; font-weight: 600; -webkit-tap-highlight-color: transparent;
  }
  .site-header .menu-toggle, .site-header .menu-toggle .pm-label { color: var(--red) !important; -webkit-text-fill-color: var(--red); }
  .site-header--overlay .menu-toggle { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); }
  .site-header--overlay .pm-burger { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45)); }
  .site-header .menu-toggle__bars { display: none; }
  .site-header .brand { flex-direction: row-reverse; text-align: right; }
  .site-header .brand__text { align-items: flex-end; }
  .site-header .brand__name { white-space: nowrap; }
  @media (max-width: 420px) {
    .site-header .brand { gap: 10px; }
    .site-header .brand__name { font-size: 14px; letter-spacing: 0.06em; }
    .site-header .brand__tag { font-size: 12px; }
    .site-header .brand__mark { width: 36px; height: 36px; }
  }

  .pm-burger { display: block; width: 28px; height: 28px; overflow: visible; transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .pm-burger rect {
    fill: currentColor; transform-box: fill-box; transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1), fill 0.3s ease;
  }
  .menu-toggle:active .pm-burger { transform: scale(0.85); }
  /* open: the four squares slide to the centre and stretch into an x (one stroke red) */
  .pm-open .pm-burger { transform: rotate(45deg); }
  .pm-open .pm-burger rect:nth-child(1) { transform: translate(5.25px, 5.25px) scale(1.9, 0.3); }
  .pm-open .pm-burger rect:nth-child(2) { transform: translate(-5.25px, 5.25px) scale(0.3, 1.9); }
  .pm-open .pm-burger rect:nth-child(3) { transform: translate(5.25px, -5.25px) scale(0.3, 1.9); }
  .pm-open .pm-burger rect:nth-child(4) { transform: translate(-5.25px, -5.25px) scale(1.9, 0.3); }

  /* every page but the home page: a red x, top right under the header, back to the slideshow */
  .pm-home {
    position: fixed; z-index: 90; right: 8px; top: calc(var(--header-h) + 6px);
    display: grid; place-items: center; width: 52px; height: 52px;
    color: var(--red); -webkit-tap-highlight-color: transparent;
    animation: pm-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .pm-home svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 3px rgba(247, 248, 248, 0.9)); }
  .pm-home:active { transform: scale(0.8) rotate(90deg); }
  .pm-open .pm-home { opacity: 0; pointer-events: none; }

  html.pm-open, html.pm-open body { overflow: hidden; }
  .pm-open .site-header { z-index: 120; }
  .pm-open .area-top { z-index: 120; }                    /* Architects' Area: the Menu button stays above the windows */
  .pm-open .area-bar { visibility: hidden; }
  .pm-open .site-header--overlay, .pm-open .site-header--dark { color: #fff; }
}

/* ---------- Pages on a phone: larger text, full-width buttons, forms easy to fill in ---------- */
.dz-phone { display: none; }
@media (max-width: 900px) and (orientation: portrait) {
  .page p, .split p, .contact address { font-size: 17px; }
  .page__lead { font-size: 19px; }

  /* forms: readable labels, comfortable fields (16 px or more also stops iPhones zooming in) */
  .form { gap: 22px; }
  .form label { font-size: 15px; color: #4A5055; }
  .form input, .form select, .form textarea { font-size: 17px; padding: 12px 0; }
  .form__note { font-size: 14.5px; }
  .form__error { font-size: 16px; }
  .form__actions { flex-direction: column; align-items: stretch; }
  .form .button, .job__apply .button { width: 100%; min-height: 54px; font-size: 17px; text-align: center; }
  .form__thanks { font-size: 18px; }

  /* Contact: the 3D logo smaller, so the form starts sooner */
  .contact__axon { width: 120px; margin: 28px 0; }

  /* Apply: phones choose files, they don't drop them */
  .dz-desk { display: none; }
  .dz-phone { display: inline; }
  .dropzone { padding: 30px 16px; }
  .dropzone p { font-size: 17px; }
  .filelist li { font-size: 15px; padding: 12px 14px; }
  .filelist button { font-size: 15px; padding: 8px 4px; }
  .apply__consent { font-size: 15px !important; }
  .form .apply__consent input { width: 24px; height: 24px; }

  /* Careers */
  .job h2 { font-size: 22px; }
  .job__meta, .job__link { font-size: 16px; }
  .job__link a { display: inline-block; padding: 6px 0; }

  /* footer link: a finger-sized target */
  .site-footer { font-size: 14px; }
  .site-footer__staff { display: inline-block; padding: 8px 0; }
}

/* ---------- the layer: darkened, blurred page behind the windows ---------- */
.pm { position: fixed; inset: 0; z-index: 100; }
.pm[hidden] { display: none; }
.pm__backdrop {
  position: absolute; inset: 0;
  background: rgba(17, 19, 22, 0.5);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  animation: pm-fade-in 0.35s ease both;
}
.pm.is-closing .pm__backdrop { animation: pm-fade-out 0.3s ease 0.05s both; }

/* ---------- a window: frosted glass, stacked like cards, centred below the header ---------- */
.pm-win {
  --depth: 0;
  position: absolute;
  top: var(--header-h); bottom: 0; left: 10px; right: 10px;
  height: fit-content;
  margin: auto 0;                 /* centred up and down in the space below the header */
  max-height: calc(100% - var(--header-h) - 20px);
  display: flex; flex-direction: column;
  border-radius: 22px;
  background: rgba(247, 248, 248, 0.66);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 24px 60px rgba(10, 12, 14, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: var(--ink);
  overflow: hidden;
  transform-origin: var(--ox, 50%) var(--oy, 0%);
  animation: pm-win-in 0.55s cubic-bezier(0.2, 1.25, 0.32, 1) both;
  transition: transform 0.5s cubic-bezier(0.32, 1.2, 0.4, 1), filter 0.4s ease;
}
.pm-win--full { height: calc(100% - var(--header-h) - 20px); }
.pm-win::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: rgba(15, 17, 19, 0); pointer-events: none; transition: background 0.4s ease;
}
/* windows underneath: pushed back, darker, and out of the way */
.pm-win.is-behind {
  transform: translateY(calc(var(--depth) * -9px)) scale(calc(1 - var(--depth) * 0.05));
  pointer-events: none;
}
.pm-win.is-behind::after { background: rgba(15, 17, 19, 0.38); }
.pm-win.is-leaving { animation: pm-win-out 0.32s cubic-bezier(0.4, 0, 0.8, 0.4) forwards; pointer-events: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pm-win { background: rgba(247, 248, 248, 0.95); }
  .pm__backdrop { background: rgba(17, 19, 22, 0.72); }
}

.pm-win__head {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 8px 10px 20px;
}
.pm-win__title { flex: 1; min-width: 0; font-size: 22px; font-weight: 600; font-stretch: 112%; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-win__sub { display: block; font-size: 15px; font-weight: 400; font-stretch: 100%; color: var(--joint); }
/* close: a large red x, no circle */
.pm-close {
  flex: none; width: 52px; height: 52px; display: grid; place-items: center;
  border: 0; background: none; color: var(--red); cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease; -webkit-tap-highlight-color: transparent;
}
.pm-close svg { width: 34px; height: 34px; stroke-width: 2.2; }
.pm-close:active { transform: scale(0.8) rotate(90deg); color: var(--red-deep); }
.pm-win__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- icons, iPhone style, in the site's colours ---------- */
.pm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 6px; padding: 12px 8px 28px; }
.pm-app {
  --i: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0; border: 0; background: none; color: var(--ink);
  font: 500 21px/1.15 var(--font); text-align: center; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: pm-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i) * 45ms + 90ms);
}
.pm-app__icon {
  position: relative; width: 80px; height: 80px; display: grid; place-items: center;
  border-radius: 21px; background: linear-gradient(160deg, #353A40, var(--ink) 60%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 23, 26, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}
.pm-app__icon svg { width: 38px; height: 38px; }
.pm-app__icon::after {           /* the logo's red square, small, in a corner */
  content: ""; position: absolute; right: 11px; bottom: 11px; width: 8px; height: 8px; background: var(--red);
}
.pm-app--light .pm-app__icon { background: linear-gradient(160deg, #fff, #EEF0F2); color: var(--ink); }
.pm-app.is-current .pm-app__icon { background: linear-gradient(160deg, #E0403B, var(--red) 60%); }
.pm-app.is-current .pm-app__icon::after { background: #fff; }
.pm-app:active .pm-app__icon { transform: scale(0.86); filter: brightness(1.25); }
.pm-app__label { display: block; width: 100%; }       /* long words are shrunk to fit (js), never split */
.pm-app__count { display: block; font-size: 15px; font-weight: 400; color: var(--joint); }

/* ---------- project tiles: drag in any direction; the centre tile is the largest ---------- */
.pm-tiles { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
.pm-tiles:active { cursor: grabbing; }
.pm-tile {
  position: absolute; left: 50%; top: 50%; width: var(--cell); padding: 0;
  border: 0; background: none; color: var(--ink); font: inherit; text-align: center;
  will-change: transform, opacity; -webkit-tap-highlight-color: transparent;
}
.pm-tile__in { display: block; animation: pm-tile-in 0.75s cubic-bezier(0.34, 1.45, 0.64, 1) both; animation-delay: var(--d, 0ms); }
.pm-tile img {
  display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px;
  background: var(--concrete);
  box-shadow: 0 10px 24px rgba(20, 23, 26, 0.3);
  transition: transform 0.2s ease;
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}
.pm-tile.is-pressed img { transform: scale(0.94); }
.pm-tile__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 8px; font-size: 17px; font-weight: 600; line-height: 1.2;
}
.pm-tile__place { display: block; margin-top: 2px; font-size: 14px; color: var(--joint); }
.pm-note { padding: 40px 24px; text-align: center; color: var(--joint); font-size: 15px; }
.pm-spinner {
  width: 28px; height: 28px; margin: 60px auto 0; border-radius: 50%;
  border: 2.5px solid rgba(35, 39, 43, 0.15); border-top-color: var(--red);
  animation: pm-spin 0.8s linear infinite;
}

/* ---------- a project ---------- */
/* photos: swipe left and right with a finger (or drag with the mouse); up and down still scrolls */
.pm-photos { position: relative; margin: 4px 14px 0; overflow: hidden; border-radius: 16px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.pm-photos:active { cursor: grabbing; }
.pm-track { display: flex; will-change: transform; }
.pm-track.is-gliding { transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.pm-photos figure { flex: 0 0 100%; margin: 0; }
.pm-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--concrete); pointer-events: none; -webkit-user-drag: none; }
.pm-photos figcaption { padding: 6px 2px 0; font-size: 14px; color: var(--joint); }
.pm-count { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 12px; background: rgba(17, 19, 22, 0.55); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.pm-dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 4px; }
.pm-dots span { width: 8px; height: 8px; border-radius: 4px; padding: 0; border: 0; cursor: pointer; background: rgba(35, 39, 43, 0.2); transition: width 0.3s ease, background 0.3s ease; }
.pm-dots span.is-on { width: 24px; background: var(--red); }
.pm-project { padding: 10px 20px 28px; animation: pm-pop 0.6s cubic-bezier(0.34, 1.3, 0.64, 1) 0.15s both; }
.pm-project__desc { font-size: 17px; line-height: 1.55; }
.pm-facts { display: grid; gap: 10px; margin: 18px 0 0; padding-top: 14px; border-top: 2px solid var(--ink); }
.pm-facts div { display: grid; gap: 1px; }
.pm-facts dt { font-size: 13.5px; color: var(--joint); }
.pm-facts dd { margin: 0; font-size: 16px; }

/* ---------- the drag hint at the bottom of the tiles: a fingertip sweeping in four directions ---------- */
.pm-hint {
  position: absolute; left: 50%; bottom: 14px; z-index: 200; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px;
  border-radius: 26px; background: rgba(17, 19, 22, 0.72); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 15px; white-space: nowrap; pointer-events: none;
  animation: pm-hint-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s both;
  transition: opacity 0.6s ease;
}
.pm-hint.is-quiet { opacity: 0.55; }
.is-behind .pm-hint { opacity: 0; }
.pm-hint__pad { position: relative; width: 38px; height: 38px; }
.pm-hint__pad svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pm-hint__pad svg path { stroke: rgba(255, 255, 255, 0.55); }
.pm-hint__dot {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(214, 43, 39, 0.3);
  animation: pm-sweep 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes pm-hint-in { from { opacity: 0; transform: translate(-50%, 30px) scale(0.8); } }
@keyframes pm-sweep {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(11px, 0); }   20% { transform: translate(0, 0); }
  35% { transform: translate(0, 11px); }   45% { transform: translate(0, 0); }
  60% { transform: translate(-11px, 0); }  70% { transform: translate(0, 0); }
  85% { transform: translate(0, -11px); }  95% { transform: translate(0, 0); }
}

/* ---------- motion ---------- */
@keyframes pm-fade-in { from { opacity: 0; } }
@keyframes pm-fade-out { to { opacity: 0; } }
@keyframes pm-win-in { from { opacity: 0; transform: scale(0.35); border-radius: 40px; } }
@keyframes pm-win-out { to { opacity: 0; transform: translateY(40px) scale(0.86); } }
@keyframes pm-pop { from { opacity: 0; transform: translateY(16px) scale(0.4); } }
@keyframes pm-tile-in { from { opacity: 0; transform: scale(0.2) rotate(-6deg); } }
@keyframes pm-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pm__backdrop, .pm-win, .pm-app, .pm-tile__in, .pm-project, .pm-hint, .pm-hint__dot { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .pm-win, .pm-burger, .pm-burger rect { transition: none; }
}
