/* --- [1] CONFIG --- */
:root {
    --bg-color: #121212;
    --bg-gradient: radial-gradient(circle at 50% 30%, #1a1a1a 0%, #000000 120%);
    --wrapper-shadow: 0 0 100px rgba(255, 255, 255, 0.9);
    --text: #FAFAFA;
    --accent: #FF5A1F;
    --slate: #566475;
    --grid-line: rgba(255, 255, 255, 0.12);
    --card-hover: rgba(255, 255, 255, 0.04);
    --logo-filter: none;
    --font-brand: 'Rubik', sans-serif;
    --font-tech: 'Roboto Mono', monospace;
    --project-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --header-height: 70px;
}

[data-theme="light"] {
    --bg-color: #FAFAFA;
    --bg-gradient: radial-gradient(circle at 50% 30%, #FFFFFF 0%, #D0D0D0 100%);
    --wrapper-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    --text: #121212;
    --slate: #566475;
    --grid-line: rgba(0, 0, 0, 0.08);
    --card-hover: rgba(0, 0, 0, 0.04);
    --logo-filter: invert(1);
    --project-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- [2] BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-tech);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    cursor: crosshair;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a, button {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* --- [3] FX --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.07'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9998;
    opacity: 0.5;
    mix-blend-mode: overlay;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0.05));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

/* --- [4] LAYOUT --- */
.wrapper {
    max-width: 1440px;
    margin: 0 auto;
    box-shadow: var(--wrapper-shadow);
    border-left: 1px solid var(--grid-line);
    border-right: 1px solid var(--grid-line);
    position: relative;
    background: var(--bg-color);
}

.strict-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    background-color: var(--grid-line);
    gap: 1px;
    border-top: 1px solid var(--grid-line);
    border-bottom: 1px solid var(--grid-line);
}

.cell {
    background-color: var(--bg-color);
    padding: 5rem 4rem;
    position: relative;
    transition: background 0.3s ease;
}

[data-theme="light"] .cell {
    background-color: #FAFAFA;
}

body:not([data-theme="light"]) .cell {
    background-color: #121212;
}

/* --- [5] HEADER (REVERTED TO ORIGINAL LOGIC) --- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(18, 18, 18, 0.9);
    border-bottom: 1px solid var(--grid-line);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-header.visible {
    transform: translateY(0);
}

[data-theme="light"] .sticky-header {
    background: rgba(250, 250, 250, 0.9);
}

.nav-logo {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* --- [6] HERO --- */
.hero {
    min-height: 92vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 1px solid var(--grid-line);
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* LOGO */
.logo-container {
    width: auto;
    max-width: 90%;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transition: gap 0.3s ease;
}

.eye-component {
    position: relative;
    width: 240px;
    height: 160px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye-outline {
    width: 100%;
    height: auto;
    z-index: 2;
    pointer-events: none;
    filter: var(--logo-filter);
    position: relative;
}

.eye-socket {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 96%;
    height: 86.5%;
    overflow: hidden;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.eye-pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46%;
    height: auto;
    z-index: 1;
    filter: var(--logo-filter);
}

.logo-text-img {
    width: 400px;
    height: auto;
    object-fit: contain;
    filter: var(--logo-filter);
    pointer-events: none;
}

#mobile {
    display: none;
}

.logo-img-mobile {
    width: 100%;
    height: auto;
    filter: var(--logo-filter);
}

/* HUD */
.hud-label {
    position: absolute;
    font-family: var(--font-tech);
    font-weight: 500;
    font-size: 11px;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    background: var(--bg-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    user-select: none;
    z-index: 10;
    white-space: nowrap;
}

#theme-trigger {
    cursor: pointer;
}

#theme-trigger:hover {
    background: var(--accent);
    color: #fff;
}

.hl-1 {
    top: 30px;
    left: 30px;
}

.hl-2 {
    top: 30px;
    right: 30px;
}

.hl-3 {
    bottom: 30px;
    left: 30px;
}

.hl-4 {
    bottom: 30px;
    right: 30px;
}

/* TICKER */
.ticker-wrap {
    background: var(--accent, #222);
    color: #FAFAFA;
    padding: 14px 0;
    overflow: hidden;
    border-bottom: 1px solid var(--grid-line, #444);
    width: 100%;
    position: relative;
}

.ticker {
    display: inline-block;
    animation: marquee 40s linear infinite;
    font-family: var(--font-brand);
    font-weight: 700;
    white-space: nowrap;
    font-size: 1.1rem;
    will-change: transform;
    transition: opacity 0.3s ease-in-out;
}

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

/* CONTENT */
.sec-title {
    grid-column: span 12;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-tech);
    color: var(--accent);
    padding: 2rem;
    border-bottom: 1px solid var(--grid-line);
}

.sec-title span {
    opacity: 0.6;
}

.manifesto {
    grid-column: span 12;
    display: flex;
    align-items: center;
    overflow: hidden;
    justify-content: space-between;
}

.manifesto-content {
    max-width: 800px;
    z-index: 2;
}

.manifesto p {
    font-family: var(--font-brand);
    font-size: clamp(1.5rem, 4vw, 2.3rem);
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.manifesto-img {
    position: absolute;
    right: -80px;
    width: 450px;
    opacity: 0.6;
    mix-blend-mode: screen;
    filter: var(--logo-filter);
    pointer-events: none;
}

[data-theme="light"] .manifesto-img {
    mix-blend-mode: multiply;
    opacity: 0.08;
}

/* PROJECTS */
.project-card {
    grid-column: span 6;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-card:hover {
    box-shadow: inset 0 0 0 1px var(--accent);
    background: rgba(255, 90, 31, 0.01);
    z-index: 2;
    transform: none;
}

.project-card:hover .p-title {
    color: var(--accent);
}

.p-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--slate);
    font-weight: 500;
}

.p-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 2rem 0;
    gap: 1rem;
}

.p-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 2.3rem;
    line-height: 1.1;
    margin: 0;
    transition: color 0.2s;
}

.p-desc {
    color: var(--slate);
    font-size: 1.1rem;
    max-width: 95%;
    font-weight: 400;
}

.btn-outline {
    display: inline-block;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 14px 28px;
    font-family: var(--font-tech);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    text-decoration: none;
    width: fit-content;
    transition: 0.2s;
    background: rgba(255, 90, 31, 0);
}

.btn-outline:hover:not(.disabled) {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 90, 31, 0.4);
}

.btn-outline.disabled {
    border-color: var(--slate);
    color: var(--slate);
    cursor: not-allowed;
    opacity: 0.7;
}

/* FOOTER */
/* Обнови этот класс */
.footer {
    grid-column: span 12;
    padding: 6rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

/* --- ДОБАВИТЬ ЭТО --- */

/* 1. Заставляем боковые блоки растягиваться равномерно */
.footer-left,
.footer-right {
    flex: 1;
    width: 100%; /* Для стабильности при переносе */
}

/* 2. Прижимаем правый блок к правому краю внутри его ячейки */
.footer-right {
    display: flex;
    justify-content: flex-end;
}

/* 3. Центрируем сам логотип внутри его контейнера (на всякий случай) */
.footer-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo-img {
    width: 90px;
    height: auto;
    filter: var(--logo-filter);
    opacity: 0.8;
}

.social-block {
    display: flex;
    gap: 1rem;
}

.social-btn {
    border: 1px solid var(--slate);
    color: var(--slate);
    padding: 10px 24px;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.social-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 90, 31, 0.05);
}

/* --- MEDIA QUERIES --- */

@media (max-width: 1024px) {
    .cell {
        padding: 4rem 2rem;
    }

    .logo-container {
        transform: scale(0.85);
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 60px;
    }

    .sticky-header {
        padding: 0 20px;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .hero {
        justify-content: center;
    }

    #desktop-eye-container {
        display: none;
    }

    #mobile {
        display: flex;
        width: 100%;
        max-width: 320px;
    }

    .hud-label {
        padding: 6px 12px;
        font-size: 10px;
    }

    .hl-1 {
        top: 30px;
        left: 15px;
    }

    .hl-2 {
        top: 30px;
        right: 15px;
    }

    .hl-3 {
        bottom: 30px;
        left: 15px;
    }

    .hl-4 {
        bottom: 30px;
        right: 15px;
    }

    .project-card, .sec-title, .manifesto, .footer {
        grid-column: span 12;
    }

    .cell {
        padding: 3rem 1.5rem;
    }

    .manifesto-img {
        width: 250px;
        right: -50px;
        opacity: 0.4;
    }

    .project-card {
        min-height: auto;
        padding-bottom: 4rem;
    }

    .p-title {
        font-size: 1.8rem;
    }

    .footer {
        flex-direction: column;
        text-align: center;
        padding: 4rem 1.5rem;
        gap: 1.5rem; /* Чуть уменьшил отступ между блоками */
    }

    .footer-center {
        order: -1;
        margin-bottom: 1rem;
    }

    /* --- ИСПРАВЛЕНИЕ --- */
    /* 1. Отменяем прижатие вправо и центрируем контейнер кнопок */
    .footer-right {
        justify-content: center;
    }

    /* 2. На всякий случай центрируем и сам блок с кнопками */
    .social-block {
        justify-content: center;
        flex-wrap: wrap; /* Чтобы кнопки перенеслись, если экран совсем узкий */
    }

    /* 3. Сбрасываем flex: 1, чтобы блоки не пытались растягиваться странно */
    .footer-left,
    .footer-right {
        flex: auto;
        width: 100%;
    }


    .manifesto-content {
        position: relative;
        z-index: 10;
    }

    .manifesto-img {
        width: 160px;
        top: auto;
        bottom: -20px;
        right: -20px;
        opacity: 0.3;
        transform: rotate(-15deg);
        pointer-events: none;
        z-index: 1;
    }

}

@media (max-width: 400px) {
    .hl-1, .hl-2 {
        top: 30px;
    }

    .logo-container {
        margin-top: 1rem;
    }
}

/* --- ANGRY EYE --- */
.interactive-eye.angry .eye-pupil {
    filter: sepia(1) saturate(2000%) hue-rotate(-80deg) contrast(1.5) !important;
    transition: filter 0.1s steps(2);
}

.interactive-eye.angry {
    animation: glitch 0.2s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitch {
    0% {
        transform: translate(0) skewX(0deg) scale(1);
    }
    10% {
        transform: translate(-2px, 2px) skewX(-10deg);
    }
    20% {
        transform: translate(2px, -2px) skewX(10deg) scale(1.05);
    }
    30% {
        transform: translate(-2px, 2px) skewX(0deg);
    }
    40% {
        transform: translate(2px, 2px) skewX(-5deg);
    }
    50% {
        transform: translate(-2px, -2px) skewX(5deg) scale(0.95);
    }
    60% {
        transform: translate(2px, 2px) skewX(0deg);
    }
    70% {
        transform: translate(-2px, 2px) skewX(-10deg);
    }
    80% {
        transform: translate(2px, -2px) skewX(10deg) scale(1.02);
    }
    90% {
        transform: translate(-2px, 2px) skewX(0deg);
    }
    100% {
        transform: translate(0) skewX(0deg) scale(1);
    }
}

.text-panic {
    color: red !important;
    text-shadow: 2px 0 0 #000;
    animation: text-shake 0.1s infinite;
    font-weight: bold;
}

@keyframes text-shake {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(1px, -1px);
    }
    100% {
        transform: translate(-1px, 1px);
    }
}

.ticker-normal {
    opacity: 1;
}

.ticker-evil {
    position: absolute;
    top: 14px;
    left: 0;
    opacity: 0;
    pointer-events: none;
}

.ticker-wrap.is-evil .ticker-normal {
    opacity: 0;
}

.ticker-wrap.is-evil .ticker-evil {
    opacity: 1;
}

a.hud-btn {
    text-decoration: none;
    display: inline-flex;
}

.hl-3:hover {
    background: var(--accent);
    color: #fff;
}

/* --- CASINO MINI-GAME --- */
.casino-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.casino-overlay.active {
    display: flex;
}

.casino-machine {
    border: 1px solid var(--accent);
    padding: 2.5rem;
    background: #000;
    box-shadow: 0 0 20px rgba(255, 90, 31, 0.1);
    text-align: center;
    width: 340px;
    position: relative;
    margin-bottom: 2rem;
}

.casino-screen {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.reel {
    width: 80px;
    height: 100px;
    background: #000;
    border: 1px solid var(--slate);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.reel img {
    width: 60%;
    height: auto;
    object-fit: contain;
    filter: invert(1);
}

.reel.blur img {
    filter: invert(1) blur(4px);
    opacity: 0.7;
}

.casino-ui {
    font-family: var(--font-tech);
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.05em;
}

.btn-spin {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px 0;
    width: 100%;
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
}

.btn-spin:disabled {
    background: var(--slate);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.win-msg {
    margin-top: 15px;
    height: 20px;
    font-family: var(--font-tech);
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
}

.casino-close-external {
    background: transparent;
    border: none;
    color: var(--slate);
    font-family: var(--font-tech);
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    transition: 0.3s;
    margin-top: 10px;
}

.casino-close-external:hover {
    color: #fff;
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* --- SECRET TRIGGER STYLE --- */
#secret-trigger {
    cursor: pointer;
    z-index: 20;
}

#secret-trigger:hover {
    background: var(--accent);
    color: #fff;
}

#secret-trigger:active {
    background: var(--accent);
    color: #fff;
}