/* ========================================
   PHONE DEMO — DESKTOP FIRST PAINT
   Render-blocking copy of the phone demo's desktop layout, linked only on the
   homepages (IT/EN/ES), right after critical.css:

     <link rel="stylesheet" href="/css/demo-critical.css" media="not all and (max-width: 1024px)">

   On the homepages the demo starts right under the hero, so on desktop its top
   (all of it on large screens) is in the first viewport, while its styles come
   from demo.css and components.css, both loaded async there. Without this copy
   the widget painted unstyled and reflowed when they arrived (homepage CLS 0.04
   at 1350x940, 0.12 at 1920x1080). The media query (the exact complement of
   the max-width: 1024px rules, so zoomed fractional widths are covered too)
   keeps it off the render-blocking path on mobile and tablets.
   Values MUST stay in sync with demo.css / components.css.
   ======================================== */

@media not all and (max-width: 1024px) {
    .interactive-demo-section {
        position: relative;
        overflow: hidden;
    }

    .demo-card-wrapper {
        max-width: 800px;
        margin: 0 auto;
        position: relative;
        z-index: 1;
    }

    .demo-layout {
        display: flex;
        align-items: flex-start;
        gap: 48px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .iphone-frame {
        width: 100%;
        max-width: 390px;
        flex-shrink: 0;
        background: #07070a;
        border-radius: 50px;
        padding: 12px;
        position: relative;
    }

    .iphone-screen {
        width: 100%;
        aspect-ratio: 9 / 19.5;
        background: #07070a;
        border-radius: 42px;
        overflow: hidden;
        position: relative;
        display: flex;
        flex-direction: column;
    }

    .iphone-status-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 20px 4px 20px;
        height: 44px;
        position: relative;
        z-index: 5;
        border-bottom: 1px solid #07070a;
    }

    .status-time {
        font-size: 15px;
        font-weight: 600;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
        letter-spacing: -0.5px;
    }

    .status-icons {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .signal-bars {
        display: flex;
        align-items: flex-end;
        gap: 2px;
        height: 10px;
    }

    .signal-bars span {
        width: 3px;
    }

    .signal-bars span:nth-child(1) {
        height: 4px;
    }

    .signal-bars span:nth-child(2) {
        height: 6px;
    }

    .signal-bars span:nth-child(3) {
        height: 8px;
    }

    .wifi-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 12px;
    }

    .wifi-icon svg {
        width: 100%;
        height: 100%;
    }

    .battery-icon {
        width: 24px;
        height: 12px;
        border: 1.5px solid #FFFFFF;
        border-radius: 3px;
        position: relative;
        padding: 1px;
    }

    .battery-level {
        width: 85%;
        height: 100%;
    }

    .ios-dynamic-island-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 8px 0 12px 0;
        min-height: 72px;
        position: relative;
        z-index: 6;
        opacity: 0;
        visibility: hidden;
    }

    .ios-dynamic-island-wrapper.visible {
        opacity: 1;
        visibility: visible;
    }

    .ios-dynamic-island {
        width: 280px;
        height: 52px;
        background: #07070a;
        border-radius: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }

    .dynamic-island-content {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 18px;
        width: 100%;
        height: 100%;
    }

    .call-icon-wrapper {
        position: relative;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .call-pulse {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    .call-icon {
        width: 22px;
        height: 22px;
        position: relative;
    }

    .call-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        overflow: hidden;
    }

    .call-status {
        font-size: 12px;
        font-weight: 500;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    }

    .call-contact {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 2px;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    }

    .call-waveform {
        display: flex;
        align-items: center;
        gap: 3px;
        height: 20px;
        flex-shrink: 0;
    }

    .waveform-bar {
        width: 3px;
    }

    .waveform-bar:nth-child(1) {
        height: 10px;
    }

    .waveform-bar:nth-child(2) {
        height: 16px;
    }

    .waveform-bar:nth-child(3) {
        height: 12px;
    }

    .waveform-bar:nth-child(4) {
        height: 18px;
    }

    .ios-phone-dialer {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 20px 0 32px 0;
        position: relative;
    }

    .dialer-display {
        padding: 24px 20px;
        text-align: center;
        min-height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid #07070a;
        position: relative;
        z-index: 1;
    }

    .phone-number-display {
        font-size: 32px;
        font-weight: 300;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
        letter-spacing: 2px;
        word-spacing: 4px;
        position: relative;
        display: inline-block;
    }

    .dialer-keypad {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0px;
        padding: 0 20px;
        flex: 1;
        align-items: center;
        justify-items: center;
        grid-auto-rows: auto;
    }

    .dialer-keypad > * {
        justify-self: center;
        align-self: center;
    }

    .dialer-key {
        width: 65px;
        height: 65px;
        max-width: 65px;
        max-height: 65px;
        min-width: 65px;
        min-height: 65px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
        flex-shrink: 0;
        flex-grow: 0;
        box-sizing: border-box;
    }

    .key-number {
        font-size: 26px;
        font-weight: 300;
        color: #FFFFFF;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
        line-height: 1;
    }

    .key-letters {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.6);
        font-weight: 400;
        margin-top: 3px;
        letter-spacing: 1px;
    }

    .dialer-actions {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px 40px 0 40px;
        flex-wrap: nowrap;
    }

    .dialer-action-btn {
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
        max-width: 64px;
        max-height: 64px;
        border-radius: 50%;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        flex-grow: 0;
        box-sizing: border-box;
    }

    .call-btn {
        background: #34C759;
        color: #FFFFFF;
        width: 72px;
        height: 72px;
        min-width: 72px;
        min-height: 72px;
        max-width: 72px;
        max-height: 72px;
    }

    .demo-content-side {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-6);
        padding-top: var(--space-4);
        text-align: left;
    }

    .speech-bubble {
        position: relative;
        border-radius: 20px;
        padding: 20px 24px;
        margin-bottom: var(--space-8);
        max-width: 400px;
        align-self: flex-start;
        opacity: 0;
        visibility: hidden;
    }

    .speech-bubble.visible {
        opacity: 1;
        visibility: visible;
    }

    .demo-title {
        font-size: 3rem;
        font-weight: 800;
        text-align: center;
        margin-bottom: 20px;
        line-height: 1.15;
        font-family: var(--font-display);
        letter-spacing: -0.02em;
    }

    .speech-bubble .demo-title {
        margin: 0;
    }

    .demo-content-side .demo-lede {
        margin-top: 0;
        margin-bottom: 0;
        font-size: 1.0625rem;
        line-height: 1.7;
        text-align: left;
    }

    .phone-number-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        margin-bottom: 24px;
        flex-wrap: wrap;
    }

    .demo-content-side .phone-number-wrapper {
        margin-bottom: 0 !important;
        margin-top: 0;
        justify-content: flex-start;
    }

    .phone-number {
        font-family: var(--font-display);
        font-size: 3rem;
        font-weight: 800;
        text-decoration: none;
        letter-spacing: 0.02em;
        display: inline-flex;
        align-items: center;
        gap: 1px;
    }

    .phone-digit {
        display: inline-block;
    }

    .phone-space {
        display: inline-block;
        width: 12px;
    }

    .demo-disclaimer {
        font-size: 0.875rem;
        text-align: center;
        line-height: 1.65;
        margin-bottom: 44px;
        max-width: 680px;
        margin-left: auto;
        margin-right: auto;
    }

    .demo-content-side .demo-disclaimer {
        margin-top: calc(var(--space-2) - var(--space-6));
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        font-size: 15px;
        text-align: left;
    }

    .demo-cta-buttons {
        display: flex;
        gap: 16px;
        justify-content: center;
        margin-bottom: 0;
        flex-wrap: wrap;
        align-items: center;
    }

    .demo-content-side .demo-cta-buttons {
        margin-top: 12px;
        margin-bottom: 0;
        justify-content: flex-start;
    }

    .btn-demo-primary {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: var(--primary-blue) !important;
        color: white !important;
        padding: 10px 10px 10px 18px;
        border-radius: 50px;
        font-weight: 600;
        font-size: 0.9375rem;
        text-decoration: none;
        border: none;
        font-family: var(--font-display);
    }

    .btn-demo-primary .icon-bubble {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .btn-secondary {
        font-family: var(--font-display);
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: transparent !important;
        color: var(--color-primary, var(--primary-blue)) !important;
        padding: 12px 12px 12px 22px;
        border-radius: var(--radius-full, 9999px);
        font-weight: 700;
        text-decoration: none;
        border: 2px solid var(--color-primary, var(--primary-blue)) !important;
    }

    .btn-secondary .icon-bubble {
        width: 36px;
        height: 36px;
        background: var(--color-primary, var(--primary-blue)) !important;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .demo-cta-buttons .btn-demo-primary,
    .demo-cta-buttons .btn-secondary {
        flex: 0 1 auto;
        width: auto;
        white-space: nowrap;
        padding: 10px 10px 10px 18px;
        font-size: 0.9375rem;
        font-weight: 600;
        box-sizing: border-box;
    }

    .demo-cta-buttons .btn-demo-primary {
        border: 2px solid transparent;
    }
}
