/* ============================================================
   WOW effects: aurora background, 3D tilt + glare, hero shimmer
   ============================================================ */

/* ---------- 1) Aurora background ---------- */
/* Canvas costellazione (JS animated-bg.js) */
#animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

.aurora-orb {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    mix-blend-mode: multiply;
    will-change: transform, margin-left, margin-top;
    opacity: 0.2;
    pointer-events: none;
}

.aurora-orb-1 {
    width: 46vmax;
    height: 46vmax;
    top: -16vmax;
    left: -12vmax;
    background: radial-gradient(circle at 30% 30%, #005A7E, transparent 70%);
    animation: auroraDrift1 26s ease-in-out infinite alternate;
}

.aurora-orb-2 {
    width: 42vmax;
    height: 42vmax;
    bottom: -18vmax;
    right: -12vmax;
    background: radial-gradient(circle at 60% 40%, #005A7E, transparent 70%);
    animation: auroraDrift2 33s ease-in-out infinite alternate;
    opacity: 0.16;
}

.aurora-orb-3 {
    width: 34vmax;
    height: 34vmax;
    top: 38%;
    left: 28%;
    background: radial-gradient(circle at 50% 50%, #005A7E, transparent 70%);
    animation: auroraDrift3 40s ease-in-out infinite alternate;
    opacity: 0.11;
}

.aurora-orb-4 {
    width: 30vmax;
    height: 30vmax;
    top: 6%;
    right: -8vmax;
    background: radial-gradient(circle at 50% 50%, #2C2C2C, transparent 70%);
    animation: auroraDrift4 46s ease-in-out infinite alternate;
    opacity: 0.07;
}

.aurora-orb-5 {
    width: 26vmax;
    height: 26vmax;
    bottom: 12%;
    left: -7vmax;
    background: radial-gradient(circle at 50% 50%, #F6F6F6, transparent 70%);
    animation: auroraDrift5 30s ease-in-out infinite alternate;
    opacity: 0.1;
}

.aurora-grid {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: radial-gradient(rgba(0, 90, 126, 0.06) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 78%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 78%);
    pointer-events: none;
}

.aurora-vignette {
    position: fixed;
    z-index: -1;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 52%, rgba(44, 44, 44, 0.05) 100%);
    pointer-events: none;
}

@keyframes auroraDrift1 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(14vmax, 7vmax, 0) scale(1.18); }
    to   { transform: translate3d(-7vmax, 15vmax, 0) scale(0.95); }
}

@keyframes auroraDrift2 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-12vmax, -9vmax, 0) scale(1.12); }
    to   { transform: translate3d(7vmax, -15vmax, 0) scale(0.9); }
}

@keyframes auroraDrift3 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-9vmax, 11vmax, 0) scale(1.22); }
    to   { transform: translate3d(11vmax, -7vmax, 0) scale(1); }
}

@keyframes auroraDrift4 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-10vmax, -6vmax, 0) scale(1.15); }
    to   { transform: translate3d(5vmax, -11vmax, 0) scale(0.92); }
}

@keyframes auroraDrift5 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(8vmax, 9vmax, 0) scale(1.2); }
    to   { transform: translate3d(-6vmax, 6vmax, 0) scale(0.95); }
}

/* ---------- 2) 3D tilt + glare ---------- */
.detail-card {
    position: relative;
}

.service-card,
.demo-card {
    transition: all 0.5s ease;
}

.detail-card {
    transition: all 0.3s ease;
}

.service-card::after,
.demo-card::after,
.detail-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 90, 126, 0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.service-card.glare-on::after,
.demo-card.glare-on::after,
.detail-card.glare-on::after {
    opacity: 1;
}

/* ---------- 3) Hero title shimmer + reveal ---------- */
header h1 {
    animation: none;
    filter: drop-shadow(0 0 22px rgba(0, 90, 126, 0.45));
}

.hero-char {
    display: inline-block;
    background: linear-gradient(120deg, #F6F6F6 0%, rgba(246, 246, 246, 0.55) 28%, #F6F6F6 50%, rgba(246, 246, 246, 0.55) 72%, #F6F6F6 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: 0;
    animation:
        heroCharIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards,
        heroShimmer 3.6s linear infinite;
    animation-delay: var(--d, 0s), var(--d, 0s);
}

@keyframes heroCharIn {
    from { opacity: 0; transform: perspective(400px) rotateX(-85deg) translateY(0.55em); }
    to   { opacity: 1; transform: perspective(400px) rotateX(0) translateY(0); }
}

@keyframes heroShimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ---------- 4) Visibilità card sopra l'aurora ---------- */
.service-card,
.detail-card,
.schedule-card {
    background: #ffffff;
    border-color: rgba(44, 44, 44, 0.14);
    box-shadow: 0 8px 30px rgba(44, 44, 44, 0.06);
}

html[data-theme="dark"] .service-card,
html[data-theme="dark"] .detail-card,
html[data-theme="dark"] .schedule-card {
    background: #1A1E20;
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

html[data-theme="dark"] .aurora-orb { mix-blend-mode: screen; }
html[data-theme="dark"] .aurora-orb-1,
html[data-theme="dark"] .aurora-orb-2,
html[data-theme="dark"] .aurora-orb-3 {
    background: radial-gradient(circle at 50% 50%, #3AA0C8, transparent 70%);
}
html[data-theme="dark"] .aurora-orb-4 {
    background: radial-gradient(circle at 50% 50%, #EDEEF0, transparent 70%);
    opacity: 0.04;
}
html[data-theme="dark"] .aurora-grid {
    background-image: radial-gradient(rgba(58,160,200,0.08) 1px, transparent 1px);
}
html[data-theme="dark"] .aurora-vignette {
    background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.35) 100%);
}
html[data-theme="dark"] .service-card::after,
html[data-theme="dark"] .demo-card::after,
html[data-theme="dark"] .detail-card::after {
    background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%), rgba(58,160,200,0.16), transparent 45%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .service-card,
    :root:not([data-theme]) .detail-card,
    :root:not([data-theme]) .schedule-card { background:#1A1E20; border-color:rgba(255,255,255,0.10); }
    :root:not([data-theme]) .aurora-orb { mix-blend-mode: screen; }
}

.service-card:hover {
    box-shadow: 0 10px 30px rgba(0, 90, 126, 0.18);
}

html[data-theme="dark"] .service-card:hover {
    box-shadow: 0 10px 30px rgba(58,160,200,0.20);
}

.demo-card {
    background: #ffffff;
    border: 1px solid rgba(0, 90, 126, 0.45);
    box-shadow:
        0 12px 40px rgba(0, 90, 126, 0.16),
        inset 0 0 0 1px rgba(0, 90, 126, 0.08);
}

html[data-theme="dark"] .demo-card {
    background: #1A1E20;
    border-color: rgba(58,160,200,0.32);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(58,160,200,0.08);
}

.demo-card:hover {
    box-shadow:
        0 14px 44px rgba(0, 90, 126, 0.22),
        inset 0 0 0 1px rgba(0, 90, 126, 0.1);
}

html[data-theme="dark"] .demo-card:hover {
    box-shadow: 0 14px 44px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(58,160,200,0.12);
}

/* ---------- Mobile: alleggerisci aurora ---------- */
@media (max-width: 768px) {
    .aurora-orb {
        filter: blur(45px);
    }
    .aurora-orb-1 {
        opacity: 0.14;
    }
    .aurora-orb-2 {
        opacity: 0.12;
    }
    .aurora-orb-3 {
        opacity: 0.08;
    }
    .aurora-orb-4 {
        opacity: 0.05;
    }
    .aurora-orb-5 {
        opacity: 0.06;
    }
    .aurora-grid {
        background-size: 22px 22px;
    }
}

/* ---------- Riduzione del movimento ---------- */
.ferie-modal.static-corner {
    top: auto;
    bottom: 18px;
    left: 18px;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    header h1 {
        filter: none;
    }
    .hero-char {
        animation: none !important;
        opacity: 1 !important;
        background: none !important;
        -webkit-text-fill-color: #F6F6F6 !important;
        color: #F6F6F6 !important;
    }
    .aurora-orb {
        animation: none !important;
        opacity: 0.08;
    }
    .aurora-grid,
    .aurora-vignette {
        display: none;
    }
}

/* ---------- 5) Modal iPhone lock screen (roaming) ---------- */
.ferie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 228px;
    max-width: calc(100vw - 24px);
    background: linear-gradient(145deg, #4A4A52, #1C1C22 45%, #3A3A42);
    border-radius: 46px;
    padding: 9px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 10px 28px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.18),
        inset 0 -1px 2px rgba(0, 0, 0, 0.55);
    z-index: 9990;
    cursor: grab;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    will-change: transform;
}

.ferie-modal.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ferie-modal.paused {
    cursor: default;
}

.ferie-modal.hidden {
    opacity: 0;
    transform: translate3d(0, 24px, 0) scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.iphone-screen {
    position: relative;
    height: 440px;
    border-radius: 38px;
    background:
        radial-gradient(120% 60% at 82% 4%, rgba(0, 110, 150, 0.55), transparent 60%),
        radial-gradient(140% 70% at 18% 108%, rgba(0, 60, 85, 0.65), transparent 62%),
        linear-gradient(180deg, #0E1B22 0%, #0B161C 55%, #070D12 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.iphone-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 28%, transparent 42%);
    pointer-events: none;
}

.ferie-modal .ferie-close {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 27px;
    height: 27px;
    z-index: 20;
    border-radius: 50%;
    border: 1px solid rgba(246, 246, 246, 0.55);
    background: rgba(20, 22, 28, 0.92);
    color: #F6F6F6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.ferie-modal .ferie-close:hover {
    background: #005A7E;
    transform: scale(1.08);
}

.ferie-modal .ferie-close svg {
    width: 12px;
    height: 12px;
}

.iphone-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 22px 0;
    color: #F6F6F6;
}

.iphone-time {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    font-variant-numeric: tabular-nums;
}

.iphone-glyphs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.iphone-glyph-signal {
    width: 12px;
    height: 11px;
    color: #F6F6F6;
}

.iphone-glyph-signal rect {
    fill: currentColor;
}

.iphone-glyph-wifi {
    width: 13px;
    height: 10px;
    color: #F6F6F6;
}

.iphone-battery {
    display: inline-flex;
    align-items: center;
}

.iphone-battery svg {
    width: 22px;
    height: 12px;
    color: #F6F6F6;
}

.iphone-clock {
    text-align: center;
    padding: 40px 0 22px;
    color: #F6F6F6;
}

.iphone-clock-time {
    font-size: 52px;
    font-weight: 200;
    line-height: 1;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.iphone-clock-date {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(246, 246, 246, 0.85);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.iphone-notifications {
    position: relative;
    margin: auto 14px 14px;
    display: flex;
    flex-direction: column;
}

.iphone-notification {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(22, 28, 34, 0.85);
    border: 1px solid rgba(246, 246, 246, 0.16);
    border-radius: 18px;
    padding: 11px 12px;
    text-align: left;
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.iphone-notification-body {
    min-width: 0;
}

.iphone-appname {
    font-size: 11px;
    font-weight: 700;
    color: #6FC3E8;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
}

.iphone-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #F6F6F6;
    line-height: 1.3;
}

.ferie-modal .ferie-text {
    color: rgba(246, 246, 246, 0.68);
    font-size: 11.5px;
    line-height: 1.5;
    margin-top: 3px;
}

.iphone-notification-wrapper {
    position: relative;
    z-index: 1;
}

.iphone-notification-wrapper.slide-out {
    animation: notifOut 0.26s ease forwards;
}

.iphone-notification-wrapper.slide-in {
    animation: notifIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes notifOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(-28px) scale(0.96); }
}

@keyframes notifIn {
    from { opacity: 0; transform: translateX(28px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.iphone-notification-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    min-height: 10px;
}

.iphone-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(246, 246, 246, 0.3);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.iphone-dot:hover {
    background: rgba(246, 246, 246, 0.5);
}

.iphone-dot.active {
    background: #F6F6F6;
    transform: scale(1.15);
}

.iphone-more {
    font-size: 10px;
    font-weight: 700;
    color: rgba(246, 246, 246, 0.55);
    margin-left: 2px;
}

.iphone-lock-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 16px;
    flex-shrink: 0;
}

.iphone-home-indicator {
    width: 104px;
    height: 4px;
    border-radius: 2px;
    background: rgba(246, 246, 246, 0.85);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

@keyframes ferieFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 480px) {
    .ferie-modal {
        width: 200px;
        border-radius: 38px;
    }
    .iphone-screen {
        height: 400px;
        border-radius: 31px;
    }
    .iphone-statusbar {
        padding: 13px 16px 0;
    }
    .iphone-time {
        font-size: 11px;
    }
    .iphone-glyphs {
        gap: 3px;
    }
    .iphone-glyph-signal {
        width: 11px;
        height: 10px;
    }
    .iphone-glyph-wifi {
        width: 12px;
        height: 9px;
    }
    .iphone-battery svg {
        width: 20px;
        height: 11px;
    }
    .iphone-clock-time {
        font-size: 42px;
    }
    .iphone-clock {
        padding: 30px 0 20px;
    }
    .iphone-lock-controls {
        padding: 0 12px 12px;
    }
    .iphone-home-indicator {
        width: 92px;
    }
}