/* Breakpoints. Loaded last so these rules win over the component files.

   Width:  <= 1500px  coffee cup hidden (no room beside the monitor)
           <= 1420px  wall light + CV switch hidden, footer CV link shown
           <= 1240px  window hidden
           <=  720px  phone layout: one column, the whole screen scrolls
   Height: <=  780px  tighter spacing (desktop only)
           <=  660px  footer and version label hidden (desktop only) */

@media (max-width: 1500px) {
  .coffee {
    display: none;
  }
}

@media (max-width: 1420px) {
  .wall-item {
    display: none;
  }

  .cv-link {
    display: block;
  }
}

@media (max-width: 1240px) {
  .window {
    display: none;
  }
}

/* ---------- short desktop windows ---------- */

@media (min-width: 721px) and (max-height: 780px) {
  .scene {
    padding-top: 10px;
    padding-bottom: 44px;
  }

  .desk {
    height: 60px;
  }

  .top {
    padding: 10px 24px;
  }

  .screen-shell {
    padding: 12px;
  }

  .identity {
    padding: 16px;
  }

  .pixel-portrait {
    margin-bottom: 14px;
  }

  .console {
    padding: 18px 24px;
  }

  .boot {
    margin-bottom: 14px;
  }

  .readout {
    font-size: 17px;
    margin-bottom: 16px;
  }

  .controls {
    padding: 12px 16px 14px;
  }

  .buttons button {
    padding: 11px 7px;
  }

  .footer {
    padding: 8px 16px;
  }

  .pc-neck {
    height: 22px;
  }
}

@media (min-width: 721px) and (max-height: 660px) {
  .footer,
  .top span:nth-child(2) {
    display: none;
  }
}

/* ---------- phones ---------- */

@media (max-width: 720px) {
  .scene {
    height: max(100dvh, 560px);
    padding: 12px 12px 34px;
  }

  .desk {
    height: 48px;
    background: linear-gradient(#c97a4b 0 4px, #b5653f 4px 20px, #3a1c26 20px 24px, #8a4632 24px 100%);
  }

  .machine {
    border-width: 10px;
    box-shadow: 7px 7px 0 var(--shadow);
  }

  .pc-neck {
    height: 22px;
  }

  .pc-base {
    width: 180px;
  }

  /* half size (shrinks further on very narrow screens), with extra height
     so it stays easy to tap */
  .plug {
    display: flex;
    align-items: flex-end;
    right: calc(50% + 90px);
    width: min(80px, calc(50% - 92px));
    height: 44px;
  }

  .top {
    padding: 14px 15px;
  }

  /* keep only the first label in the top bar */
  .top span:nth-child(2),
  .top span:last-child {
    display: none;
  }

  .screen-shell {
    padding: 10px;
  }

  /* sidebar on top, and the whole screen scrolls as one */
  .screen {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .identity {
    display: grid;
    grid-template-columns: 76px 1fr;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    overflow: visible;
    border-right: 0;
    border-bottom: var(--pixel) solid var(--ink);
  }

  .identity h1 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .identity p {
    font-size: 13px;
  }

  .pixel-portrait {
    width: 70px;
    min-width: 0;
    margin: 0;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .console {
    overflow: visible;
    padding: 18px;
  }

  .readout {
    font-size: 17px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .controls {
    padding: 12px;
  }

  .buttons {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  button {
    font-size: 8px;
    padding: 11px 4px;
  }

  .footer {
    font-size: 8px;
    padding: 10px 12px;
  }

  .footer span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud,
  .star,
  .plug .plug__head,
  .power-off::before,
  .power-off p,
  .power-off .power-off__hint {
    animation: none;
  }

  .power-off::before {
    display: none;
  }

  .plug:hover .plug__spark,
  .plug:focus-visible .plug__spark {
    animation: none;
    opacity: 1;
  }

  .steam rect {
    animation: none;
    opacity: 0.7;
  }
}
