/* ===== CSS Variables ===== */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #1a1a1a;
    --math-red: #c0392b;
    --code-bg: #1e1e1e;
    --success: #27ae60;
    --warning: #f39c12;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    color: var(--primary);
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1rem;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "{ }";
    position: absolute;
    font-size: 40vw;
    opacity: 0.03;
    right: -10%;
    top: -20%;
    font-family: monospace;
    font-weight: bold;
    pointer-events: none;
}

.math-formula {
    font-family: 'Times New Roman', serif;
    font-size: 2.5rem;
    margin: 2rem 0;
    color: var(--light);
}

.math-formula i {
    color: var(--accent);
    font-style: italic;
}

.math-formula sup {
    font-size: 1.5rem;
    vertical-align: super;
}

.empty-set {
    color: var(--accent);
}

.manifesto {
    font-size: 1.8rem;
    font-weight: 300;
    margin: 2rem 0;
    letter-spacing: 2px;
}

.manifesto span {
    color: var(--secondary);
    font-weight: bold;
}

.hero-subtitle {
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Navigation ===== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===== Sections ===== */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary);
    margin: 10px auto;
}

/* ===== Professional Manifesto ===== */
.professional-manifesto {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--secondary);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.manifesto-text {
    font-size: 1.2rem;
    max-width: 900px;
    margin: 0 auto 2rem;
    line-height: 1.7;
    color: #333;
}

.expertise-tags {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.expertise-tag {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.expertise-tag:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* ===== Project Cards ===== */
.project-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 5px solid var(--secondary);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.5rem;
    color: var(--primary);
}

.project-tag {
    background: var(--secondary);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-tag.coming-soon {
    background: var(--warning);
}

.project-description {
    margin-bottom: 1.5rem;
    color: #555;
}

/* ===== Features ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feature {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 3px solid var(--accent);
    transition: var(--transition);
}

.feature:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.feature h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

/* ===== Project Highlights ===== */
.project-highlights {
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.highlight {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
    color: #2c3e50;
}

.highlight i {
    color: #3498db;
    font-size: 1.1rem;
    min-width: 20px;
}

.highlight span {
    font-size: 0.95rem;
}

/* ===== Project Use Cases ===== */
.project-use-cases {
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.project-use-cases h5 {
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-use-cases h5:before {
    content: "📌";
    font-size: 0.9rem;
}

.project-use-cases ul {
    list-style-type: none;
    padding-left: 0;
}

.project-use-cases li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

.project-use-cases li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* ===== Project Actions ===== */
.project-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
}

.action-hint {
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-hint i {
    font-size: 0.8rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    letter-spacing: 0.5px;
}

/* Эффект свечения при наведении */
.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s ease;
}

.project-link:hover::before {
    left: 100%;
}

.project-link:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c5a7a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

/* Анимация пульсации для рабочей кнопки (не disabled) */
.project-link:not(.disabled) {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
}

/* Стили для иконки внешней ссылки */
.project-link i.fa-external-link-alt {
    font-size: 0.9em;
    margin-right: 3px;
}

/* Стили для отключенной кнопки */
.project-link.disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: 0 4px 10px rgba(149, 165, 166, 0.3);
    animation: none;
}

.project-link.disabled:hover {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    transform: none;
    box-shadow: 0 4px 10px rgba(149, 165, 166, 0.3);
}

.project-link.disabled::before {
    display: none;
}

/* Анимация для иконки часов в отключенной кнопке */
.project-link.disabled i.fa-clock {
    animation: rotate-clock 3s infinite linear;
}

@keyframes rotate-clock {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== Philosophy Grid ===== */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.philosophy-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.philosophy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.philosophy-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Цвета иконок для философии */
.philosophy-card:nth-child(1) .philosophy-icon { color: var(--secondary); }
.philosophy-card:nth-child(2) .philosophy-icon { color: var(--accent); }
.philosophy-card:nth-child(3) .philosophy-icon { color: #9b59b6; }
.philosophy-card:nth-child(4) .philosophy-icon { color: #1abc9c; }
.philosophy-card:nth-child(5) .philosophy-icon { color: #f39c12; }
.philosophy-card:nth-child(6) .philosophy-icon { color: #3498db; }

/* ===== About Section ===== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.quote {
    font-style: italic;
    color: #555;
    border-left: 3px solid var(--secondary);
    padding-left: 1rem;
    margin-top: 1rem;
}

/* ===== Contact Section ===== */
.contact-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    margin-top: 1rem;
}

.contact-form-wrapper, .contact-info-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #e1e8ed;
    transition: var(--transition);
    height: fit-content;
}

.contact-form-wrapper:hover, .contact-info-wrapper:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.form-header, .info-header {
    background: linear-gradient(135deg, var(--primary) 0%, #2c5282 100%);
    color: white;
    padding: 1.5rem 2rem;
}

.form-header h3, .info-header h3 {
    color: white;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
}

.form-subtitle, .info-subtitle {
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
}

.contact-form {
    padding: 2rem;
}

.form-row {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}

.form-group label i {
    color: var(--secondary);
    font-size: 0.9em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
    max-height: 300px;
    line-height: 1.5;
    transition: min-height 0.3s ease;
}

.form-group textarea:focus {
    min-height: 180px;
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-hint i {
    font-size: 0.8em;
}

.char-counter {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #95a5a6;
}

#char-count {
    font-weight: 600;
    color: var(--primary);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c5a7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.submit-btn .loading-icon {
    display: none;
    font-size: 1em;
}

.submit-btn.sending .btn-text {
    opacity: 0.7;
}

.submit-btn.sending .loading-icon {
    display: block;
    position: absolute;
}

.form-note {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.contact-info {
    padding: 0;
}

.contact-tips {
    padding: 1.5rem;
}

.tip {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.tip i {
    color: var(--secondary);
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.tip:last-child {
    margin-bottom: 0;
}

/* Form Status Messages */
.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ===== Footer ===== */
footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 1rem;
}

.footer-quote {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#ip-display {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.6;
    font-family: monospace;
}