/* tablet: context tiles go full width, project tiles pair up, text + photo rows keep 8/4 — no holes in the grid */
@media (max-width: 1080px) {
  .tile, .group { grid-column: span 12; }
  .tile.p { grid-column: span 6; }
  .tile.p.wide { grid-column: span 12; }
  .tile.intro, .tile.about { grid-column: span 8; }
  .tile.portrait, .tile.photo { grid-column: span 4; }
}

/* phone: one column; alone in its row, each photo can safely take an aspect-ratio */
@media (max-width: 680px) {
  .tile.p, .tile.intro, .tile.portrait, .tile.about, .tile.photo { grid-column: span 12; }
  .photo { min-height: 0; aspect-ratio: 4 / 3; }
  .portrait { min-height: 0; aspect-ratio: 1 / 1; }
  .tile.p.wide, .wide .cols { grid-template-columns: 1fr; }
  .wide .shot-link { margin-bottom: 1.25rem; }
  /* one column (same selectors as style.css so this later rule wins): inside details, text first, right under
     the toggle, then the photo */
  .flip .cols > div, .flip .cols > .pic { grid-column: auto; grid-row: auto; }
  .flip .cols > .pic { order: 1; }
  .focus ul, .skills { grid-template-columns: 1fr; }
  .contact a { font-size: 0.85rem; gap: 0.5rem; } /* email + Copy pill share one line at 375px; narrower, the pill wraps under */
  .facts { grid-template-columns: 1fr; gap: 0.5rem; }
  .top-inner { padding-inline: 1rem; gap: 0.75rem; }
  .top nav { gap: 0.8rem; font-size: 0.72rem; }
  .bento { padding-inline: 1rem; }
  .intro { padding: 1.75rem 1.25rem; }
  .tile { padding: 1.25rem; }
}

/* phones: nav + actions don't fit on one line — keep the actions, drop the section links.
   calibration knob: the PT nav (5 links) needs ~530px */
@media (max-width: 540px) {
  .top nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* tiles not yet scrolled into view must still print */
@media print {
  .motion main > * { opacity: 1 !important; animation: none !important; }
}
