/* ШТАБ ИТ — базовые стили поверх Tailwind */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/Inter-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/Inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html,
body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    color: #fff;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.form-notice {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.outline-text {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    color: transparent;
}

/* Hero: смартфоны — слово в строку, чуть меньше кегль (в т.ч. iPhone 12) */
.hero-title {
    font-size: 3.6rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    font-weight: 900;
    line-height: 1.03;
    text-transform: uppercase;
}

.hero-title .hero-title-word {
    display: block;
    max-width: 100%;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 8vw;
        display: block;
        line-height: 0.94;
    }

    .hero-title .hero-title-word {
        display: inline;
        max-width: none;
        text-align: inherit;
    }

    .hero-title .hero-title-word:not(:first-child)::before {
        content: ' ';
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 104px;
    }
}

.gold-accent {
    color: #FFD700;
}

/* Мобильное меню: телефон + MAX + Telegram, по центру */
.mobile-menu-contact {
    width: 100%;
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.mobile-menu-social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-align: center;
    color: #fff;
    transition: color 0.2s ease;
}

.mobile-menu-social-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-social-text {
    min-width: 0;
}

.contact-social-links {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 25rem;
}

.contact-social-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    text-align: left;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.contact-social-link:hover {
    border-color: rgba(255, 215, 0, 0.45);
    background: rgba(255, 255, 255, 0.05);
    color: #FFD700;
    transform: translateY(-1px);
}

.contact-social-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-social-text {
    min-width: 0;
}

.contact-social-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.contact-social-subtitle {
    display: block;
    margin-top: 0.2rem;
    font-size: 12px;
    line-height: 1.3;
    color: #6b7280;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

@media (min-width: 1024px) {
    .contact-social-links {
        max-width: 26rem;
    }
}

.bg-gold-glow {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
}

.border-white-10 {
    border-color: rgba(255, 255, 255, 0.1);
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* Анимации появления */
.hero-anim {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Бренды */
.marquee {
    position: relative;
    width: 100%;
    height: 50px;
    overflow: hidden;
    background: #050505;
    border-top: 1px solid #FFD700;
    border-bottom: 1px solid #FFD700;
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .marquee {
        height: 80px;
    }
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    will-change: transform;
}

.marquee-item {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #fff;
    padding: 0 20px;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .marquee-item {
        font-size: 13px;
        padding: 0 30px;
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Монитор */
#monitor-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px;
}

.monitor-scaler {
    transform-origin: top center;
    transition: transform 0.3s ease;
}

@media (max-width: 374px) {
    .monitor-scaler {
        transform: scale(0.60);
        margin-bottom: -130px;
    }
}

@media (min-width: 375px) and (max-width: 480px) {
    .monitor-scaler {
        transform: scale(0.70);
        margin-bottom: -90px;
    }
}

@media (min-width: 481px) and (max-width: 639px) {
    .monitor-scaler {
        transform: scale(0.85);
        margin-bottom: -50px;
    }
}

@media (min-width: 640px) {
    .monitor-scaler {
        transform: scale(1);
        margin-bottom: 0;
    }
}

.monitor-frame {
    width: 440px;
    height: 280px;
    background: #050505;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transform: rotateY(-5deg);
    box-shadow:
        0 0 40px rgba(0, 0, 0, 1),
        0 0 20px rgba(255, 215, 0, 0.05);
}

.screen-content {
    padding: 15px;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 10px;
    font-size: 12px;
    font-family: 'Fira Code', monospace;
    color: rgba(255, 255, 255, 0.3);
}

.code-wrapper {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.code-stream {
    position: absolute;
    width: 100%;
    animation: scrollCodeLoop 10s linear infinite;
    will-change: transform;
}

.code-line span {
    color: #FFD700;
}

@keyframes scrollCodeLoop {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

.ui-panel {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.monitor-stand {
    width: 80px;
    height: 30px;
    background: #111;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: -2px;
}

.typewriter-text {
    border-right: 2px solid #FFD700;
    white-space: nowrap;
    overflow: hidden;
    min-height: 1.2em;
}

/* Бургер-меню */
.hamburger-line {
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-open .line-1 {
    transform: translateY(8px) rotate(45deg);
}

.menu-open .line-2 {
    opacity: 0;
}

.menu-open .line-3 {
    transform: translateY(-8px) rotate(-45deg);
}

/* Модальные окна */
.modal-hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Проекты: высота карточек меньше на 20% */
#portfolio a.group {
    aspect-ratio: 40 / 32.3 !important;
}

/* Проекты: превью заполняют контейнер полностью */
#portfolio a.group > img {
    object-fit: cover;
    object-position: center;
}

/* Проекты: отключаем старое общее затемнение карточки */
#portfolio a.group > div.bg-gradient-to-t {
    display: none !important;
}

/* Проекты: скрываем фоновые иконки-заглушки */
#portfolio a.group > div.absolute.inset-0.flex.items-center.justify-center.opacity-20 {
    display: none !important;
}

@media (max-width: 767px) {
    #portfolio a.group {
        aspect-ratio: var(--mobile-card-ratio, 40 / 31.5) !important;
    }

    #portfolio a.group::before {
        content: '';
        position: absolute;
        inset: 0;
        background:
            linear-gradient(110deg, rgba(255, 255, 255, 0.04) 8%, rgba(255, 255, 255, 0.12) 18%, rgba(255, 255, 255, 0.04) 33%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
        background-size: 200% 100%, 100% 100%;
        animation: portfolioCardShimmer 1.35s linear infinite;
        opacity: 0;
        pointer-events: none;
        z-index: 0;
        transition: opacity 0.25s ease;
    }

    #portfolio a.group.portfolio-loading::before {
        opacity: 1;
    }

    #portfolio a.group > img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        inset: 0 auto auto 0 !important;
        object-fit: unset !important;
        object-position: top center !important;
        transform: none !important;
    }

    #portfolio a.group.portfolio-loading > img {
        opacity: 0.15 !important;
    }

    #portfolio a.group > div.absolute.inset-0.p-5 {
        padding: 1rem;
    }

    #portfolio a.group > div.absolute.inset-0.p-5.md\:p-6 {
        align-items: flex-start;
    }

    #portfolio a.group h3 {
        font-size: 0.88rem;
        line-height: 1.08;
        margin-bottom: 0.3rem;
        max-width: 100%;
        word-break: break-word;
        letter-spacing: 0.02em;
    }

    #portfolio a.group .group-hover\:opacity-100,
    #portfolio a.group .group-hover\:max-h-20,
    #portfolio a.group .group-hover\:max-h-8 {
        opacity: 1;
        max-height: none;
    }

    #portfolio a.group p,
    #portfolio a.group button {
        max-width: 100%;
        text-align: left;
    }

    #portfolio a.group p {
        letter-spacing: 0.03em;
    }

    #portfolio a.group button {
        border-bottom: 0 !important;
        padding-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 374px) {
    #portfolio a.group {
        aspect-ratio: var(--mobile-card-ratio-xs, var(--mobile-card-ratio, 40 / 29.5)) !important;
    }

    #portfolio a.group > div.absolute.inset-0.p-5 {
        padding: 0.8rem;
    }

    #portfolio a.group h3 {
        font-size: 0.8rem;
        line-height: 1.05;
        margin-bottom: 0.22rem;
    }

    #portfolio a.group p {
        font-size: 0.75rem;
        line-height: 1.24;
        letter-spacing: 0.02em;
    }

    #portfolio a.group button {
        font-size: 0.75rem;
        letter-spacing: 0.08em;
        margin-top: 0.25rem;
    }
}

@keyframes portfolioCardShimmer {
    0% {
        background-position: 200% 0, 0 0;
    }
    100% {
        background-position: -200% 0, 0 0;
    }
}
