:root {
    --bg-color: #0A0A0A;
    --surface-color: #141414;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --accent-color: #2A85FF;
    --accent-hover: #1A75FF;
    --border-color: rgba(255, 255, 255, 0.1);
    --btn-secondary-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-hover: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.landing-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh; /* Fallback для iOS <15.4 и Android <108 */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: max(clamp(20px, 3vh, 32px), env(safe-area-inset-top));
    padding-bottom: max(clamp(20px, 3vh, 32px), env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    position: relative;
    background: radial-gradient(circle at top, rgba(42, 133, 255, 0.08) 0%, transparent 40%);
    justify-content: space-between;
}

/* Logo Area */
.logo-area {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: clamp(16px, 3vh, 32px);
    animation: fadeIn 0.8s ease-out;
}

.logo-icon {
    display: flex;
    align-items: center;
    filter: drop-shadow(0 6px 16px rgba(42, 133, 255, 0.35));
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
}

.brand-name span {
    background: linear-gradient(180deg, #FFFFFF 0%, #C8D8F0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px rgba(42, 133, 255, 0.7);
    transform: rotate(45deg);
    display: inline-block;
}

/* Slider */
.slider-container {
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 16/9; /* Adjusted for 16:9 images */
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 14px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: var(--surface-color);
}

/* Bottom vignette — makes any text on photos more legible without covering them */
.slider-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 35%);
    z-index: 2;
}

/* Fallback для aspect-ratio (iOS <15, Android <88): padding-top hack держит 16:9 */
@supports not (aspect-ratio: 1) {
    .slider-container {
        height: 0;
        padding-top: 56.25%;
    }
    .slider {
        position: absolute;
        inset: 0;
    }
}

.slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 4s linear;
    transform: scale(1.05);
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

/* Slider Indicators — under the image so text on photos is never covered */
.slider-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: -10px;
    margin-bottom: clamp(14px, 2.5vh, 26px);
    padding: 0 4px;
}

.indicator {
    flex: 1 1 0;
    max-width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    transition: background 0.3s ease;
}

.indicator-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), #5BA8FF);
    border-radius: 2px;
}

.indicator.active {
    background: rgba(255, 255, 255, 0.22);
}

.indicator.active .indicator-fill {
    transition: width 3s linear;
    width: 100%;
}

/* Focus & reduced motion */
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .slide {
        transform: none !important;
    }
}

/* Text Content */
.text-content {
    text-align: center;
    margin-bottom: clamp(16px, 3vh, 32px);
    animation: slideUp 0.6s ease-out 0.2s both;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-title {
    font-size: clamp(24px, 5vh, 30px);
    font-weight: 700;
    margin-bottom: clamp(10px, 2vh, 16px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.main-title .accent {
    background: linear-gradient(90deg, #3B95FF 0%, #7BBBFF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features {
    font-family: 'SFMono-Regular', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.02em;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: clamp(10px, 2vh, 16px);
    text-transform: uppercase;
    opacity: 0.85;
}

.features > span {
    white-space: nowrap; /* не рвём фразы на перенос строки */
}

.description {
    font-size: clamp(13px, 2vh, 14px);
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 34ch;
    margin-inline: auto;
}

/* Actions */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: clamp(16px, 3vh, 32px);
    animation: slideUp 0.6s ease-out 0.4s both;
}

.btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: clamp(14px, 2.5vh, 16px) 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(180deg, #3B95FF 0%, #2378E8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(42, 133, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: btnShimmer 8s ease-in-out infinite;
    animation-delay: 2s;
    pointer-events: none;
    z-index: 1;
}

@keyframes btnShimmer {
    0%, 80% { left: -60%; }
    95%, 100% { left: 160%; }
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.btn-primary:hover, .btn-primary:active {
    background: linear-gradient(180deg, #4FA1FF 0%, #1A75FF 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(42, 133, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover, .btn-secondary:active {
    background: var(--btn-secondary-hover);
    transform: translateY(-2px);
}

/* Footer — compressed to a single line */
.footer {
    flex-shrink: 0;
    margin-top: auto;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: clamp(14px, 2.5vh, 20px);
    animation: fadeIn 0.6s ease-out 0.6s both;
}

.legal-line {
    font-size: 10px;
    color: #555;
    line-height: 1.5;
    letter-spacing: 0.02em;
    padding: 0 4px;
}

/* Small phones — iPhone SE 1st gen and below (<360px) */
@media (max-width: 359px) {
    .landing-container {
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }
    .brand-name {
        font-size: 17px;
        letter-spacing: 3px;
        gap: 8px;
    }
    .logo-icon svg {
        width: 36px;
        height: 36px;
    }
    .main-title {
        font-size: 22px;
    }
    .features {
        font-size: 10px;
    }
    .btn {
        font-size: 14px;
        padding: 13px 18px;
    }
    .legal-line {
        font-size: 9px;
    }
}

/* Landscape phone — low height, need compact layout */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
    .landing-container {
        min-height: 0;
        padding-top: 16px;
        padding-bottom: 16px;
    }
    .logo-area { margin-bottom: 12px; }
    .slider-container { margin-bottom: 10px; }
    .slider-indicators { margin-bottom: 12px; }
    .text-content { margin-bottom: 14px; }
    .description { display: none; } /* только самое важное в альбоме */
}

/* Hover effects for mobile */
@media (hover: none) {
    .btn-primary:hover, .btn-secondary:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Fallback для flex gap (iOS <14.5): используем margin между соседями */
@supports not (gap: 10px) {
    .logo-area { gap: 0; }
    .logo-area > * + * { margin-left: 12px; }

    .brand-name { gap: 0; }
    .brand-name > * + * { margin-left: 10px; }

    .slider-indicators { gap: 0; }
    .indicator + .indicator { margin-left: 6px; }

    .action-buttons { gap: 0; }
    .btn + .btn { margin-top: 10px; }

    .btn { gap: 0; }
    .btn-icon { margin-right: 10px; }
}

/* Desktop Version Layout */
@media (min-width: 768px) {
    body {
        align-items: center; /* Center horizontally and vertically */
    }
    
    .landing-container {
        max-width: 1000px; /* Wider for more premium feel */
        height: auto;
        min-height: 520px;
        padding: 48px;
        border-radius: 24px;
        background: radial-gradient(circle at top right, rgba(42, 133, 255, 0.06) 0%, #0d0d0d 60%);
        box-shadow: 0 40px 80px rgba(0,0,0,0.7); /* Deeper shadow */
        border: 1px solid rgba(255, 255, 255, 0.05);
        display: grid;
        grid-template-columns: 1.5fr 1fr; /* Image gets slightly more focus */
        grid-template-rows: auto auto auto auto; /* logo / slider / indicators+text / buttons / footer */
        column-gap: 50px;
        align-items: center;
        overflow: visible;
    }

    .logo-area {
        grid-column: 1 / -1;
        justify-content: center; /* Center logo on desktop */
        margin-bottom: 40px;
    }

    .slider-container {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        margin-bottom: 10px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    }

    .slider-indicators {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        margin-top: 0;
        margin-bottom: 0;
        align-self: start;
    }

    .text-content {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        text-align: left;
        margin-bottom: 0;
        align-self: center;
    }
    
    .main-title {
        font-size: clamp(26px, 3vw, 32px);
        margin-bottom: 18px;
        line-height: 1.15;
    }

    .features {
        margin-bottom: 18px;
        font-size: 11px;
    }

    .description {
        font-size: 15px;
        max-width: 36ch;
        margin-inline: 0;
    }

    .action-buttons {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        margin-bottom: 0;
        align-self: start;
    }

    .btn {
        padding: 18px 24px;
        font-size: 16px;
    }

    .footer {
        grid-column: 1 / -1;
        grid-row: 4 / 5;
        margin-top: 40px;
        text-align: center;
    }
}
