/* ══════════════════════════════════════════════
   Avanzō — Shared Design Tokens & Base Styles
   ══════════════════════════════════════════════ */

:root {
    --primary-green: #5E8C61;
    --dark-green: #3A6B3E;
    --light-green: #8BBF8A;
    --cream: #F7F2EA;
    --warm-white: #FCF9F4;
    --warm-beige: #EDE8DF;
    --orange: #E8863A;
    --dark-orange: #D06A1E;
    --text-dark: #1E1E1E;
    --text-medium: #4A4A4A;
    --text-light: #8A8A8A;
    --divider: #E8E4DC;
    --error-red: #E04848;
    --sunset-orange: #FF8B42;
    --sunset-coral: #FF6B6B;
    --sunset-gold: #FFB347;
    --sunset-deep: #E85D3A;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--warm-white);
    color: var(--text-medium);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ── Navigation ──────────────────────────────── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    transition: background .3s, box-shadow .3s;
}

.site-nav.scrolled {
    background: rgba(250, 247, 242, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-dark);
    letter-spacing: -.3px;
}

.nav-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(58,107,62,.15);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    text-decoration: none;
    transition: color .2s;
}

.nav-links a:hover { color: var(--primary-green); }

.nav-links .nav-cta {
    background: var(--primary-green);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    transition: background .2s, transform .15s;
}

.nav-links .nav-cta:hover {
    background: var(--dark-green);
    transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────── */
.footer {
    text-align: center;
    padding: 48px 24px;
    background: var(--cream);
    border-top: 1px solid var(--divider);
}

.footer-logo {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.footer p {
    font-size: 14px;
    color: var(--text-light);
}

.footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-green);
    text-decoration: none;
    transition: color .2s;
}

.footer-links a:hover { color: var(--dark-green); }

/* ── Shared Hero Base ────────────────────────── */
.hero {
    background: linear-gradient(165deg, var(--cream) 0%, var(--warm-white) 50%, var(--warm-beige) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(94,140,97,.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(232,134,58,.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.app-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(58,107,62,.2);
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(28px, 5vw, 38px);
    color: var(--text-dark);
    font-weight: 400;
    letter-spacing: -.5px;
    margin-bottom: 8px;
}

.hero h1 span { color: var(--primary-green); }

.hero .subtitle {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
}

/* ── Social & Reviews ────────────────────────── */
.footer-social {
    margin: 20px 0 8px;
    display: flex;
    justify-content: center;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(94, 140, 97, 0.1);
    color: var(--primary-green);
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background: var(--primary-green);
    color: #fff;
    transform: translateY(-2px);
}

.review-prompt {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.review-text {
    font-size: 14px !important;
    font-weight: 600;
    color: var(--text-medium) !important;
    margin-bottom: 0 !important;
}

.btn-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1.5px solid var(--divider);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.btn-review:hover {
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(58,107,62,0.08);
}

.btn-review .stars {
    color: var(--sunset-gold);
    letter-spacing: 1px;
}

/* ── Mobile Navigation ───────────────────────── */
.nav-hamburger {
    display: none; /* mobile: mostrato via media query */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    -webkit-tap-highlight-color: transparent;
    z-index: 110;
    position: relative;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
}

.nav-hamburger span + span { margin-top: 6px; }

/* mobile: hamburger → X animation */
.nav-hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* mobile: overlay menu */
.nav-overlay {
    display: none; /* attivato solo in mobile */
}

/* ── Accessibility: Reduced Motion ──────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Mobile Nav Breakpoint ──────────────────── */
@media (max-width: 768px) {
    /* mobile: hamburger visibile, link nascosti */
    .nav-hamburger { display: flex; flex-direction: column; gap: 0; }
    .nav-links { display: none; }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 99;
        background: rgba(252, 249, 244, .97);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        /* mobile: safe area per notch iPhone */
        padding: env(safe-area-inset-top, 20px) 24px env(safe-area-inset-bottom, 20px);
    }

    .nav-overlay.open {
        display: flex;
        animation: fadeIn .25s ease;
    }

    .nav-overlay a {
        font-family: 'DM Serif Display', Georgia, serif;
        font-size: 28px;
        color: var(--text-dark);
        text-decoration: none;
        padding: 16px 24px;
        /* mobile: tap target minimo 44×44 */
        min-height: 56px;
        display: flex;
        align-items: center;
        transition: color .2s;
    }

    .nav-overlay a:active { color: var(--primary-green); }

    .nav-overlay .nav-cta-mobile {
        margin-top: 24px;
        background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
        color: #fff !important;
        font-family: 'DM Sans', sans-serif;
        font-size: 16px;
        font-weight: 700;
        padding: 16px 40px;
        border-radius: var(--radius-lg);
        min-height: 52px;
        justify-content: center;
    }

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

    /* mobile: safe area per il body */
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* mobile: footer safe area */
    .footer {
        padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    }

    /* mobile: footer link tap target ≥ 44px */
    .footer-links {
        gap: 8px;
    }

    .footer-links a {
        padding: 10px 16px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
