:root {
    --bg: #0d0d10;
    --fg: #ffffff;
    --fg-muted: rgba(255, 255, 255, 0.64);
    --fg-dim: rgba(255, 255, 255, 0.42);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);

    --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --star-img: url('assets/star.png');
    --tg-img: url('assets/tg.png');
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

.sparkles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.sparkle {
    position: absolute;
    background-image: var(--star-img);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    will-change: opacity;
}

nav, section, footer { position: relative; z-index: 1; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 22px 0;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease-out);
}
nav.scrolled { border-bottom-color: var(--border); }

nav .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.nav-logo-link {
    grid-column: 1;
    justify-self: start;
    display: block;
    line-height: 0;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.nav-logo {
    height: 38px;
    width: auto;
    color: var(--fg);
    display: block;
    transition: height 0.3s var(--ease-out);
}

.nav-links {
    grid-column: 2;
    display: flex;
    gap: 36px;
    list-style: none;
}
.nav-links a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: color 0.25s var(--ease-out);
    position: relative;
    padding: 4px 0;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--fg);
    border-radius: 2px;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 160px 28px 120px;
    overflow: hidden;
}
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    text-align: center;
    max-width: 780px;
    width: 100%;
}
.hero-content > * { margin: 0; }

.hero-logo {
    display: block;
    width: 390px;
    max-width: 80%;
    height: auto;
    aspect-ratio: 194 / 78;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) forwards;
}

h1 {
    font-weight: 600;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.035em;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.1s forwards;
}

.hero-sub {
    font-size: clamp(15px, 1.25vw, 18px);
    color: var(--fg-muted);
    max-width: 520px;
    line-height: 1.55;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.2s forwards;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.3s forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    padding: 13px 22px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.25s var(--ease-out), border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    border-color: var(--fg-muted);
    background: rgba(255, 255, 255, 0.03);
}

.tg-icon {
    width: 18px;
    height: 18px;
    background-image: var(--tg-img);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}
.btn-primary .tg-icon { filter: invert(1); }

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

section.block { padding: 110px 0; }
h2 {
    font-weight: 600;
    font-size: clamp(28px, 3.5vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    max-width: 680px;
}
.section-lead {
    color: var(--fg-muted);
    font-size: 16px;
    max-width: 560px;
    line-height: 1.55;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 48px;
}
.feature {
    background: var(--bg);
    padding: 36px 32px;
    transition: background 0.3s var(--ease-out);
}
.feature:hover { background: rgba(255, 255, 255, 0.02); }
.feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 22px;
    color: var(--fg);
    transition: transform 0.4s var(--ease-out);
}
.feature-icon svg { width: 100%; height: 100%; display: block; }
.feature:hover .feature-icon { transform: translateY(-3px); }
.feature h3 {
    font-weight: 600;
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-bottom: 10px;
}
.feature p {
    color: var(--fg-muted);
    font-size: 14.5px;
    line-height: 1.55;
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}
.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 72px;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 56px;
    background: var(--bg);
}
.contact-intro h2 { margin-bottom: 14px; }
.contact-intro p {
    color: var(--fg-muted);
    font-size: 15.5px;
    line-height: 1.6;
    margin-bottom: 24px;
}
.contact-meta {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.contact-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--fg-muted);
}
.contact-meta-row .tg-icon { width: 22px; height: 22px; }
.contact-meta-row svg {
    width: 22px;
    height: 22px;
    color: var(--fg);
    flex-shrink: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
}
.field input,
.field textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--fg);
    transition: border-color 0.25s var(--ease-out);
    resize: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-dim); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--fg);
}
.field textarea {
    min-height: 110px;
    font-family: var(--font-sans);
}
.contact-form .btn {
    margin-top: 4px;
    align-self: flex-start;
}
.form-status {
    font-size: 13.5px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.3s var(--ease-out);
    margin-top: 2px;
    min-height: 20px;
}
.form-status.show {
    opacity: 1;
    transform: translateY(0);
}

footer {
    padding: 36px 0;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    background: var(--bg);
}
footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-logo-link {
    flex: 0 0 auto;
    line-height: 0;
    display: block;
}
.footer-logo {
    height: 28px;
    color: var(--fg);
    opacity: 0.9;
    display: block;
}
.footer-links {
    flex: 1 1 auto;
    display: flex;
    gap: 28px;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
}
.footer-links a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.25s var(--ease-out);
    white-space: nowrap;
}
.footer-links a:hover { color: var(--fg); }
.footer-copy {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--fg-dim);
    white-space: nowrap;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }

@media (max-width: 1024px) {
    section.block { padding: 90px 0; }
    .hero { padding: 120px 24px 80px; }
    .contact-wrap { padding: 44px; gap: 56px; }
}

@media (max-width: 900px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid .feature:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .contact-wrap {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 36px 24px;
    }
}

@media (max-width: 760px) {
    footer .container {
        flex-direction: column;
        gap: 22px;
        text-align: center;
    }
    .footer-links {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 22px 28px;
    }
    .footer-logo-link { order: 1; }
    .footer-copy { order: 3; }
}

@media (max-width: 720px) {
    .container { padding: 0 20px; }
    section.block { padding: 72px 0; }
    .feature { padding: 28px 24px; }
    .hero { padding: 110px 20px 72px; }
    .hero-content { gap: 26px; }
    .hero-logo { width: 230px; }
}

@media (max-width: 640px) {
    nav {
        padding: 24px 0;
    }
    nav .container {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .nav-links { display: none; }
    .btn { padding: 12px 20px; font-size: 14.5px; }

    .hero {
        padding: 70px 20px 40px;
    }
    .hero-content { gap: 20px; }

    .nav-logo-link {
        position: absolute;
        left: 50%;
        --logo-progress: 0;
        opacity: var(--logo-progress);
        transform: translateX(-50%) scale(calc(0.35 + 0.65 * var(--logo-progress))) translateY(calc(-20px * (1 - var(--logo-progress))));
        pointer-events: none;
        transform-origin: center center;
        will-change: transform, opacity;
    }
    .nav-logo-link[data-visible="1"] {
        pointer-events: auto;
    }
    .nav-logo { height: 42px; }
}

@media (max-width: 560px) {
    .features-grid { grid-template-columns: 1fr; }
    .features-grid .feature:nth-child(3) { grid-column: auto; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    h1 {
        font-size: clamp(28px, 9vw, 40px);
        word-break: normal;
        overflow-wrap: break-word;
    }
    .hero { padding: 60px 16px 40px; }
    .hero-logo {
        width: clamp(180px, 68vw, 240px);
        max-width: 90%;
    }
    .hero-content { gap: 18px; max-width: 100%; }
    .hero-sub { font-size: 14.5px; }
    .hero-actions { width: 100%; flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .contact-meta-row { font-size: 14px; gap: 12px; }
    .contact-meta-row .tg-icon,
    .contact-meta-row svg { width: 20px; height: 20px; }
}
