/* Phone home (max 700px): the WebGL stage, its horizontal gallery and its scroll spacer are replaced by plain
   DOM sections in the same brand: dark hero in big editorial type, a vertical work stack, a cream closing block.
   The one piece of the stage kept on phones is the opening moment (the glass A and the name lockup), shown full
   screen while html has .mh-opening, then handed over to the page. The desktop stage is untouched above 700px.
   Built by js/mobile-home.js. */
@media (max-width: 700px), (pointer: coarse) and (max-height: 500px) {
  html.mh-home { scrollbar-width: none; background: #101112; }
  html.mh-home::-webkit-scrollbar, html.mh-home body::-webkit-scrollbar { display: none; width: 0; height: 0; }
  html.mh-home, html.mh-home body { overflow-x: clip; max-width: 100%; }
  html.mh-home .scroll-spacer, html.mh-home .wl { display: none !important; }
  html.mh-home:not(.mh-opening) .stage, html.mh-home:not(.mh-opening) .ub-intro, html.mh-home:not(.mh-opening) .gl { display: none !important; }
  html.mh-home:not(.mh-opening) .nav__logo { opacity: 1 !important; }

  /* opening moment: the stage is a fixed full-screen layer over the page, only the canvas shows, the page cannot scroll */
  html.mh-opening, html.mh-opening body { overflow: hidden !important; height: 100%; overscroll-behavior: none; }
  html.mh-opening .stage { z-index: 3; background: #101112; touch-action: none; }
  html.mh-opening .stage > *:not(.gl) { visibility: hidden; }
  html.mh-opening .ub-intro { top: calc(50% - var(--mh-ay, 0px) + var(--mh-a, 230px) / 2 + 26px); color: #f1ede4; }
  html.mh-opening .ub-intro__name { font-size: clamp(34px, 11vw, 50px); }
  html.mh-opening .ub-intro__line { font-size: clamp(19px, 5.4vw, 26px); }
  html.mh-opening .ub-intro__bar { width: min(200px, 52vw); margin-top: 10px; }
  html.mh-home .nav { --nav-ink: #f1ede4; --nav-bg: #101112; }
  html.mh-home[data-mh-tone="cream"] .nav { --nav-ink: #101112; --nav-bg: #f1ede4; }
  html.mh-home[data-mh-tone="cream"] .nav .nav__toggle { color: #f1ede4; }

  html.mh-home[data-mh-tone="cream"] .ub-book { color: #101112; }

  .mh { position: relative; background: #101112; color: #f1ede4; font-family: var(--sans, Geist, system-ui, sans-serif); overflow: clip; }
  .mh a { color: inherit; text-decoration: none; }
  .mh-hero { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 96px) max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 28px) max(20px, env(safe-area-inset-left)); }
  .mh-title { margin: 0; font-weight: 400; font-size: min(21vw, 118px, 26vh); line-height: .92; letter-spacing: -.07em; }
  .mh-title--1 span { display: block; }
  .mh-title .sans { font-family: var(--sans, Geist, system-ui, sans-serif); }
  .mh-title .serif { font-family: var(--serif, "Instrument Serif", Georgia, serif); }
  .mh-title--2 { margin-top: .12em; }
  .mh-sub { margin: 28px 0 0; max-width: 16em; font-size: 18px; line-height: 1.3; letter-spacing: -.03em; opacity: .86; }
  .mh-foot { display: grid; gap: 18px; }
  .mh-note { margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.03em; opacity: .72; }
  .mh-btns { display: flex; flex-wrap: wrap; gap: 10px; }
  .mh-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
  .mh-pill--solid { background: #f1ede4; color: #101112; box-shadow: none; }
  .mh-pill--accent { background: #ff5a1f; color: #fff; box-shadow: none; }

  .mh-work { padding: 56px max(20px, env(safe-area-inset-right)) 72px max(20px, env(safe-area-inset-left)); }
  .mh-h2 { margin: 0 0 28px; font-size: min(15vw, 84px); line-height: .95; letter-spacing: -.06em; font-weight: 400; }
  .mh-h2 .serif { font-family: var(--serif, "Instrument Serif", Georgia, serif); }
  .mh-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .mh-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; border-radius: 22px; background: #1a1b1d; padding: 10px 10px 20px; }
  .mh-card__img { width: 100%; max-width: 100%; min-width: 0; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 14px; display: block; background: #26272a; }
  .mh-card__name { margin: 6px 10px 0; font-size: 30px; line-height: 1; letter-spacing: -.05em; font-weight: 400; }
  .mh-card__desc { margin: 0 10px; font-size: 16px; line-height: 1.4; letter-spacing: -.02em; opacity: .72; }
  .mh-card .mh-pill { margin: 6px 10px 0; align-self: start; justify-self: start; }

  .mh-cards.is-clipped > li:nth-child(n+4) { display: none; }
  .mh-cards.is-revealing > li:nth-child(n+4) { animation: mh-rise .7s cubic-bezier(.22,1,.36,1) both; }
  .mh-more { margin-top: 28px; width: 100%; background: transparent; color: inherit; border: 0; font-family: inherit; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
  @media (prefers-reduced-motion: reduce) { .mh-cards.is-revealing > li { animation: none !important; } }

  .mh-close { background: #f5f5f2; color: #0e0e10; padding: 64px max(20px, env(safe-area-inset-right)) 72px max(20px, env(safe-area-inset-left)); display: grid; gap: 26px; }
  .mh-close__crumb { margin: 0; font-size: 15px; letter-spacing: -.02em; opacity: .7; }
  .mh-close__lead { margin: 0; font-size: min(11.4vw, 60px); line-height: .98; letter-spacing: -.05em; font-weight: 300; }
  .mh-close__lead .serif { font-family: var(--serif, "Instrument Serif", Georgia, serif); }
  .mh-close__aside { margin: 0; font-size: 17px; line-height: 1.4; letter-spacing: -.02em; }
  .mh-close .mh-pill { box-shadow: inset 0 0 0 1px #0e0e10; }
  .mh-close .mh-pill--accent { box-shadow: none; }

  /* calm entrance (the reduced-motion case shows everything at once) */
  html.mh-home.mh-go .mh-title span, html.mh-home.mh-go .mh-sub, html.mh-home.mh-go .mh-foot { animation: mh-rise .9s cubic-bezier(.22,1,.36,1) both; }
  html.mh-home.mh-go .mh-title--1 .serif { animation-delay: .08s; }
  html.mh-home.mh-go .mh-title--2 span { animation-delay: .2s; }
  html.mh-home.mh-go .mh-sub { animation-delay: .32s; }
  html.mh-home.mh-go .mh-foot { animation-delay: .44s; }
  @keyframes mh-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { html.mh-home.mh-go .mh * { animation: none !important; } }
}
html:not(.mh-home) .mh { display: none !important; }
