/* Shared responsive rules. Loaded after each page's own styles, so these win on small screens. */

/* Tablet and phone (single-column layouts) */
@media (max-width: 820px) {
  /* Paragraphs nudged down to line up with a heading beside them on desktop
     sit directly under the heading once the columns stack. */
  .cs-split > .cs-p[style*="padding-top"] { padding-top: 0 !important; }
  .cs-split { row-gap: 16px; }

  /* Analysis Agent quality gauge: stack the two labels so they don't collide. */
  .aa-gauge { padding-top: 62px; }
  .aa-gtag-final { bottom: 54px; }
}

/* Phone */
@media (max-width: 600px) {
  /* Small hint on expandable images, since phones have no hover cursor. */
  .cs-zoom { position: relative; }
  .cs-zoom::after {
    content: "Tap to expand";
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 34, 51, .82);
    color: #F3F5F6;
    font: 600 12px/1.3 'Manrope', system-ui, sans-serif;
    pointer-events: none;
  }
}

/* --- Page transitions ---------------------------------------------------
   Gentle "fade-through" when moving between pages (Home → Work, etc.).
   The leaving page fades out, then the arriving page fades in while rising
   a few pixels. Uses the browser's View Transitions API; older browsers
   just navigate normally, so nothing breaks. */
@view-transition {
  navigation: auto;
}

@keyframes vt-page-out {
  to { opacity: 0; }
}
@keyframes vt-page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Leaving page: fade out first. */
::view-transition-old(root) {
  animation: vt-page-out 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}
/* Arriving page: fade in and rise, starting just after the old one leaves. */
::view-transition-new(root) {
  animation: vt-page-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

/* Respect the system "reduce motion" setting: skip the motion entirely. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
