/*
 * CollatCred — Responsive Overrides
 * Breakpoint-specific adjustments that don't belong inside a specific component.
 * Component-level breakpoints live in their respective files.
 *
 * Audit coverage (mobile):
 *   - CLS: iframe/skeleton baseline heights aligned
 *   - Touch targets: hero buttons, mobile ladder nav buttons (index.html)
 *   - Overflow: horizontal scroll prevention on body and main
 *   - Scroll performance: orb animation GPU-composited
 *   - Rendering: reduced-motion guard in animations.css covers keyframes
 */

/* ── Nav logo sizing ─────────────────────────────────── */

@media (max-width: 767px) {
    /* Ensure nav logo doesn't overflow on very small screens */
    .nav-logo-img {
        max-width: 40px;
        max-height: 40px;
    }
}

/* ── Main content spacing ────────────────────────────── */

@media (max-width: 639px) {
    /* Tighten section gaps on small phones */
    #main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ── Video dialog ────────────────────────────────────── */

@media (max-width: 480px) {
    .video-dialog {
        padding: 0.5rem;
    }
    .video-dialog-inner {
        border-radius: 0.75rem;
    }
}

/* ── Ph11: Post-card border reduced to 2px on mobile ─── */

@media (max-width: 767px) {
    .post-card {
        border-width: 2px;
    }
}

/* ── Overflow containment ────────────────────────────── */
/*
 * Prevents horizontal scrollbar from appearing if any child element
 * slightly exceeds viewport width. The body overflow-x:hidden in
 * globals.css covers the main case; this ensures the html root also
 * participates so momentum scrolling on iOS doesn't expose overflow.
 */

html {
    overflow-x: hidden;
}

/* ── Calculator wrapper — mobile overflow guard ──────── */
/*
 * calculator-wrapper has overflow:visible for the brand glow shadow.
 * On mobile widths below the max-width, ensure it never exceeds 100vw.
 */

@media (max-width: 599px) {
    .calculator-wrapper {
        max-width: 100%;
    }
}

/* ── Ambient orb — GPU compositing hint ─────────────── */
/*
 * The orb pulse animation uses transform+opacity which browsers
 * should already composite on the GPU. The will-change hint avoids
 * any repaint during the animation on lower-end mobile GPUs.
 * Only applied on pointer:coarse (touch) devices to avoid wasting
 * GPU memory on desktop.
 */

@media (pointer: coarse) {
    .dynamic-orb {
        will-change: transform, opacity;
    }
}

/* ── Ph11: Suppress hover states on touch-only devices ── */
/*
 * On devices with no fine pointer (touch screens), hover effects
 * can get stuck in the triggered state after a tap.
 * This block resets all interactive hover transforms/filters back
 * to their resting state so touch users never see ghost hovers.
 */

@media (hover: none) {
    .bento-card:hover {
        transform: none;
        border-color: rgba(255,255,255,0.06);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-card);
    }

    .hero-btn-primary:hover,
    .hero-btn-secondary:hover,
    .hero-btn-tertiary:hover,
    .nav-cta:hover {
        transform: none;
        filter: none;
    }

    .hero-btn-primary:hover .icon-play,
    .hero-btn-secondary:hover .icon-sliders,
    .hero-btn-tertiary:hover .icon-robot {
        transform: none;
    }

    .nav-link::after {
        display: none;
    }

    .post-card:hover {
        transform: none;
        filter: none;
        box-shadow: 0 24px 48px -12px rgba(6, 182, 212, 0.15);
    }
}
