/* ============================================
   1. CSS Custom Properties
   ============================================ */
:root {
    --color-primary: #8C705F;
    --color-primary-hover: #7A6050;
    --color-gradient-start: #8C705F;
    --color-gradient-end: #7F9C96;
    --color-bg: #F5F2EB;
    --color-bg-white: #FFFFFF;
    --color-text: #2C2926;
    --color-text-secondary: #85817C;
    --color-text-light: #FFFFFF;
    --color-text-on-gradient: rgba(255, 255, 255, 0.85);
    --color-accent: #7F9C96;
    --color-tertiary: #5D89D8;
    --color-border: #E6E2D8;
    --color-footer-bg: #2C2926;
    --color-footer-text: rgba(255, 255, 255, 0.6);
    --color-footer-text-hover: #FFFFFF;
    --color-store-badge-bg: #000000;
    --color-store-badge-text: #FFFFFF;
    --color-focus: #5D89D8;
    --nav-height: 64px;
    --container-max: 1120px;
    --section-padding: 5rem 0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #A68B7C;
        --color-primary-hover: #B89A8B;
        --color-gradient-start: #A68B7C;
        --color-gradient-end: #5E736F;
        --color-bg: #1A1817;
        --color-bg-white: #2C2926;
        --color-text: #E6E2D8;
        --color-text-secondary: #9B9790;
        --color-text-light: #E6E2D8;
        --color-text-on-gradient: rgba(255, 255, 255, 0.85);
        --color-accent: #5E736F;
        --color-tertiary: #8AB4F8;
        --color-border: #45423E;
        --color-footer-bg: #1A1817;
        --color-footer-text: rgba(255, 255, 255, 0.5);
        --color-footer-text-hover: #E6E2D8;
        --color-store-badge-bg: #2C2926;
        --color-store-badge-text: #E6E2D8;
        --color-focus: #8AB4F8;
    }
}

/* ============================================
   2. Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* ============================================
   3. Typography
   ============================================ */
h1, h2, h3 {
    line-height: 1.2;
    font-weight: 700;
}

.section__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-text);
}

.section__title--light {
    color: var(--color-text-light);
}

/* ============================================
   4. Layout
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    border: none;
}

.btn--primary {
    background: var(--color-bg-white);
    color: var(--color-primary);
}

.btn--primary:hover {
    transform: scale(1.05);
    background: var(--color-bg);
}

/* ============================================
   5. Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
    background: var(--color-bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--color-border);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav__logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-light);
    transition: color 0.3s;
}

.nav.scrolled .nav__logo {
    color: var(--color-primary);
}

.nav__links {
    display: flex;
    gap: 2rem;
}

.nav__links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-on-gradient);
    transition: color 0.2s;
}

.nav__links a:hover {
    color: var(--color-text-light);
}

.nav.scrolled .nav__links a {
    color: var(--color-text-secondary);
}

.nav.scrolled .nav__links a:hover {
    color: var(--color-primary);
}

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-light);
    transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
}

.nav.scrolled .nav__toggle span {
    background: var(--color-text);
}

@media (prefers-color-scheme: dark) {
    .nav__logo {
        color: var(--color-text);
    }

    .nav__links a {
        color: var(--color-text-secondary);
    }

    .nav__links a:hover {
        color: var(--color-text);
    }

    .nav__toggle span {
        background: var(--color-text);
    }
}

/* ============================================
   6. Hero
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    padding-top: var(--nav-height);
    scroll-margin-top: 0;
}

.hero__content {
    text-align: center;
    padding: 3rem 0;
}

.hero__logo {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    border-radius: 1.25rem;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.hero__tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--color-text-on-gradient);
    margin-bottom: 2rem;
}

/* ============================================
   7. Features
   ============================================ */
.features {
    padding: var(--section-padding);
    background: var(--color-bg);
    scroll-margin-top: var(--nav-height);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.feature-card__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--color-primary);
}

.feature-card__icon svg {
    width: 100%;
    height: 100%;
}

.feature-card__title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.feature-card__text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ============================================
   8. Screenshots
   ============================================ */
.screenshots {
    padding: var(--section-padding);
    background: var(--color-bg-white);
    scroll-margin-top: var(--nav-height);
    overflow: hidden;
}

.screenshots__row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1rem 0;
}

.screenshots__row::-webkit-scrollbar {
    display: none;
}

.screenshots__item {
    flex: 0 0 auto;
    width: 220px;
    scroll-snap-align: center;
}

.screenshots__item:first-child {
    transform: rotate(-3deg);
}

.screenshots__item:last-child {
    transform: rotate(3deg);
}

.screenshots__item img {
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   9. Download CTA
   ============================================ */
.download {
    padding: var(--section-padding);
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    scroll-margin-top: var(--nav-height);
}

.download__content {
    text-align: center;
}

.download__text {
    color: var(--color-text-on-gradient);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.download__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-store-badge-bg);
    color: var(--color-store-badge-text);
    border-radius: 0.75rem;
    transition: transform 0.2s;
    min-width: 200px;
}

.store-badge:hover {
    transform: scale(1.05);
}

.store-badge--disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.store-badge__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.store-badge__text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.store-badge__label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.store-badge__store {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.2;
}

/* ============================================
   9b. Content Page (Privacy, Contact)
   ============================================ */
.page {
    padding: 0 0 5rem;
    background: var(--color-bg);
}

.page__header {
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    padding: calc(var(--nav-height) + 3rem) 0 3rem;
    text-align: center;
}

.page__title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.page__subtitle {
    color: var(--color-text-on-gradient);
    font-size: 1rem;
}

.page__body {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 0;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.7;
}

.page__body h2 {
    font-size: 1.35rem;
    margin: 2.25rem 0 0.75rem;
    color: var(--color-text);
}

.page__body h2:first-child {
    margin-top: 0;
}

.page__body p,
.page__body ul {
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.page__body ul {
    padding-left: 1.25rem;
    list-style: disc;
}

.page__body li {
    margin-bottom: 0.4rem;
}

.page__body a {
    color: var(--color-primary);
    text-decoration: underline;
}

.page__body a:hover {
    color: var(--color-primary-hover);
}

.contact-form {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.form-field__required {
    color: var(--color-primary);
}

.form-field input,
.form-field textarea {
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(140, 112, 95, 0.18);
}

.form-field textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.contact-form__submit {
    align-self: flex-start;
    background: var(--color-primary);
    color: var(--color-text-light);
}

.contact-form__submit:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: scale(1.02);
}

.contact-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contact-form__status {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    min-height: 1.2em;
    margin: 0;
}

.contact-form__status--success {
    color: var(--color-accent);
    font-weight: 600;
}

.contact-form__status--error {
    color: #C0392B;
    font-weight: 600;
}

/* ============================================
   10. Footer
   ============================================ */
.footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer__links {
    display: flex;
    gap: 1.5rem;
}

.footer__links a {
    color: var(--color-footer-text);
    transition: color 0.2s;
}

.footer__links a:hover {
    color: var(--color-footer-text-hover);
}

/* ============================================
   11. Animations
   ============================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

.screenshots__item:first-child[data-animate].visible {
    transform: rotate(-3deg);
}

.screenshots__item:last-child[data-animate].visible {
    transform: rotate(3deg);
}

.hero [data-animate]:nth-child(1) { transition-delay: 0s; }
.hero [data-animate]:nth-child(2) { transition-delay: 0.15s; }
.hero [data-animate]:nth-child(3) { transition-delay: 0.3s; }
.hero [data-animate]:nth-child(4) { transition-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .screenshots__item:first-child {
        transform: rotate(-3deg);
    }

    .screenshots__item:last-child {
        transform: rotate(3deg);
    }

    html {
        scroll-behavior: auto;
    }

    .btn,
    .store-badge,
    .feature-card,
    .nav {
        transition: none;
    }
}

/* ============================================
   12. Media Queries
   ============================================ */
@media (max-width: 768px) {
    .nav__toggle {
        display: flex;
    }

    .nav__links {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--color-bg-white);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav__links a,
    .nav.scrolled .nav__links a {
        color: var(--color-text);
    }

    .nav__links a:hover,
    .nav.scrolled .nav__links a:hover {
        color: var(--color-primary);
    }

    .nav.nav-open .nav__links {
        max-height: 500px;
        padding: 1rem 0;
    }

    .nav__links li {
        text-align: center;
        padding: 0.5rem 1.5rem;
    }

    .nav__toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav__toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav__toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .screenshots__item {
        width: 200px;
    }

    .footer__inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .screenshots__item {
        width: 250px;
    }
}

@media (min-width: 1024px) {
    .screenshots__item {
        width: 280px;
    }
}
