/* Everything at 900px wide and under. */

@media (max-width: 900px) {
  :root {
    --card-top: 216px;
    --card-width: min(100vw - 40px, (100svh - 250px) * 4 / 3, 640px);
    --card-height: calc(var(--card-width) * 0.75);
  }

  /* Preloader ------------------------------------------------------------------------------- */

  .preloader-bar {
    left: 20px;
    right: 20px;
    bottom: max(24px, env(safe-area-inset-bottom));
  }

  /* Header ---------------------------------------------------------------------------------- */

  .site-header {
    top: max(16px, env(safe-area-inset-top));
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
  }

  .site-logo,
  .site-logo img {
    width: 140px;
    height: 42px;
  }

  .cta {
    display: none;
  }

  .menu-button {
    position: static;
    width: 116px;
    height: 44px;
    padding: 0 12px;
    font-size: 13px;
    transform: none;
  }

  .menu-icon {
    width: 24px;
    height: 18px;
  }

  .menu-icon i {
    width: 24px;
  }

  .menu-icon i:first-child {
    top: 4px;
  }

  .menu-icon i:last-child {
    top: 12px;
  }

  /* Hero ------------------------------------------------------------------------------------ */

  .composition,
  #composition {
    top: 0;
    left: 0;
    bottom: auto;
    width: 100%;
    height: 100%;
    transform: none;
  }

  .hero-heading {
    top: clamp(88px, 18svh, 152px);
    left: 20px;
    width: calc(100% - 40px);
    transform: none;
    text-align: left;
    font-size: clamp(21px, 5.8vw, 30px);
    line-height: 1.5;
  }

  .hero-row-desktop {
    display: none;
  }

  .hero-row-mobile {
    display: block;
  }

  .hero-row-mobile + .hero-row-mobile {
    margin-top: 2px;
  }

  .hero-strip {
    padding: 3px 6px;
    line-height: 1.2;
  }

  /* Showcase -------------------------------------------------------------------------------- */

  .showcase-intro {
    top: 110px;
    left: 20px;
    width: calc(100% - 40px);
  }

  .showcase-eyebrow,
  .showcase-description,
  .showcase-facts {
    display: none;
  }

  .showcase-title {
    font-size: 28px;
  }

  .showcase-model-anchor {
    top: var(--card-top);
    left: 50%;
    width: var(--card-width);
    height: var(--card-height);
    transform: translateX(-50%);
  }

  .showcase-caption {
    top: calc(var(--card-top) + var(--card-height) + 12px);
    left: 50%;
    width: var(--card-width);
    font-size: 11px;
    line-height: 1.4;
    transform: translateX(-50%);
  }

  .mobile-showcase-details {
    position: relative;
    z-index: 3;
    display: block;
    /* Pulled up under the card: the last screen of the journey is mostly empty lime below it. */
    margin-top: calc(-100svh + var(--card-top) + var(--card-height) + 56px);
    padding: 24px 20px 64px;
    background: var(--lime);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
  }

  .mobile-showcase-description,
  .mobile-showcase-facts {
    max-width: 640px;
    margin: 0 auto;
  }

  .mobile-showcase-facts {
    margin-top: 16px;
  }

  .mobile-showcase-details .showcase-fact h3 {
    white-space: normal;
  }

  .mobile-showcase-details .showcase-fact p {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Menu ------------------------------------------------------------------------------------ */

  .studio-menu::backdrop {
    background: #05050580;
  }

  .menu-shell {
    height: min(560px, 88svh);
  }

  .menu-close {
    top: max(16px, env(safe-area-inset-top));
    right: 20px;
    height: 44px;
  }

  .menu-body {
    inset: calc(max(16px, env(safe-area-inset-top)) + 56px) 0 0 0;
    display: block;
    padding: 0 20px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .menu-body::-webkit-scrollbar {
    display: none;
  }

  .menu-nav {
    display: block;
  }

  .menu-nav ul {
    gap: 0 16px;
  }

  .menu-mobile-only {
    display: block;
  }

  .menu-link {
    min-height: 44px;
    font-size: 18px;
  }

  .menu-info {
    margin-top: 24px;
  }

  .menu-info-text {
    max-width: 40ch;
    font-size: 14px;
  }

  .menu-cards {
    margin-top: 24px;
  }

  .menu-card {
    display: block;
  }

  .menu-card-image {
    aspect-ratio: 4 / 3;
  }

  .menu-card figcaption {
    margin-top: 8px;
  }

  /* Content sections ------------------------------------------------------------------------ */

  .continuation {
    font-size: 15px;
  }

  .section-wrap {
    width: auto;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
  }

  .section-title {
    font-size: 28px;
  }

  .continuation h3,
  .process-title {
    font-size: 22px;
  }

  .continuation [data-line],
  .continuation h3 {
    white-space: normal;
  }

  .process {
    height: auto;
    padding: 72px 0;
  }

  .process-pin {
    position: static;
    display: block;
    height: auto;
  }

  .process-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 32px;
  }

  .process-visual {
    order: 1;
    scroll-margin-top: 84px;
  }

  .process-steps {
    order: 2;
    gap: 24px;
  }

  .process-step {
    gap: 14px;
    color: var(--ink);
    opacity: 1;
  }

  .process-step.is-active {
    transform: none;
  }

  .process-marker {
    width: 12px;
    height: 12px;
    margin-top: 8px;
  }

  .work,
  .questions {
    padding: 72px 0;
  }

  .work-grid,
  .questions-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .work-aside {
    position: static;
  }

  .work-description {
    max-width: none;
    margin-top: 16px;
  }

  .work-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 28px;
  }

  .work-link {
    justify-content: center;
    width: auto;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #080a0440;
    font-size: 13px;
    text-align: center;
  }

  .work-link.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--lime);
  }

  .work-thumb {
    display: none;
  }

  .work-list {
    gap: 56px;
  }

  .work-project {
    scroll-margin-top: 84px;
  }

  .work-project h3 {
    margin-top: 20px;
  }

  .work-project p {
    margin-top: 8px;
  }

  .question summary {
    gap: 16px;
    padding: 22px 0;
    font-size: 19px;
  }

  .question-plus {
    font-size: 24px;
  }

  .question-answer {
    padding: 0 8px 24px 0;
  }

  /* Marquee --------------------------------------------------------------------------------- */

  .logo-marquee {
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }

  .marquee-group {
    gap: 48px;
    padding: 0 24px;
  }

  .marquee-group li {
    gap: 10px;
    font-size: 12px;
  }

  .marquee-group img {
    width: 24px;
    height: 24px;
  }
}

/* Landscape phones: text on the left, model on the right, in the hero and in the showcase. */
@media (max-width: 900px) and (max-height: 500px) {
  :root {
    --card-top: 76px;
    --card-width: min(52vw, (100svh - 132px) * 4 / 3);
  }

  .hero-heading {
    top: 96px;
    width: 40%;
    font-size: 19px;
  }

  .showcase-intro {
    top: 96px;
    width: 40%;
  }

  .showcase-title {
    font-size: 22px;
  }

  .showcase-model-anchor,
  .showcase-caption {
    left: auto;
    right: 20px;
    transform: none;
  }
}

/* A narrow desktop window: the menu keeps its strip and shows the navigation only. */
@media (max-width: 900px) and (hover: hover) and (pointer: fine) {
  .studio-menu::backdrop {
    background: #05050520;
  }

  .menu-shell {
    height: 24svh;
  }

  .menu-close {
    top: 20px;
    height: 36px;
  }

  .menu-body {
    inset: 20px 152px 20px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
  }

  .menu-nav {
    display: grid;
  }

  .menu-nav ul {
    gap: 4px 16px;
  }

  .menu-link {
    min-height: 0;
    font-size: 13px;
  }

  .menu-info,
  .menu-cards {
    display: none;
  }
}
