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

:root {
    --tg-blue: #2aabee;
    --tg-blue-hover: #168acd;
    --tg-blue-soft: rgba(42, 171, 238, 0.12);
    --tg-text: #222d37;
    --tg-text-muted: #7b8a95;
    --tg-border: #eef2f5;
    --tg-border-strong: #dfe6eb;
    --tg-bg: #ffffff;
    --tg-bg-soft: #f7fafc;
    --tg-dark: #0b0e11;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
}

body {
    font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Nunito', 'Segoe UI', sans-serif;
    background: var(--tg-bg);
    color: var(--tg-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 50% -10%, rgba(42, 171, 238, 0.08), transparent 60%);
    background-attachment: fixed;
}

/* ========== Header ========== */
.header {
    border-bottom: 1px solid var(--tg-border);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--tg-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.brand-mark {
    width: 24px;
    height: 24px;
    color: var(--tg-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-mark svg {
    width: 24px;
    height: 24px;
}

.nav {
    display: flex;
    gap: 32px;
    margin-left: auto;
}

/* Language switcher */
.lang-switch {
    display: inline-flex;
    gap: 2px;
    background: var(--tg-bg-soft);
    border: 1px solid var(--tg-border);
    border-radius: 999px;
    padding: 3px;
}

.lang-option {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-text-muted);
    text-decoration: none;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    white-space: nowrap;
}

.lang-option:hover {
    color: var(--tg-text);
}

.lang-option.active {
    background: #fff;
    color: var(--tg-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.lang-flag {
    font-size: 14px;
    line-height: 1;
}

.nav-link {
    color: var(--tg-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    padding: 4px 0;
    position: relative;
    transition: color 0.2s var(--ease);
}

.nav-link:hover {
    color: var(--tg-blue);
}

.nav-link.active {
    color: var(--tg-blue);
    font-weight: 500;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -17px;
    height: 2px;
    background: var(--tg-blue);
    border-radius: 2px 2px 0 0;
}

/* ========== Main ========== */
.main {
    flex: 1;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 72px 24px 80px;
    text-align: center;
}

/* ========== Hero ========== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeUp 0.7s var(--ease) both;
}

.logo-circle {
    width: 168px;
    height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 4px;
}

.logo-wave {
    width: 168px;
    height: 168px;
    filter: drop-shadow(0 8px 20px rgba(42, 171, 238, 0.28));
}

.logo-wave line {
    stroke: var(--tg-blue);
}

.logo-wave line {
    transform-origin: center;
    transform-box: fill-box;
    animation: wave 1.6s ease-in-out infinite;
}

.logo-wave line:nth-child(1) { animation-delay: 0s; }
.logo-wave line:nth-child(2) { animation-delay: 0.1s; }
.logo-wave line:nth-child(3) { animation-delay: 0.2s; }
.logo-wave line:nth-child(4) { animation-delay: 0.3s; }
.logo-wave line:nth-child(5) { animation-delay: 0.4s; }
.logo-wave line:nth-child(6) { animation-delay: 0.5s; }

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.55); }
}

.title {
    font-size: 44px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-size: 19px;
    color: var(--tg-text-muted);
    font-weight: 400;
    letter-spacing: -0.005em;
}

/* ========== Showcase / Phone ========== */
.showcase {
    margin-top: 68px;
    display: flex;
    justify-content: center;
    animation: fadeUp 0.7s 0.15s var(--ease) both;
}

.phone {
    position: relative;
    width: 290px;
    aspect-ratio: 9 / 18.5;
}

.phone-btn {
    position: absolute;
    background: #1f2227;
    border-radius: 2px;
    z-index: 0;
}

.phone-btn {
    width: 3px;
}

.phone-btn-silent {
    left: -3px;
    top: 15.5%;
    height: 4.7%;
}
.phone-btn-vol-up {
    left: -3px;
    top: 22%;
    height: 8%;
}
.phone-btn-vol-down {
    left: -3px;
    top: 31%;
    height: 8%;
}
.phone-btn-power {
    right: -3px;
    top: 23.5%;
    height: 11.7%;
}

.phone-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2a2d33 0%, #15171b 100%);
    border-radius: 14.5%/7.1%;
    padding: 2.8%;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 0 0 2px #101215,
        0 30px 60px -20px rgba(15, 22, 30, 0.35),
        0 10px 20px -10px rgba(15, 22, 30, 0.2);
}

.phone-notch {
    position: absolute;
    top: 2.7%;
    left: 50%;
    transform: translateX(-50%);
    width: 32.5%;
    height: 4.4%;
    background: #000;
    border-radius: 999px;
    z-index: 2;
}

.phone-screen {
    border-radius: 11.7%/5.7%;
}

.phone-screen::after {
    border-radius: 11.7%/5.7%;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 34px;
    background: #000;
    overflow: hidden;
    position: relative;
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.phone-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 40%);
    pointer-events: none;
    border-radius: 34px;
}

/* ========== Downloads ========== */
.downloads {
    margin-top: 56px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    animation: fadeUp 0.7s 0.3s var(--ease) both;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px 10px 18px;
    background: var(--tg-blue);
    color: #ffffff;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
    min-width: 210px;
    box-shadow: 0 6px 18px -6px rgba(42, 171, 238, 0.6);
}

.download-link:hover {
    background: var(--tg-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(42, 171, 238, 0.55);
}

.download-link:active {
    transform: translateY(0);
}

.download-link--dark {
    background: var(--tg-dark);
    box-shadow: 0 6px 18px -6px rgba(11, 14, 17, 0.5);
}

.download-link--dark:hover {
    background: #1c2026;
    box-shadow: 0 12px 24px -8px rgba(11, 14, 17, 0.5);
}

.download-link span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}

.download-link small {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.download-link strong {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ========== Legal pages ========== */
.legal {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 56px 24px 72px;
    animation: fadeUp 0.5s var(--ease) both;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tg-blue);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 32px;
    transition: color 0.2s var(--ease);
}

.back-link:hover {
    color: var(--tg-blue-hover);
}

.legal h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 8px;
}

.legal-date {
    color: var(--tg-text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.legal-lead {
    font-size: 17px;
    color: var(--tg-text);
    margin-bottom: 36px;
    padding: 18px 20px;
    background: var(--tg-bg-soft);
    border-radius: 12px;
    border-left: 3px solid var(--tg-blue);
}

.legal section {
    margin-bottom: 28px;
}

.legal h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    color: var(--tg-text);
}

.legal section p {
    font-size: 16px;
    line-height: 1.65;
    color: var(--tg-text);
    opacity: 0.88;
}

.legal section p + p {
    margin-top: 10px;
}

.legal a:not(.back-link) {
    color: var(--tg-blue);
    text-decoration: none;
}

.legal a:not(.back-link):hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .legal {
        padding: 36px 20px 56px;
    }

    .legal h1 {
        font-size: 32px;
    }

    .legal-lead {
        font-size: 16px;
        padding: 16px 18px;
    }

    .legal h2 {
        font-size: 17px;
    }

    .legal section p {
        font-size: 15px;
    }

    .back-link {
        margin-bottom: 24px;
    }
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 28px 24px 36px;
    color: var(--tg-text-muted);
    font-size: 13px;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.footer a {
    color: var(--tg-text-muted);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.footer a:hover {
    color: var(--tg-blue);
}

.footer-divider {
    opacity: 0.5;
}

/* ========== Animations ========== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .header-inner {
        padding: 14px 20px;
        gap: 16px;
    }

    .brand {
        font-size: 16px;
        gap: 8px;
    }

    .brand-mark,
    .brand-mark svg {
        width: 22px;
        height: 22px;
    }

    .nav {
        gap: 18px;
    }

    .nav-link {
        font-size: 14px;
    }

    .lang-switch {
        padding: 2px;
    }

    .lang-option {
        padding: 4px 9px;
        font-size: 12px;
    }

    .nav-link.active::after {
        bottom: -15px;
    }

    .main {
        padding: 48px 20px 56px;
    }

    .hero {
        gap: 16px;
    }

    .logo-circle {
        width: 128px;
        height: 128px;
    }

    .logo-wave {
        width: 128px;
        height: 128px;
    }

    .title {
        font-size: 34px;
    }

    .subtitle {
        font-size: 16px;
        max-width: 320px;
    }

    .showcase {
        margin-top: 44px;
    }

    .phone {
        width: min(260px, 68vw);
    }

    .downloads {
        flex-direction: column;
        align-items: stretch;
        margin-top: 40px;
        gap: 10px;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .download-link {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .header-inner {
        padding: 12px 16px;
        gap: 12px;
    }

    .brand {
        font-size: 15px;
    }

    .nav {
        gap: 12px;
    }

    .nav-link {
        font-size: 13px;
    }

    .lang-option {
        padding: 4px 8px;
        font-size: 12px;
    }

    .lang-option .lang-flag {
        display: none;
    }

    .nav-link.active::after {
        bottom: -13px;
    }

    .main {
        padding: 36px 16px 48px;
    }

    .logo-circle,
    .logo-wave {
        width: 108px;
        height: 108px;
    }

    .title {
        font-size: 30px;
    }

    .subtitle {
        font-size: 15px;
    }

    .showcase {
        margin-top: 36px;
    }

    .phone {
        width: min(230px, 72vw);
    }

    .downloads {
        margin-top: 32px;
    }
}

@media (hover: none) {
    .download-link:hover {
        transform: none;
    }
}
