/* ============================================
   glassworld.tech — Кирилл Маймулин | CTO
   Основные стили сайта
   ============================================ */

:root {
    --bg-deep: #020617;
    --accent: #38bdf8;
    --card-bg: rgba(15, 23, 42, 0.6);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

/* ---------- Фон ---------- */
.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, transparent 50%), var(--bg-deep);
}

.bg-grid {
    position: absolute;
    top: 0; left: 0;
    width: 200%; height: 200%;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: moveGrid 60s linear infinite;
    opacity: 0.5;
}

@keyframes moveGrid {
    from { transform: translate(0, 0); }
    to   { transform: translate(-40px, -40px); }
}

/* ---------- Переключатель языков ---------- */
.lang-switcher {
    position: absolute;
    top: 20px; right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background-color 0.3s, color 0.3s;
}

.lang-btn:hover { color: var(--text-main); }
.lang-btn.active { background: var(--accent); color: var(--bg-deep); }

.lang-btn:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Видимость языковых версий ----------
   По умолчанию (без JS) показывается русская версия.
   JS выставляет data-lang на <html>. */
.lang-en { display: none; }
html[data-lang="en"] .lang-en { display: inline; }
html[data-lang="en"] .lang-ru { display: none; }

/* ---------- Каркас ---------- */
.container {
    max-width: 800px;
    width: 100%;
    padding-top: 60px;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

.img-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 35px;
}

.img-wrapper::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 130%; height: 130%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.8; transform: translate(-50%, -50%) scale(1.15); }
}

.profile-img {
    width: 250px; height: 250px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
    border: 3px solid rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

h1 {
    font-size: 3.2rem;
    margin: 0;
    letter-spacing: -1.5px;
    font-weight: 700;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.lead {
    color: var(--text-dim);
    max-width: 650px;
    margin: 25px auto;
    font-size: 1.15rem;
    font-weight: 300;
}

/* ---------- Секции ---------- */
.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 3px;
    margin: 60px 0 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.section-title::after {
    content: "";
    height: 1px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.3), transparent);
    flex-grow: 1;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                border-color 0.4s,
                box-shadow 0.4s;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card h3 {
    margin-top: 0;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 0;
}

/* ---------- Теги экспертизы ---------- */
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Контакты ---------- */
.cta-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 70px;
    flex-wrap: wrap;
}

.btn {
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.3s, filter 0.3s;
    text-align: center;
    min-width: 180px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

.btn-outline {
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-main);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* ---------- Форма обратной связи ---------- */
.contact-form {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 35px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.form-field input,
.form-field textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-field .input-error,
.form-field input.input-error,
.form-field textarea.input-error {
    border-color: #f87171;
}

/* Скрытое поле-ловушка для ботов */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.form-opt {
    font-weight: 400;
    opacity: 0.7;
}

.form-note {
    margin: 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.8;
}

.form-submit {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    align-self: center;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.form-status {
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.4em;
}

.form-status--success { color: #4ade80; }
.form-status--error { color: #f87171; }
.form-status--sending { color: var(--text-dim); }

/* ---------- Страница 404 ---------- */
.error-page {
    text-align: center;
    padding-top: 15vh;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -4px;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-text {
    color: var(--text-dim);
    font-size: 1.15rem;
    max-width: 480px;
    margin: 25px auto 40px;
}

/* ---------- Футер ---------- */
footer {
    text-align: center;
    margin-top: 100px;
    color: var(--text-dim);
    font-size: 0.8rem;
    padding-bottom: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
    h1 { font-size: 2.4rem; }
    .profile-img { width: 180px; height: 180px; }
    .lang-switcher { top: 10px; right: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .contact-form { padding: 25px; }
    .error-code { font-size: 5rem; }
}

/* ---------- Доступность: меньше анимации ---------- */
@media (prefers-reduced-motion: reduce) {
    .bg-grid,
    .img-wrapper::before {
        animation: none;
    }
    .card,
    .btn,
    .lang-btn {
        transition: none;
    }
}
