/*
 * The side menu on a phone (the owner, 2026-12-05). Upright: the list alone,
 * with the unit blueprints taking turns where the art was. Sideways: the name
 * and the blueprints on the left, the list on the right. Loaded after
 * phone-screens.css, whose older menu rules this replaces.
 */

/* ---- Upright phone, or any window too narrow for the art ---- */
:root[data-phone='true'][data-orient='portrait'] .menu.screen {
  grid-template-columns: minmax(0, 1fr);
}

:root[data-phone='true'][data-orient='portrait'] .menu-art {
  display: none;
}

:root[data-phone='true'][data-orient='portrait'] .menu__side {
  padding: max(var(--space-6), env(safe-area-inset-top)) var(--space-5)
    max(var(--space-3), env(safe-area-inset-bottom));
}

:root[data-phone='true'][data-orient='portrait'] .menu__name {
  max-width: none;
  margin-bottom: 0;
}

/* Room for the blueprints: the pitch goes, the list sits closer. */
:root[data-phone='true'][data-orient='portrait'] .menu__pitch {
  display: none;
}

:root[data-phone='true'][data-orient='portrait'] .menu__nav {
  gap: var(--space-2);
}

:root[data-phone='true'][data-orient='portrait'] .menu__items--small .menu__item {
  min-height: 2rem;
}

/* On a phone the foot keeps only the version line; the sentence would crowd out the list. */
:root[data-phone='true'] .menu__foot {
  font-size: 0;
}

:root[data-phone='true'] .menu__foot .menu__version {
  font-size: var(--text-xs);
  margin-top: 0;
}

:root[data-phone='true'] .menu__status:empty {
  display: none;
}

:root[data-phone='true'] .menu-prints {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  flex: 1 1 0;
  min-height: 5rem;
  gap: var(--space-1);
}

:root[data-phone='true'] .menu-badge {
  top: max(var(--space-2), env(safe-area-inset-top));
  right: var(--space-3);
  min-height: 2rem;
  font-size: var(--text-xs);
}

@media (max-width: 44rem) {
  :root:not([data-phone='true']) .menu.screen {
    grid-template-columns: minmax(0, 1fr);
  }

  :root:not([data-phone='true']) .menu-art {
    display: none;
  }
}

/* ---- The blueprints, taking turns ---- */
.menu-prints__stage {
  position: relative;
  min-height: 0;
}

/* The menu's blueprints float on the plain background: no frame, no grid. */
.menu-prints__canvas.blueprint {
  height: 100%;
  border: 0;
}

.menu-prints__name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* A short glitch as one drawing gives way to the next: slices slip sideways. No flashing. */
.menu-prints__stage.is-glitching {
  animation: prints-glitch 420ms steps(1, end) both;
}

@keyframes prints-glitch {
  0% {
    clip-path: inset(0 0 62% 0);
    transform: translateX(-6px);
  }
  20% {
    clip-path: inset(40% 0 22% 0);
    transform: translateX(5px);
  }
  40% {
    clip-path: inset(10% 0 48% 0);
    transform: translateX(-3px);
  }
  60% {
    clip-path: inset(58% 0 6% 0);
    transform: translateX(4px);
  }
  80% {
    clip-path: inset(0 0 0 0);
    transform: translateX(-1px);
  }
  100% {
    clip-path: none;
    transform: none;
  }
}

/* Reduced motion: each drawing fades in instead. */
.menu-prints__stage.is-fading {
  animation: prints-fade var(--dur-cinematic) var(--ease-standard) both;
}

@keyframes prints-fade {
  from {
    opacity: 0.2;
  }
}

/* ---- Sideways phone: name and blueprints on the left, the list on the right ---- */
:root[data-phone='true'][data-orient='landscape'] .menu.screen {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
}

:root[data-phone='true'][data-orient='landscape'] .menu-art {
  display: none;
}

:root[data-phone='true'][data-orient='landscape'] .menu__side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    'word nav'
    'name nav'
    'prints nav'
    'prints foot';
  column-gap: var(--space-6);
  row-gap: var(--space-2);
  padding: max(var(--space-3), env(safe-area-inset-top))
    max(var(--space-5), env(safe-area-inset-right)) max(var(--space-3), env(safe-area-inset-bottom))
    max(var(--space-5), env(safe-area-inset-left));
}

:root[data-phone='true'][data-orient='landscape'] .menu__side > .wordmark {
  grid-area: word;
  font-size: var(--text-xl);
}

:root[data-phone='true'][data-orient='landscape'] .menu__pitch,
:root[data-phone='true'][data-orient='landscape'] .menu__status:empty {
  display: none;
}

:root[data-phone='true'][data-orient='landscape'] .menu__name {
  grid-area: name;
  margin: 0;
}

:root[data-phone='true'][data-orient='landscape'] .menu-prints {
  grid-area: prints;
}

:root[data-phone='true'][data-orient='landscape'] .menu__nav {
  grid-area: nav;
  align-self: center;
  gap: var(--space-2);
}

:root[data-phone='true'][data-orient='landscape'] .menu__item {
  min-height: 2.5rem;
}

:root[data-phone='true'][data-orient='landscape'] .menu__items--small {
  grid-auto-flow: column;
}

:root[data-phone='true'][data-orient='landscape'] .menu__items--small .menu__item {
  padding-left: 0;
  font-size: var(--text-xs);
}

:root[data-phone='true'][data-orient='landscape'] .menu__foot {
  grid-area: foot;
}

:root[data-phone='true'][data-orient='landscape'] .menu__status {
  grid-area: foot;
}

/* ---- A short desktop window (a laptop with its toolbars): the same list, closer ---- */
@media (max-height: 48rem) {
  :root:not([data-phone='true']) .menu__pitch {
    display: none;
  }

  :root:not([data-phone='true']) .menu__foot {
    font-size: 0;
  }

  :root:not([data-phone='true']) .menu__foot .menu__version {
    font-size: var(--text-xs);
    margin-top: 0;
  }

  :root:not([data-phone='true']) .menu__item {
    min-height: 2.5rem;
  }

  :root:not([data-phone='true']) .menu__items--small .menu__item {
    min-height: 2rem;
  }
}
