/* ============================================================
   Diwali Moments — Responsive layer
   Mobile-first: base styles target 320–767px. Breakpoints below
   progressively enhance for tablet, laptop and large desktop.
   Type & many sizes are fluid (clamp) so these are targeted tweaks.
   ============================================================ */

/* ---------------- Tablet: 768–1024px ---------------- */
@media (min-width: 768px) {
    :root { --content-max: 640px; }

    .rangoli { opacity: calc(var(--rangoli-opacity) + 0.05); }

    .flame-slider__stage { width: 130px; height: clamp(260px, 40vh, 320px); }
    .flame-slider { --thumb-w: 88px; --thumb-h: 74px; }

    /* Two-up intention grid on wider screens */
    .intentions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-4);
    }
    .intentions__hint { grid-column: 1 / -1; }
}

/* ---------------- Laptop: 1025–1920px ---------------- */
@media (min-width: 1025px) {
    :root { --content-max: 720px; }

    .screen__inner { gap: var(--sp-6); }
    .intro__lead { max-width: 24ch; }
    .q-text { max-width: 22ch; }

    /* Subtle lift on interactive cards for pointer devices */
    .intention:hover { transform: translateY(-2px); }
}

/* ---------------- Desktop XL: 1921px+ ---------------- */
@media (min-width: 1921px) {
    :root {
        --content-max: 820px;
        --rangoli-opacity: 0.4;
    }
    .flame-slider__stage { height: clamp(300px, 34vh, 360px); }
}

/* ---------------- Landscape / short viewports ---------------- */
@media (max-height: 620px) and (orientation: landscape) {
    .app { padding-block: var(--sp-4); }
    .screen__inner { gap: var(--sp-3); }

    .intro__diya img { width: clamp(90px, 20vh, 130px); }

    /* Keep the flame slider usable when height is scarce */
    .flame-slider { gap: var(--sp-2); }
    .flame-slider__stage { height: clamp(150px, 60vh, 220px); width: 100px; }
    .flame-slider { --thumb-w: 60px; --thumb-h: 50px; }

    /* Recover horizontal space for questions & intentions */
    .intentions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
    .intentions__hint { grid-column: 1 / -1; }
}

/* ---------------- Phones: sound toggle shows the speaker icon only ----------------
   The text labels stay in the page for screen readers (visually hidden, not removed). */
@media (max-width: 767px), (max-height: 620px) and (orientation: landscape) {
    .sound-toggle .sound-toggle__label,
    .sound-toggle[aria-pressed="true"] .sound-toggle__label {
        position: absolute !important;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

/* ---------------- Coarse pointer (touch) enhancements ---------------- */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 50px; }
    .intention__input { width: 26px; height: 26px; }
}

/* ---------------- High-contrast preference ---------------- */
@media (prefers-contrast: more) {
    .intention { border-width: 3px; }
    .section-sub,
    .flame-slider__cap,
    .insight__turn,
    .closing__wish { color: var(--white); }
}

/* ---------------- Print (graceful, though not the primary use) ---------------- */
@media print {
    .backdrop, .sound-toggle, .nav, .modal { display: none !important; }
    body { background: #fff; color: #000; }
    .screen { display: block !important; }
}
