/* CSS Variables - Color Palette + Material Design 3 */
:root {
    --color-primary: #1E40AF;
    --color-accent: #DC2626;
    --color-background: #F8FAFC;
    --color-text: #0F172A;
    --color-white: #FFFFFF;
    --color-gray-light: #E2E8F0;
    --color-gray: #718096;
    /* MD3 */
    --md3-radius-card: 16px;
    --md3-radius-button: 20px;
    --md3-radius-dialog: 28px;
    --md3-spacing: 16px;
    --md3-spacing-section: 24px;
    --md3-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.08);
    --md3-elevation-2: 0 2px 6px rgba(0, 0, 0, 0.1);
    --md3-elevation-3: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Font Face Declarations */
@font-face {
    font-family: 'Oswald';
    src: url('/fonts/oswald-400.woff2') format('woff2'),
         url('/fonts/oswald-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oswald';
    src: url('/fonts/oswald-600.woff2') format('woff2'),
         url('/fonts/oswald-600.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oswald';
    src: url('/fonts/oswald-700.woff2') format('woff2'),
         url('/fonts/oswald-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('/fonts/roboto-400.woff2') format('woff2'),
         url('/fonts/roboto-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('/fonts/roboto-500.woff2') format('woff2'),
         url('/fonts/roboto-500.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('/fonts/roboto-700.woff2') format('woff2'),
         url('/fonts/roboto-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* Container - MD3 spacing */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--md3-spacing);
}

/* Hero Section - MD3 */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1E3A8A 100%);
    color: var(--color-white);
    padding: var(--md3-spacing-section) var(--md3-spacing) 2rem;
    text-align: center;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.hero-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.hero-icon {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--color-white);
    box-shadow: var(--md3-elevation-3);
    object-fit: cover;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--color-white);
    white-space: nowrap;
}

.hero-subtitle {
    font-size: 1rem;
    margin: 0 auto 1.5rem auto;
    max-width: 600px;
    opacity: 0.95;
    text-align: center;
}

/* MD3: кнопки — min-height 40px, border-radius 20px */
.cta-button {
    display: inline-block;
    padding: 12px 24px;
    min-height: 40px;
    background-color: var(--color-accent);
    color: var(--color-white);
    text-decoration: none;
    border: none;
    border-radius: var(--md3-radius-button);
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 0.5rem;
    cursor: pointer;
    box-sizing: border-box;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--md3-elevation-3);
}

.install-button {
    display: none;
    padding: 12px 24px;
    min-height: 40px;
    background-color: transparent;
    border: 2px solid var(--color-white);
    color: var(--color-white);
    border-radius: var(--md3-radius-button);
}

.install-button.show {
    display: inline-block;
}

/* Section Styles - MD3 */
.section {
    padding: 48px var(--md3-spacing);
}

.section-title {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: var(--md3-spacing-section);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md3-spacing-section);
    max-width: 1000px;
    margin: 0 auto;
}

/* MD3: карточки — radius 16px, отступы 16/24px */
.feature-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-white);
    padding: var(--md3-spacing-section);
    border-radius: var(--md3-radius-card);
    box-shadow: var(--md3-elevation-1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--md3-elevation-3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--color-gray);
    line-height: 1.8;
}

/* Screenshot Component — выравнивание по центру внутри колонки */
.screenshot-component {
    margin-top: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.feature-card .screenshot-component {
    align-self: center;
}

.screenshot-thumbnail {
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: var(--md3-elevation-2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
    flex: 0 0 auto;
}

.screenshot-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: var(--md3-elevation-3);
}

/* Настраиваемое масштабирование через data-scale */
.screenshot-component[data-scale="50"] .screenshot-thumbnail {
    width: 50% !important;
}

.screenshot-component[data-scale="60"] .screenshot-thumbnail {
    width: 60%;
}

.screenshot-component[data-scale="70"] .screenshot-thumbnail {
    width: 70%;
}

.screenshot-component[data-scale="80"] .screenshot-thumbnail {
    width: 80%;
}

.screenshot-component[data-scale="90"] .screenshot-thumbnail {
    width: 90%;
}

.screenshot-component[data-scale="100"] .screenshot-thumbnail {
    width: 100%;
}

/* Screenshot Modal */
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screenshot-modal.is-open {
    display: flex !important;
}

.screenshot-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    z-index: 1;
}

.screenshot-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    z-index: 2;
    pointer-events: none;
}

.screenshot-modal-content img,
.screenshot-modal-content p,
.screenshot-modal-close {
    pointer-events: auto;
}

.screenshot-modal-content img {
    margin: 0 auto;
    display: block;
}

/* MD3: кнопка закрытия как FAB */
.screenshot-modal-close {
    position: absolute;
    top: var(--md3-spacing);
    right: var(--md3-spacing);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: var(--md3-elevation-2);
}

.screenshot-modal-close:hover {
    background: var(--color-white);
    box-shadow: var(--md3-elevation-3);
}

#screenshot-modal-image {
    max-width: 90%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: var(--md3-radius-dialog);
    box-shadow: var(--md3-elevation-3);
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

#screenshot-modal-caption {
    margin-top: 1rem;
    color: var(--color-white);
    font-size: 1.1rem;
    text-align: center;
    max-width: 600px;
}

/* How It Works - MD3 */
.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--md3-spacing-section);
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: var(--md3-spacing-section);
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.step-content h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--color-gray);
}

/* Screenshots */
.screenshots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.screenshot-item {
    text-align: center;
}

.screenshot-item img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: var(--md3-radius-card);
    box-shadow: var(--md3-elevation-2);
    margin-bottom: 1rem;
}

.screenshot-caption {
    font-weight: 500;
    color: var(--color-text);
}

/* Installation Instructions - MD3 */
.installation {
    background: var(--color-white);
    padding: var(--md3-spacing-section);
    border-radius: var(--md3-radius-card);
    margin-bottom: 2rem;
    box-shadow: var(--md3-elevation-1);
}

.installation-platform {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.platform-icon {
    font-size: 2rem;
}

.installation-steps {
    list-style: none;
    padding-left: 0;
}

.installation-steps li {
    padding: 0.5rem 0;
    color: var(--color-gray);
}

.installation-steps li::before {
    content: "→ ";
    color: var(--color-primary);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Footer - MD3 spacing */
.footer {
    background: var(--color-text);
    color: var(--color-white);
    padding: var(--md3-spacing-section) var(--md3-spacing);
    text-align: center;
}

.footer-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.footer-icon {
    width: 100px;
    height: 100px;
    opacity: 0.9;
    object-fit: contain;
}

.footer-icon-left {
    transform: scaleX(-1);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-text {
    margin-top: 2rem;
    opacity: 0.8;
    font-size: 1.2rem;
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero-logo {
        font-size: 2rem;
    }
    
    .app-icon {
        width: 100px;
        height: 100px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .cta-button {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .app-icon {
        width: 150px;
        height: 150px;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .screenshots {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 var(--md3-spacing-section);
    }
    
    .section {
        padding: 64px var(--md3-spacing-section);
    }
    
    .hero {
        padding: var(--md3-spacing-section) var(--md3-spacing-section) 3rem;
    }
    
    .hero-logo {
        font-size: 3rem;
    }
    
    .app-icon {
        width: 180px;
        height: 180px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .screenshots {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}
