/* =========================================================
   SMARTLIST
   Stili base + versione smartphone
   ========================================================= */


/* ---------------------------------------------------------
   1. Variabili
   --------------------------------------------------------- */

:root {
    --color-primary: #1565C0;
    --color-primary-dark: #0D47A1;
    --color-secondary: #607D8B;
    --color-tertiary: #4CAF50;

    --color-background: #F8F9FA;
    --color-surface: #FFFFFF;
    --color-surface-variant: #E9EEF2;

    --color-text: #1C1B1F;
    --color-text-secondary: #45474A;
    --color-outline: #74777A;

    --color-white: #FFFFFF;

    --max-width: 1100px;

    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 24px;

    --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.08);

    --spacing-section: 64px;
}


/* ---------------------------------------------------------
   2. Reset
   --------------------------------------------------------- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--color-background);
    color: var(--color-text);

    line-height: 1.6;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}


/* ---------------------------------------------------------
   3. Struttura generale
   --------------------------------------------------------- */

main {
    overflow: hidden;
}

section {
    width: 100%;
}

.section-inner {
    width: min(100% - 32px, var(--max-width));
    margin-inline: auto;
}

.section-title {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-text {
    color: var(--color-text-secondary);
    max-width: 650px;
}


/* ---------------------------------------------------------
   4. Header
   --------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: var(--color-primary);
}

.header-inner {
    width: min(100% - 32px, var(--max-width));
    min-height: 64px;
    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--color-white);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo img {
    width: 36px;
    height: 36px;

    border-radius: 12px;

    display: block;
    flex-shrink: 0;
}

.site-nav {
    display: none;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    width: 44px;
    height: 44px;

    padding: 8px;

    border: none;
    background: transparent;

    cursor: pointer;
}

.menu-toggle span {
    display: block;

    width: 100%;
    height: 2px;

    background: var(--color-white);
    border-radius: 999px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* Menu mobile */

.site-nav {
    display: flex;
    flex-direction: column;

    position: absolute;
    top: 64px;
    left: 0;
    right: 0;

    padding: 8px 16px 16px;

    background: var(--color-primary);

    /* Stato chiuso */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}


/* Menu aperto */

.site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav a {
    padding: 12px 0;

    color: var(--color-white);
    font-size: 1rem;
}


/* Hamburger → X */

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------
   5. Sezione iniziale
   --------------------------------------------------------- */

#hero {
    padding: 48px 16px 64px;

    background:
        linear-gradient(
            180deg,
            #FFFFFF 0%,
            var(--color-background) 100%
        );
}

.hero-content {
    max-width: 700px;
    margin-inline: auto;

    text-align: center;
}

.hero-title {
    font-size: clamp(2.2rem, 10vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;

    color: var(--color-primary);

    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 600;

    margin-bottom: 12px;
}

.hero-description {
    max-width: 560px;
    margin: 0 auto 28px;

    color: var(--color-text-secondary);
    font-size: 1rem;
}

.hero-image {
    width: 180px;

    margin: 32px auto 0;

    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
}

.hero-image img {
    display: block;
    width: 100%;
    height: auto;
}


/* ---------------------------------------------------------
   6. Pulsanti
   --------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 12px 22px;

    border-radius: 999px;

    font-weight: 600;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.button-primary {
    background: var(--color-primary);
    color: var(--color-white);

    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.25);
}

.button-primary:active {
    transform: scale(0.98);
}


/* ---------------------------------------------------------
   7. Sezioni
   --------------------------------------------------------- */

#about,
#features,
#themes,
#screenshots,
#download {
    padding: var(--spacing-section) 16px;
}

#about {
    background: var(--color-surface);
}

#features {
    background: var(--color-background);
}

#themes {
    background: var(--color-surface);
}

#screenshots {
    background: var(--color-background);
}

#download {
    background: var(--color-primary);
    color: var(--color-white);
}


/* ---------------------------------------------------------
   8. Testata delle sezioni
   --------------------------------------------------------- */

.section-heading {
    margin-bottom: 32px;
}

.section-heading p {
    color: var(--color-text-secondary);
}


/* ---------------------------------------------------------
   9. Card funzionalità
   --------------------------------------------------------- */

.features-grid {
    display: grid;
    gap: 16px;
}

.feature-card {
    padding: 24px;

    background: var(--color-surface);

    border: 1px solid var(--color-surface-variant);
    border-radius: var(--radius-medium);

    box-shadow: var(--shadow-soft);
}

.feature-card h3 {
    margin-bottom: 8px;

    font-size: 1.15rem;
}

.feature-card p {
    color: var(--color-text-secondary);
}


/* ---------------------------------------------------------
   10. Temi
   --------------------------------------------------------- */

.themes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
}

.theme-card {
    padding: 20px;

    border-radius: var(--radius-medium);

    border: 1px solid var(--color-surface-variant);
    background: var(--color-surface);

    box-shadow: var(--shadow-soft);
}

.theme-preview {
    width: 100%;
    aspect-ratio: 2 / 3;

    margin-bottom: 16px;

    border-radius: var(--radius-small);

    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.theme-card h3 {
    margin-bottom: 4px;
}

.theme-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}


/* ---------------------------------------------------------
   11. Screenshot
   --------------------------------------------------------- */

.screenshots-grid {
    display: flex;
    gap: 20px;

    overflow-x: auto;

    padding: 4px 16px 16px;

    scroll-snap-type: x mandatory;

    scrollbar-width: none;
}

.screenshots-grid::-webkit-scrollbar {
    display: none;
}

.screenshot-card {
    flex: 0 0 180px;

    overflow: hidden;

    background: var(--color-surface);

    border-radius: var(--radius-large);

    box-shadow: var(--shadow-soft);

    scroll-snap-align: start;
}

.screenshot-card img {
    display: block;
    width: 100%;
    height: auto;
}


/* ---------------------------------------------------------
   12. Download
   --------------------------------------------------------- */

.download-content {
    text-align: center;
}

.download-content h2 {
    margin-bottom: 12px;

    font-size: 1.8rem;
}

.download-content p {
    max-width: 560px;
    margin: 0 auto 24px;

    color: rgba(255, 255, 255, 0.9);
}

.download-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.google-play-badge {
    display: block;
    width: 180px;
}

.download-qr img {
    width: 150px;

    padding: 8px;
    margin: auto;

    background: var(--color-white);
    border-radius: var(--radius-small);
}


/* ---------------------------------------------------------
   13. Footer
   --------------------------------------------------------- */

.site-footer {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.footer-inner {
    width: min(100% - 32px, var(--max-width));

    margin-inline: auto;
    padding: 40px 0 24px;
}

.footer-brand {
    margin-bottom: 28px;
}

.footer-brand .logo {
    color: var(--color-white);
}

.footer-brand p {
    margin-top: 6px;

    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin-bottom: 32px;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.footer-nav a:hover {
    color: var(--color-white);
}

.footer-bottom {
    padding-top: 20px;

    border-top: 1px solid rgba(255, 255, 255, 0.2);

    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}


/* ---------------------------------------------------------
   14. Accessibilità / riduzione animazioni
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ---------------------------------------------------------
   15. Desktop
   --------------------------------------------------------- */

@media (min-width: 768px) {

    /* -----------------------------------------------------
       Header
       ----------------------------------------------------- */

    .header-inner {
        min-height: 72px;
    }

    .menu-toggle {
        display: none;
    }

    .site-nav {
        position: static;

        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 28px;

        padding: 0;

        opacity: 1;
        visibility: visible;
        transform: none;

        background: transparent;
    }

    .site-nav a {
        padding: 0;

        color: var(--color-white);
        font-size: 0.95rem;
        font-weight: 500;

        transition: opacity 0.2s ease;
    }

    .site-nav a:hover {
        opacity: 0.75;
    }


    /* -----------------------------------------------------
       Hero
       ----------------------------------------------------- */

    #hero {
        min-height: 620px;
        padding: 80px 32px;

        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 48px;
    }

    .hero-content {
        max-width: 600px;
        margin: 0 auto;

        text-align: left;
    }

    .hero-image {
        width: 280px;
        margin: 0 auto;
    }

    .hero-brand {
        margin-bottom: 8px;

        color: var(--color-secondary);
        font-size: 1rem;
        font-weight: 600;
    }

    .hero-content h1 {
        margin-bottom: 16px;

        font-size: clamp(3rem, 5vw, 4.5rem);
        line-height: 1.05;
        letter-spacing: -0.04em;

        color: var(--color-primary);
    }

    .hero-description {
        margin: 0 0 28px;

        font-size: 1.1rem;
    }


    /* -----------------------------------------------------
       Sezioni
       ----------------------------------------------------- */

    #about,
    #features,
    #themes,
    #screenshots,
    #download {
        padding: 96px 32px;
    }

    .section-heading {
        width: min(100%, 700px);
        margin: 0 auto 48px;

        text-align: center;
    }

    .section-label {
        margin-bottom: 6px;

        color: var(--color-primary);
        font-size: 0.9rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .section-heading h2 {
        margin-bottom: 12px;

        font-size: 2.4rem;
        line-height: 1.2;
        letter-spacing: -0.03em;
    }

    .section-heading > p:last-child {
        color: var(--color-text-secondary);
    }


    /* -----------------------------------------------------
       About
       ----------------------------------------------------- */

    .section-about .section-heading {
        max-width: 700px;
    }


    /* -----------------------------------------------------
       Features
       ----------------------------------------------------- */

    .features-grid {
        width: min(100%, var(--max-width));
        margin-inline: auto;

        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
    }

    .feature-card:nth-child(1) {
        grid-column: span 2;
    }

    .feature-card:nth-child(2) {
        grid-column: span 2;
    }

    .feature-card:nth-child(3) {
        grid-column: span 2;
    }

    .feature-card:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .feature-card:nth-child(5) {
        grid-column: 4 / span 2;
    }

    .feature-card {
        padding: 28px;
    }


    /* -----------------------------------------------------
       Themes
       ----------------------------------------------------- */

    .themes-grid {
        width: min(100%, var(--max-width));
        margin-inline: auto;

        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }


    /* -----------------------------------------------------
       Screenshots
       ----------------------------------------------------- */

    .screenshots-grid {
        width: min(100%, var(--max-width));
        margin-inline: auto;

        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;

        overflow: visible;

        padding: 0;

        scroll-snap-type: none;
    }

    .screenshot-card {
        width: 100%;
        margin: 0;
    }


    /* -----------------------------------------------------
       Download
       ----------------------------------------------------- */

    #download {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 180px;
        align-items: center;
        gap: 80px;

        padding-inline: max(
            32px,
            calc((100% - var(--max-width)) / 2)
        );
    }

    .download-content {
        text-align: left;
    }

    .download-content h2 {
        font-size: 2.4rem;
    }

    .download-content p {
        margin-left: 0;
        margin-right: 0;
    }

    .download-qr {
        text-align: center;
    }


    /* -----------------------------------------------------
       Footer
       ----------------------------------------------------- */

    .footer-inner {
        padding: 48px 0 24px;

        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 80px;
        align-items: start;
    }

    .footer-brand {
        margin-bottom: 0;
    }

    .footer-nav {
        display: grid;
        grid-template-columns: repeat(2, auto);
        gap: 10px 32px;

        margin-bottom: 0;
    }

    .footer-bottom {
        grid-column: 1 / -1;

        margin-top: 32px;
    }

}

/* ========================================
   Legal pages
   ======================================== */

.legal-page {
    padding: 56px 20px 72px;
}

.legal-header {
    width: min(100%, 700px);
    margin: 0 auto 48px;
    text-align: center;
}

.legal-header h1 {
    margin-bottom: 12px;
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.legal-updated {
    margin-bottom: 24px;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.legal-intro {
    margin: 0 auto;
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.legal-content {
    width: min(100%, 760px);
    margin: 0 auto;
}

.legal-section {
    margin-bottom: 40px;
}

.legal-section:last-child {
    margin-bottom: 0;
}

.legal-section h2 {
    margin-bottom: 16px;
    color: var(--color-text);
    font-size: 1.45rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.legal-section h3 {
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 1.1rem;
    line-height: 1.4;
}

.legal-section p {
    margin-bottom: 16px;
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.75;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    margin: 0 0 16px;
    padding-left: 22px;
    color: var(--color-text-secondary);
}

.legal-section li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.legal-section a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-section a:hover {
    color: var(--color-primary-dark);
}


/* ========================================
   Legal pages - desktop
   ======================================== */

@media (min-width: 768px) {

    .legal-page {
        padding: 88px 32px 104px;
    }

    .legal-header {
        margin-bottom: 64px;
    }

    .legal-header h1 {
        font-size: 2.6rem;
    }

    .legal-intro {
        font-size: 1.05rem;
    }

    .legal-section {
        margin-bottom: 52px;
    }

    .legal-section h2 {
        font-size: 1.6rem;
    }

    .legal-section h3 {
        font-size: 1.15rem;
    }

    .legal-section p,
    .legal-section li {
        font-size: 1rem;
        line-height: 1.8;
    }
}