/**
 * GLIDE Engineering - Main CSS
 * Sistema di scalatura mobile ottimizzato con golden ratio
 * 
 * IMPORTANTE: Questo sito è FULL PAGE - NO SCROLL
 * Tutti gli overflow devono essere SEMPRE hidden
 * Mai usare overflow: auto o overflow-y: scroll
 */

/* =====================================
   VARIABILI CSS E CUSTOM PROPERTIES
   ===================================== */
:root {
    --primary-color: #1A1732;
    --accent-color: #EB068C;
    --accent-dark: #D9158A;
    --accent-darker: #B71C87;
    --white: #FFFFFF;
    --footer-bg: #0F0D1F;
    --black-overlay: rgba(0, 0, 0, 0.3);
    --golden-ratio: 1.618;
    
    /* Viewport units dinamici */
    --vh: 1vh;
    --vw: 1vw;
}

/* =====================================
   RESET E BASE
   ===================================== */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

/* Sistema di scalatura responsive con golden ratio */
@media (max-width: 1400px) {
    html { font-size: min(15px, 1.1vw); }
}

@media (max-width: 1200px) {
    html { font-size: min(14px, 1.15vw); }
}

@media (max-width: 992px) {
    html { font-size: min(13px, 1.35vw); }
}

@media (max-width: 768px) {
    html { font-size: min(12px, 1.56vw); }
}

@media (max-width: 576px) {
    html { font-size: min(11px, 1.91vw); }
}

@media (max-width: 414px) {
    html { font-size: min(10px, 2.42vw); }
}

/* Scalatura basata sull'altezza */
@media (max-height: 800px) {
    html { font-size: min(14px, 1.75vh); }
}

@media (max-height: 700px) {
    html { font-size: min(13px, 1.86vh); }
}

@media (max-height: 600px) {
    html { font-size: min(12px, 2vh); }
}

@media (max-height: 500px) {
    html { font-size: min(10px, 2vh); }
}

/* Viewport height fix - Safari specific */
:root {
    --full-height: 100vh; /* fallback */
    --full-height: -webkit-fill-available;
}

/* Safari iOS viewport fix */
@supports (-webkit-touch-callout: none) {
    :root {
        --full-height: 100vh;
        /* Use dynamic viewport height for Safari */
        --full-height: 100dvh;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* =====================================
   BODY E LAYOUT PRINCIPALE
   ===================================== */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--primary-color);
    color: var(--white);
    width: 100vw;
    height: 100vh;
    height: var(--full-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    /* Safari specific fixes */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Safari iOS specific */
@supports (-webkit-touch-callout: none) {
    body {
        height: 100vh;
        /* Use new viewport units if available */
        height: 100dvh;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 0;
    min-height: 0;
    /* Safari flex fix */
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
}

/* Safari iOS specific */
@supports (-webkit-touch-callout: none) {
    .main-content {
        flex: 1 1 0%;
        min-height: 0;
        height: auto;
    }
}

.container {
    width: 100%;
    max-width: 75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(0.75rem, 3vw, 2rem);
    margin: 0 auto;
    gap: 0;
    min-height: 0;
    /* Safari flex fix */
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* Safari iOS specific fix */
@supports (-webkit-touch-callout: none) {
    .container {
        height: auto;
        flex: 1 1 0%;
        justify-content: flex-start;
        padding-top: env(safe-area-inset-top);
        padding-bottom: 0;
    }
}

/* =====================================
   LOGO E BRAND - OTTIMIZZATO PER MOBILE
   ===================================== */
.logo-and-brand-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(0.5rem, 2vh, 1.5rem) clamp(0.5rem, 2vw, 1.5rem) clamp(0.5rem, 2vh, 1rem);
    margin-bottom: 0;
    flex-shrink: 0;
}

.logo-container {
    width: clamp(4rem, 16vw, 5.5rem);
    height: clamp(4rem, 16vw, 5.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text-container {
    margin-top: clamp(0.25rem, 1vh, 0.5rem);
    margin-bottom: clamp(0.375rem, 1.5vh, 0.75rem);
    text-align: center;
}

.brand-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 12vw, 5rem);
    color: var(--white);
    letter-spacing: 0.18em;
    line-height: 1;
    display: block;
    width: 100%;
}

.brand-engineering {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(1rem, 5vw, 2rem);
    color: var(--accent-color);
    letter-spacing: 0.29em;
    line-height: 1;
    margin-top: clamp(-0.375rem, -1.8vw, -0.625rem);
    display: block;
    width: 100%;
}

/* =====================================
   CONTENUTO PRINCIPALE - OTTIMIZZATO
   ===================================== */
.content-container {
    width: 100%;
    max-width: 60rem;
    padding: clamp(0.75rem, 3vh, 1.5rem) clamp(1rem, 4vw, 2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    background-color: rgb(25, 20, 41);
    border: none;
    border-radius: clamp(0.5rem, 2vw, 0.75rem);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
    margin-bottom: clamp(0.375rem, 1.5vh, 0.75rem);
    z-index: 1;
    flex: 1;
    overflow: hidden;
    gap: 0;
    min-height: 0;
    /* Safari fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Safari iOS specific */
@supports (-webkit-touch-callout: none) {
    .content-container {
        flex: 1 1 auto;
        display: -webkit-flex;
        -webkit-flex-direction: column;
        flex-direction: column;
        overflow: visible; /* Important for Safari */
        min-height: 0;
        height: auto;
    }
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 4vw, 1.625rem);
    color: var(--white);
    margin-bottom: clamp(0.375rem, 1.5vh, 0.625rem);
    text-align: center;
    position: relative;
    padding-bottom: 0;
    flex: 0 0 auto;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -0.125rem;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(2.5rem, 10vw, 3.5rem);
    height: 2px;
    background-color: var(--accent-color);
    opacity: 0.6;
}

.accent {
    color: var(--accent-color);
}

/* =====================================
   TERMINAL - OTTIMIZZATO PER MOBILE
   ===================================== */
.terminal {
    background-color: rgba(20, 16, 34, 0.95);
    border-radius: clamp(0.25rem, 1vw, 0.3125rem);
    padding: clamp(0.625rem, 2.5vh, 1rem) clamp(0.75rem, 3vw, 1rem);
    width: 100%;
    margin-bottom: 0;
    margin-top: clamp(0.375rem, 1.5vh, 0.625rem);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 3vw, 0.9375rem);
    line-height: 1.35;
    min-height: clamp(8rem, 32vh, 14rem);
    max-height: none;
    height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    /* Safari fixes */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-break: break-word;
    -webkit-hyphens: none;
    hyphens: none;
}

/* Safari iOS specific terminal fix */
@supports (-webkit-touch-callout: none) {
    .terminal {
        overflow: visible; /* Critical for Safari */
        min-height: auto;
        height: auto;
        flex: 1 1 auto;
        display: -webkit-flex;
        -webkit-flex-direction: column;
        flex-direction: column;
        /* Ensure text is not cut off */
        padding-bottom: clamp(0.75rem, 3vh, 1rem);
    }
    
    /* Ensure terminal lines are visible */
    .terminal-line {
        flex-shrink: 0;
        min-height: auto;
    }
    
    .terminal-line-content {
        overflow: visible;
        word-wrap: break-word;
        overflow-wrap: break-word;
        -webkit-line-break: after-white-space;
        line-break: after-white-space;
    }
}

/* =====================================
   FORM EMAIL - RIPROPORZIONATO MOBILE
   ===================================== */
.notification-form {
    background-color: rgba(36, 27, 47, 0.95);
    border-radius: clamp(0.375rem, 1.5vw, 0.5rem);
    padding: clamp(0.625rem, 2.5vh, 1rem) clamp(0.75rem, 3vw, 1.25rem);
    width: 100%;
    position: relative;
    flex: 0 0 auto;
    min-height: 0;
    margin-top: clamp(0.5rem, 2vh, 0.75rem);
}

.form-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 3vw, 1rem);
    margin-bottom: clamp(0.5rem, 2vh, 0.75rem);
    text-align: center;
    position: relative;
    padding-top: clamp(0.375rem, 1.5vh, 0.625rem);
}

.form-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(2rem, 8vw, 2.5rem);
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 1px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: clamp(0.375rem, 1.5vh, 0.5rem);
}

.name-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.375rem, 1.5vw, 0.5rem);
}

.email-button-group {
    display: flex;
    gap: clamp(0.375rem, 1.5vw, 0.5rem);
    align-items: stretch;
    flex-direction: column;
}

.name-input,
.email-input {
    padding: clamp(0.5rem, 2vh, 0.625rem) clamp(0.625rem, 2.5vw, 0.875rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: clamp(0.25rem, 1vw, 0.3125rem);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 3vw, 0.875rem);
    transition: all 0.3s ease;
    width: 100%;
}

/* Prevent zoom on iOS */
@supports (-webkit-touch-callout: none) {
    .name-input,
    .email-input,
    .terminal-input {
        font-size: 16px !important;
    }
}

.name-input::placeholder,
.email-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(0.6875rem, 2.75vw, 0.8125rem);
}

.name-input:focus,
.email-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
}

.notify-btn {
    padding: clamp(0.5rem, 2vh, 0.625rem) clamp(1.25rem, 5vw, 1.75rem);
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: clamp(0.25rem, 1vw, 0.3125rem);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 3vw, 0.9375rem);
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 100%;
    min-height: 40px;
}

.notify-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

.notify-btn:active {
    transform: translateY(0);
    background-color: var(--accent-darker);
}

/* =====================================
   POPUP
   ===================================== */
.popup {
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(20, 16, 34, 0.95);
    color: var(--accent-color);
    padding: clamp(0.75rem, 3vh, 1rem) clamp(1.5rem, 6vw, 2rem);
    border-radius: clamp(0.375rem, 1.5vw, 0.5rem);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 3vw, 0.875rem);
    box-shadow: 0 0 1rem rgba(235, 6, 140, 0.3);
    z-index: 1000;
    max-width: 90vw;
    text-align: center;
}

.popup.hidden {
    display: none;
}

/* =====================================
   FOOTER - OTTIMIZZATO
   ===================================== */
.footer {
    background-color: var(--footer-bg);
    padding: clamp(0.625rem, 2.5vh, 0.875rem) clamp(0.875rem, 3.5vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: clamp(0.875rem, 3.5vw, 1.5rem);
    font-size: clamp(0.75rem, 3vw, 0.75rem);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.footer > * {
    display: flex;
    align-items: center;
}

.social-links {
    margin: 0;
}

.social-icon {
    width: clamp(1.625rem, 6.5vw, 1.75rem);
    height: clamp(1.625rem, 6.5vw, 1.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--white);
}

.social-icon:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.social-icon i {
    font-size: clamp(1rem, 4vw, 1.125rem);
}

.footer-links {
    margin: 0;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: clamp(0.75rem, 3vw, 0.75rem);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.copyright {
    font-size: clamp(0.75rem, 3vw, 0.75rem);
    opacity: 0.9;
    font-family: 'JetBrains Mono', monospace;
    color: var(--white);
    margin: 0;
}

/* Solo quando è un link */
a.copyright {
    text-decoration: none;
    transition: all 0.3s ease;
}

a.copyright:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* =====================================
   UTILITY CLASSES
   ===================================== */
.hidden {
    display: none !important;
}

/* Nasconde elementi di gioco e flipbook */
#game-container,
#mobile-touch-controls,
#flipbook-overlay {
    display: none !important;
}

/* =====================================
   MEDIA QUERIES - TABLET
   ===================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        gap: clamp(0.25rem, 1vh, 0.5rem);
    }
    
    .logo-and-brand-container {
        padding: clamp(0.875rem, 3.5vh, 1.5rem) clamp(0.875rem, 3vw, 1.5rem) clamp(0.5rem, 2vh, 0.875rem);
        margin-bottom: clamp(0.125rem, 0.5vh, 0.375rem);
    }
    
    .logo-container {
        width: clamp(4rem, 12vw, 4.5rem);
        height: clamp(4rem, 12vw, 4.5rem);
    }
    
    .brand-name {
        font-size: clamp(2.5rem, 8vw, 3.75rem);
    }
    
    .brand-engineering {
        font-size: clamp(1.125rem, 4vw, 1.625rem);
    }
    
    .content-container {
        padding: clamp(1rem, 4vh, 1.5rem) clamp(1.25rem, 5vw, 1.875rem);
        gap: 0;
    }
    
    .terminal {
        min-height: clamp(10rem, 36vh, 14rem);
        margin-top: clamp(0.5rem, 2vh, 0.625rem);
        margin-bottom: 0;
    }
    
    h1 {
        margin-bottom: clamp(0.375rem, 1.5vh, 0.5rem);
        font-size: clamp(1.25rem, 4vw, 1.5rem);
    }
    
    .notification-form {
        padding: clamp(0.75rem, 3vh, 1rem);
        margin-top: clamp(0.625rem, 2.5vh, 0.75rem);
    }
    
    .form-title {
        margin-bottom: clamp(0.5rem, 2vh, 0.625rem);
    }
}

@media (min-width: 768px) {
    .email-button-group {
        flex-direction: row;
    }
    
    .email-input {
        flex: 1.618;
    }
    
    .notify-btn {
        width: auto;
    }
}

/* =====================================
   MEDIA QUERIES - MEDIUM SCREENS
   ===================================== */
@media (min-width: 900px) and (max-width: 1400px) {
    .container {
        justify-content: center;
        gap: clamp(0.375rem, 1.5vh, 0.625rem);
    }
    
    .logo-and-brand-container {
        flex: 0 0 auto;
        padding: clamp(1rem, 4vh, 1.75rem) clamp(1.25rem, 3.5vw, 2rem) clamp(0.5rem, 2vh, 1rem);
    }
    
    .logo-container {
        width: clamp(4.5rem, 10vw, 5rem);
        height: clamp(4.5rem, 10vw, 5rem);
    }
    
    .brand-name {
        font-size: clamp(3rem, 8vw, 4.25rem);
    }
    
    .brand-engineering {
        font-size: clamp(1.25rem, 3.5vw, 1.875rem);
    }
    
    .content-container {
        flex: 1 1 auto;
        max-height: none;
        gap: 0;
    }
    
    .terminal {
        min-height: clamp(11rem, 34vh, 15rem);
        margin-top: clamp(0.625rem, 2.5vh, 0.75rem);
    }
    
    h1 {
        font-size: clamp(1.25rem, 3.5vw, 1.625rem);
        margin-bottom: clamp(0.5rem, 2vh, 0.625rem);
    }
    
    .notification-form {
        padding: clamp(0.875rem, 3.5vh, 1.25rem);
        margin-top: clamp(0.75rem, 3vh, 1rem);
    }
    
    .form-title {
        font-size: clamp(0.875rem, 2.5vw, 1.0625rem);
    }
}

/* =====================================
   MEDIA QUERIES - LARGE SCREENS
   ===================================== */
@media (min-width: 1200px) {
    .container {
        gap: clamp(0.625rem, 2.5vh, 1rem);
    }
    
    .logo-and-brand-container {
        padding: 1.5rem 2rem 0.75rem 2rem;
    }
    
    .logo-container {
        width: clamp(5rem, 8vw, 5.5rem);
        height: clamp(5rem, 8vw, 5.5rem);
    }
    
    .brand-name {
        font-size: clamp(3.5rem, 7vw, 5rem);
    }
    
    .brand-engineering {
        font-size: clamp(1.5rem, 3vw, 2rem);
        margin-top: clamp(-0.5rem, -1vw, -0.625rem);
    }
    
    .content-container {
        padding: 1.75rem 2.25rem;
        gap: 0;
    }
    
    .terminal {
        min-height: 14rem;
        max-height: none;
        height: auto;
        padding: 1rem 1.25rem;
        font-size: clamp(0.875rem, 1.5vw, 0.9375rem);
        margin-top: 0.75rem;
        margin-bottom: 0;
    }
    
    h1 {
        font-size: clamp(1.5rem, 2.5vw, 1.75rem);
        margin-bottom: clamp(0.625rem, 2vh, 0.875rem);
    }
    
    .notification-form {
        padding: 1.125rem 1.5rem;
        margin-top: 1rem;
    }
    
    .form-title {
        font-size: clamp(1rem, 1.75vw, 1.0625rem);
        margin-bottom: 0.875rem;
    }
    
    .input-group {
        gap: 0.75rem;
    }
    
    .name-input,
    .email-input {
        padding: 0.6875rem 1rem;
        font-size: 0.9375rem;
    }
    
    .notify-btn {
        padding: 0.6875rem 2rem;
        font-size: 1rem;
        min-height: 44px;
    }
}

/* =====================================
   MEDIA QUERIES - LANDSCAPE
   ===================================== */
@media (max-height: 700px) {
    .main-content {
        padding: 0;
    }
    
    .container {
        gap: 0;
    }
    
    .logo-and-brand-container {
        padding: clamp(0.375rem, 1.5vh, 0.625rem) clamp(0.75rem, 2.5vw, 1.25rem) clamp(0.25rem, 1vh, 0.375rem);
        margin-bottom: 0;
    }
    
    .logo-container {
        width: clamp(3.5rem, 12vh, 4.5rem);
        height: clamp(3.5rem, 12vh, 4.5rem);
    }
    
    .brand-name {
        font-size: clamp(2rem, 10vh, 3.5rem);
    }
    
    .brand-engineering {
        font-size: clamp(1rem, 5vh, 1.75rem);
    }
    
    .content-container {
        padding: clamp(0.5rem, 2vh, 1rem) clamp(0.875rem, 3.5vw, 1.5rem);
        gap: 0;
    }
    
    .terminal {
        min-height: clamp(7rem, 33vh, 12rem);
        margin-top: clamp(0.25rem, 1vh, 0.375rem);
        margin-bottom: 0;
        font-size: clamp(0.625rem, 2.5vw, 0.75rem);
        padding: clamp(0.5rem, 2vh, 0.75rem) clamp(0.625rem, 2.5vw, 0.875rem);
    }
    
    h1 {
        margin-bottom: clamp(0.125rem, 0.5vh, 0.25rem);
        font-size: clamp(1rem, 4vh, 1.5rem);
        padding-bottom: 0;
    }
    
    h1::after {
        display: none;
    }
    
    .notification-form {
        padding: clamp(0.5rem, 2vh, 0.75rem);
        margin-top: clamp(0.375rem, 1.5vh, 0.5rem);
    }
    
    .form-title {
        font-size: clamp(0.6875rem, 2.75vh, 1rem);
        margin-bottom: clamp(0.375rem, 1.5vh, 0.5rem);
        padding-top: clamp(0.25rem, 1vh, 0.375rem);
    }
    
    .input-group {
        gap: clamp(0.3125rem, 1.25vh, 0.375rem);
    }
    
    .name-input,
    .email-input {
        padding: clamp(0.4375rem, 1.75vh, 0.5rem) clamp(0.5625rem, 2.25vw, 0.75rem);
        font-size: clamp(0.625rem, 2.5vw, 0.8125rem);
    }
    
    .notify-btn {
        padding: clamp(0.4375rem, 1.75vh, 0.5rem) clamp(1.125rem, 4.5vw, 1.5rem);
        font-size: clamp(0.625rem, 2.5vw, 0.875rem);
        min-height: 36px;
    }
    
    .footer {
        padding: clamp(0.4375rem, 1.75vh, 0.5rem) clamp(0.75rem, 3vw, 1rem);
    }
}

@media (max-height: 600px) {
    .main-content {
        padding: 0;
    }
    
    .logo-and-brand-container {
        padding: 0.25rem 0.75rem 0.125rem 0.75rem;
        margin-bottom: 0;
    }
    
    .logo-container {
        width: clamp(2.75rem, 11vh, 3.25rem);
        height: clamp(2.75rem, 11vh, 3.25rem);
    }
    
    .brand-name {
        font-size: clamp(1.5rem, 9vh, 2.25rem);
    }
    
    .brand-engineering {
        font-size: clamp(0.6875rem, 4vh, 0.875rem);
        margin-top: clamp(-0.1875rem, -1.1vh, -0.25rem);
    }
    
    .content-container {
        padding: 0.375rem 0.625rem;
        gap: 0;
    }
    
    .terminal {
        min-height: clamp(5rem, 38vh, 8rem);
        font-size: clamp(0.5625rem, 2.25vw, 0.625rem);
        margin-top: 0.125rem;
        margin-bottom: 0;
    }
    
    h1 {
        margin-bottom: 0.125rem;
        font-size: clamp(0.75rem, 4vh, 1rem);
        padding-bottom: 0;
    }
    
    .notification-form {
        padding: 0.375rem 0.5rem;
        margin-top: clamp(0.25rem, 1vh, 0.375rem);
    }
    
    .form-title {
        font-size: clamp(0.5625rem, 2.5vh, 0.625rem);
        margin-bottom: 0.25rem;
        padding-top: 0;
    }
    
    .footer {
        padding: 0.4375rem 0.75rem;
    }
}

/* =====================================
   MEDIA QUERIES - MOBILE SPECIFICO
   FORM RIPROPORZIONATO
   ===================================== */
@media (max-width: 414px) {
    .main-content {
        padding: 0;
    }
    
    .container {
        padding: 0 clamp(0.375rem, 1.5vw, 0.625rem);
        gap: 0;
    }
    
    /* Safari iOS specific fixes for iPhone */
    @supports (-webkit-touch-callout: none) {
        .container {
            justify-content: flex-start;
            padding-top: 1rem;
        }
        
        .content-container {
            flex: 1 1 auto;
            min-height: 0;
            max-height: none;
            overflow: visible;
        }
        
        .terminal {
            flex: 0 1 auto;
            overflow: visible;
            min-height: 0;
            height: auto;
        }
        
        .notification-form {
            flex: 0 0 auto;
        }
    }
    
    .logo-and-brand-container {
        padding: clamp(0.25rem, 1vh, 0.375rem) 0 0 0;
        margin-bottom: 0;
    }
    
    .logo-container {
        width: clamp(3rem, 18vw, 4rem);
        height: clamp(3rem, 18vw, 4rem);
    }
    
    .brand-name {
        font-size: clamp(1.875rem, 11.5vw, 2.5rem);
        margin-top: clamp(0.125rem, 0.5vh, 0.25rem);
    }
    
    .brand-engineering {
        font-size: clamp(0.75rem, 5vw, 1.125rem);
        margin-top: clamp(-0.1875rem, -1vw, -0.25rem);
    }
    
    .content-container {
        padding: clamp(0.375rem, 1.5vh, 0.5rem) clamp(0.5rem, 2vw, 0.625rem);
        gap: 0;
        margin-bottom: clamp(0.25rem, 1vh, 0.375rem);
    }
    
    .terminal {
        min-height: clamp(7.5rem, 38vh, 10rem);
        max-height: none;
        padding: clamp(0.375rem, 1.5vh, 0.5rem) clamp(0.4375rem, 1.75vw, 0.5625rem);
        font-size: clamp(0.5625rem, 2.25vw, 0.6875rem);
        margin-top: clamp(0.125rem, 0.5vh, 0.25rem);
        margin-bottom: 0;
        line-height: 1.25;
    }
    
    h1 {
        font-size: clamp(0.75rem, 4vw, 1rem);
        margin-bottom: clamp(0.1875rem, 0.75vh, 0.3125rem);
        padding-bottom: 0;
    }
    
    h1::after {
        display: none;
    }
    
    /* FORM RIPROPORZIONATO PER MOBILE */
    .notification-form {
        padding: clamp(0.3125rem, 1.25vh, 0.4375rem) clamp(0.375rem, 1.5vw, 0.4375rem);
        margin-top: clamp(0.25rem, 1vh, 0.375rem);
    }
    
    .form-title {
        font-size: clamp(0.5rem, 2.5vw, 0.625rem);
        margin-bottom: clamp(0.1875rem, 0.75vh, 0.25rem);
        padding-top: 0;
    }
    
    .form-title::before {
        display: none;
    }
    
    .input-group {
        gap: clamp(0.1875rem, 0.75vh, 0.25rem);
    }
    
    .name-group {
        gap: clamp(0.125rem, 0.5vw, 0.1875rem);
    }
    
    .email-button-group {
        gap: clamp(0.125rem, 0.5vw, 0.1875rem);
    }
    
    .name-input,
    .email-input {
        padding: clamp(0.3125rem, 1.25vh, 0.375rem) clamp(0.375rem, 1.5vw, 0.4375rem);
        font-size: clamp(0.5rem, 2vw, 0.625rem);
        min-height: 34px;
    }
    
    .name-input::placeholder,
    .email-input::placeholder {
        font-size: clamp(0.4375rem, 1.75vw, 0.5625rem);
    }
    
    .notify-btn {
        padding: clamp(0.3125rem, 1.25vh, 0.375rem) clamp(0.625rem, 2.5vw, 0.75rem);
        font-size: clamp(0.5rem, 2vw, 0.625rem);
        min-height: 36px;
    }
    
    .footer {
        padding: clamp(0.375rem, 1.5vh, 0.5rem) clamp(0.5rem, 2vw, 0.625rem);
        font-size: clamp(0.5625rem, 2.25vw, 0.625rem);
        gap: clamp(0.625rem, 2.5vw, 0.875rem);
    }
    
    .social-icon {
        width: clamp(1.375rem, 5.5vw, 1.625rem);
        height: clamp(1.375rem, 5.5vw, 1.625rem);
    }
    
    .social-icon i {
        font-size: clamp(0.75rem, 3vw, 0.875rem);
    }
    
    .footer-links a,
    .copyright {
        font-size: clamp(0.5625rem, 2.25vw, 0.625rem);
    }
}

/* =====================================
   MEDIA QUERIES - ULTRA SMALL
   ===================================== */
@media (max-width: 375px) {
    .container {
        gap: 0;
        padding: 0 clamp(0.25rem, 1vw, 0.375rem);
    }
    
    .logo-and-brand-container {
        padding: clamp(0.1875rem, 0.75vh, 0.25rem) 0 0 0;
        margin-bottom: 0;
    }
    
    .logo-container {
        width: clamp(2.75rem, 17vw, 3.5rem);
        height: clamp(2.75rem, 17vw, 3.5rem);
    }
    
    .brand-name {
        font-size: clamp(1.625rem, 10.5vw, 2.25rem);
        margin-top: clamp(0.0625rem, 0.25vh, 0.125rem);
    }
    
    .brand-engineering {
        font-size: clamp(0.625rem, 4.5vw, 1rem);
        margin-top: clamp(-0.125rem, -0.8vw, -0.1875rem);
    }
    
    .content-container {
        padding: clamp(0.3125rem, 1.25vh, 0.4375rem) clamp(0.375rem, 1.5vw, 0.5rem);
        gap: 0;
        margin-bottom: clamp(0.1875rem, 0.75vh, 0.3125rem);
    }
    
    h1 {
        font-size: clamp(0.625rem, 3.5vw, 0.875rem);
        margin-bottom: clamp(0.125rem, 0.5vh, 0.25rem);
    }
    
    .terminal {
        min-height: clamp(6.5rem, 36vh, 9rem);
        padding: clamp(0.3125rem, 1.25vh, 0.4375rem) clamp(0.375rem, 1.5vw, 0.4375rem);
        margin-top: clamp(0.0625rem, 0.25vh, 0.125rem);
        margin-bottom: 0;
        font-size: clamp(0.5rem, 2vw, 0.625rem);
    }
    
    /* FORM ULTRA RIPROPORZIONATO */
    .notification-form {
        padding: clamp(0.25rem, 1vh, 0.3125rem) clamp(0.3125rem, 1.25vw, 0.375rem);
        margin-top: clamp(0.1875rem, 0.75vh, 0.25rem);
    }
    
    .form-title {
        font-size: clamp(0.4375rem, 2.25vw, 0.5625rem);
        margin-bottom: clamp(0.125rem, 0.5vh, 0.1875rem);
    }
    
    .input-group {
        gap: clamp(0.125rem, 0.5vh, 0.1875rem);
    }
    
    .name-input,
    .email-input {
        padding: clamp(0.25rem, 1vh, 0.3125rem) clamp(0.3125rem, 1.25vw, 0.375rem);
        font-size: clamp(0.4375rem, 1.75vw, 0.5625rem);
        min-height: 32px;
    }
    
    .notify-btn {
        padding: clamp(0.25rem, 1vh, 0.3125rem) clamp(0.5rem, 2vw, 0.625rem);
        font-size: clamp(0.4375rem, 1.75vw, 0.5625rem);
        min-height: 34px;
    }
    
    .footer {
        padding: clamp(0.3125rem, 1.25vh, 0.4375rem) clamp(0.375rem, 1.5vw, 0.5rem);
    }
}

/* =====================================
   MEDIA QUERIES - LANDSCAPE MOBILE
   ===================================== */
@media (max-width: 768px) and (max-height: 500px) {
    .logo-and-brand-container {
        display: none;
    }
    
    .content-container {
        padding: clamp(0.1875rem, 0.75vh, 0.3125rem) clamp(0.375rem, 1.5vw, 0.5rem);
        gap: 0;
    }
    
    h1 {
        font-size: clamp(0.625rem, 3vh, 0.875rem);
        margin-bottom: clamp(0.0625rem, 0.25vh, 0.125rem);
    }
    
    .terminal {
        min-height: clamp(4rem, 38vh, 5.5rem);
        padding: clamp(0.1875rem, 0.75vh, 0.25rem) clamp(0.25rem, 1vw, 0.3125rem);
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .notification-form {
        padding: clamp(0.1875rem, 0.75vh, 0.25rem) clamp(0.25rem, 1vw, 0.3125rem);
        margin-top: clamp(0.1875rem, 0.75vh, 0.25rem);
    }
    
    .footer {
        padding: clamp(0.1875rem, 0.75vh, 0.25rem) clamp(0.375rem, 1.5vw, 0.5rem);
    }
}

/* =====================================
   MEDIA QUERIES - IPHONE SE
   ===================================== */
@media (max-width: 320px) {
    html {
        font-size: 9px;
    }
    
    .container {
        padding: 0 0.25rem;
    }
    
    .logo-container {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .brand-name {
        font-size: 1.375rem;
    }
    
    .brand-engineering {
        font-size: 0.5625rem;
    }
    
    .terminal {
        min-height: clamp(5.5rem, 36vh, 7.5rem);
        font-size: 0.5rem;
    }
    
    /* FORM SUPER COMPATTO */
    .notification-form {
        padding: 0.1875rem 0.25rem;
        margin-top: 0.125rem;
    }
    
    .form-title {
        font-size: 0.4375rem;
        margin-bottom: 0.125rem;
    }
    
    .input-group {
        gap: 0.125rem;
    }
    
    .name-input,
    .email-input {
        padding: 0.1875rem 0.25rem;
        font-size: 0.4375rem;
        min-height: 28px;
    }
    
    .notify-btn {
        padding: 0.1875rem 0.375rem;
        font-size: 0.4375rem;
        min-height: 30px;
    }
}

/* =====================================
   SAFE AREA SUPPORT
   ===================================== */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-left));
        padding-right: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(clamp(0.75rem, 3vh, 1rem), env(safe-area-inset-bottom));
    }
}