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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--font-family);
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--bg-glow);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: var(--bg-noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 1.125rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    animation: fadeDown 0.7s ease both;
}

.header__brand {
    display: none;
    margin-right: auto;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--silver-bright);
    text-decoration: none;
}

.header__tools {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header__cabinet {
    position: absolute;
    top: 1rem;
    right: 2.25rem;
    z-index: 11;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.18));
    background: var(--btn-ghost-bg, rgba(255, 255, 255, 0.04));
    color: var(--silver-bright);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.header__cabinet:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.header__cabinet-icon {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
}

.header__cabinet-icon svg {
    width: 100%;
    height: 100%;
}

.site-nav {
    position: absolute;
    top: 1.125rem;
    right: 9.75rem;
    z-index: 10;
}

.nav {
    display: flex;
    gap: 1.75rem;
    list-style: none;
}

.nav a {
    color: var(--text-nav);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.nav a:hover,
.nav a.is-current {
    color: var(--silver-bright);
}

.nav-toggle {
    display: none;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle__bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 22px;
    height: 16px;
    pointer-events: none;
}

.nav-toggle__bars span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--silver-bright);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-backdrop {
    display: none;
}

body.nav-open {
    overflow: hidden;
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem 3.5rem;
    text-align: center;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 720px;
    animation: fadeUp 0.9s ease 0.1s both;
}

.logo-stage {
    position: relative;
    width: min(var(--logo-max), 92vw);
}

.logo-stage__glow {
    display: none;
}

.logo-stage__img {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.brand__title {
    margin-top: 0.15rem;
    font-size: clamp(2.4rem, 7vw, 4.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: var(--title-shadow);
}

.brand__academy {
    margin-top: 0.55rem;
    font-size: clamp(0.72rem, 2.2vw, 1.05rem);
    font-weight: 300;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--brand-accent-color);
}

.brand__subtitle {
    margin-top: 1rem;
    max-width: 42ch;
    font-size: clamp(1rem, 2.6vw, 1.35rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--silver-bright, var(--silver));
}

.brand__desc {
    margin-top: 0.85rem;
    max-width: 58ch;
    font-size: clamp(0.9rem, 1.9vw, 1.02rem);
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-muted, var(--silver));
}

.hero__actions {
    margin-top: 2.5rem;
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 0.9s ease 0.25s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 11.5rem;
    padding: 0.72rem 1.35rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-decoration: none;
    border-radius: 980px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary {
    color: #fff;
    background: var(--cta-gradient);
    border: none;
    box-shadow: var(--btn-primary-shadow);
}

.btn--primary:hover {
    box-shadow: var(--btn-primary-shadow-hover);
}

.btn--ghost {
    color: var(--silver-bright);
    background: var(--btn-ghost-bg);
    border: 1px solid var(--btn-ghost-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn--ghost:hover {
    background: var(--btn-ghost-hover-bg);
    border-color: var(--btn-ghost-hover-border);
    color: var(--btn-ghost-hover-color);
}

.footer {
    padding: 1.25rem 2rem 1.75rem;
    text-align: center;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--footer-color);
    animation: fadeUp 0.9s ease 0.35s both;
}

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

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

@media (max-width: 640px) {
    .header {
        padding: 0.65rem max(1rem, env(safe-area-inset-right)) 0.65rem max(1rem, env(safe-area-inset-left));
        padding-top: max(0.65rem, env(safe-area-inset-top));
        position: sticky;
        top: 0;
        z-index: 110;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 0.75rem;
        background: var(--nav-mobile-bg);
        border-bottom: 1px solid var(--nav-mobile-border);
    }

    .header__brand {
        display: block;
    }

    .site-nav {
        position: static;
        top: auto;
        right: auto;
        z-index: 100;
    }

    .header__cabinet {
        position: static;
        top: auto;
        right: auto;
        min-height: 44px;
        padding: 0.5rem 0.7rem;
    }

    .header__cabinet-label {
        display: none;
    }

    .nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        gap: 0;
        background: var(--nav-mobile-bg);
        padding: calc(4.25rem + env(safe-area-inset-top, 0px)) 0 max(1rem, env(safe-area-inset-bottom));
        margin: 0;
        list-style: none;
        z-index: 100;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav.is-open {
        display: flex;
    }

    .nav li {
        padding: 0;
        border-bottom: 1px solid var(--nav-mobile-border);
    }

    .nav li:last-child {
        border-bottom: none;
    }

    .nav a {
        display: block;
        padding: 1rem 1.25rem;
        font-size: 1.05rem;
        font-weight: 500;
        letter-spacing: 0;
        color: var(--card-title-color, var(--text));
    }

    .nav a.is-current {
        color: var(--accent);
        background: var(--btn-ghost-bg);
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        min-height: 48px;
        flex-shrink: 0;
        border: 1px solid var(--card-border);
        border-radius: 12px;
        background: var(--btn-ghost-bg);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        position: relative;
        z-index: 111;
    }

    .nav-toggle.is-active {
        border-color: var(--accent);
        background: var(--btn-ghost-hover-bg);
    }

    .nav-toggle.is-active .nav-toggle__bars span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.is-active .nav-toggle__bars span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .nav-toggle.is-active .nav-toggle__bars span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(0, 0, 0, 0.55);
        border: none;
        padding: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-backdrop.is-visible {
        display: block;
    }

    .brand__academy {
        letter-spacing: 0.24em;
    }

    .brand__subtitle,
    .brand__desc {
        padding: 0 0.25rem;
    }

    .hero {
        padding: 0.25rem max(1rem, env(safe-area-inset-right)) 2.5rem max(1rem, env(safe-area-inset-left));
    }

    .hero__actions {
        flex-direction: column;
        width: 100%;
        max-width: 20rem;
    }

    .btn {
        width: 100%;
        min-height: 44px;
    }

    .footer {
        padding: 1rem max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        font-size: 0.72rem;
        line-height: 1.5;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand,
    .header,
    .hero__actions,
    .footer {
        animation: none;
    }
}
