/* ===== Variables ===== */
:root {
    --brand: #d10000;
    --brand-light: #ff3333;
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-dark: #0a0a0a;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e5e5e5;
    --border-dark: #2a2a2a;
}

/* ===== Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 24px;
    background: transparent;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
}

.nav-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
}

.logo-img {
    height: auto;
    width: 200px;
    transition: opacity 0.3s;
}

.logo:hover .logo-img {
    opacity: 0.7;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--brand);
}

.lang-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.lang-toggle:hover {
    color: var(--brand);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-primary);
}

#physics-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    animation: fadeInUp 1s ease forwards;
}

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

.hero-logo {
    font-size: clamp(5rem, 18vw, 12rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    user-select: none;
}

.hero-logo span {
    display: inline-block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.hero-logo span:hover {
    transform: scale(1.1) rotate(-5deg);
    color: var(--brand);
}

.hero-logo .letter-red {
    color: var(--brand);
}

.hero-tagline {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease 0.2s forwards;
    opacity: 0;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s forwards;
    opacity: 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 36px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--brand);
    color: white;
}

.btn-primary:hover {
    background: #b80000;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    z-index: 10;
    animation: fadeInUp 1s ease 0.6s forwards, bounce 2s ease-in-out infinite 1.6s;
    opacity: 0;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== Sections ===== */
.section {
    padding: 120px 0;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    line-height: 1.1;
}

.section-header-tech {
    margin-bottom: 64px;
}

.section-desc {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--text-secondary);
}

/* ===== About ===== */
.about {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-left {
    padding-right: 40px;
}

.about-text {
    font-size: clamp(1.125rem, 1.5vw, 1.375rem);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 48px;
}

.about-stats-row {
    display: flex;
    gap: 32px;
}

.stat-item {
    text-align: left;
}

.stat-num {
    display: block;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.stat-txt {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-right {
    padding-left: 40px;
    border-left: 1px solid var(--border);
}

.about-card-tech {
    position: relative;
    padding-left: 24px;
    margin-bottom: 32px;
}

.card-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--brand);
}

.card-icon {
    width: 40px;
    height: 40px;
    color: var(--brand);
    margin-bottom: 16px;
}

.about-card-tech h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 16px;
}

.about-card-tech p {
    font-size: clamp(1rem, 1.25vw, 1.125rem);
    color: var(--text-secondary);
    line-height: 1.7;
}

.tech-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.pill:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ===== Projects ===== */
.projects {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.projects-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.project-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.project-item:hover {
    background: #fafafa;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.project-visual {
    position: relative;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.project-item:hover .project-visual img {
    transform: scale(1.05);
}

.project-visual-logo img {
    width: 70%;
    height: auto;
    object-fit: contain;
    padding: 24px;
}

.project-visual-text {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.visual-text {
    font-size: 1.75rem;
    font-weight: 700;
}

.project-status {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-number {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.project-info h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.project-item:hover .project-info h3 {
    color: var(--brand);
}

.project-info p {
    font-size: clamp(0.9375rem, 1.25vw, 1.0625rem);
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex: 1;
}

.project-arrow {
    color: var(--text-muted);
    transition: all 0.3s;
    margin-top: auto;
}

.project-item:hover .project-arrow {
    color: var(--brand);
    transform: translateX(4px);
}

/* ===== Technologies ===== */
.technologies {
    background: var(--bg-dark);
    color: #ffffff;
    border-top: 1px solid var(--border-dark);
}

.technologies .section-label {
    color: var(--brand);
}

.technologies .section-desc {
    color: #888888;
}

.tech-showcase {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-dark);
}

.tech-block {
    background: var(--bg-dark);
    padding: 48px;
    transition: background 0.3s;
}

.tech-block:hover {
    background: #0f0f0f;
}

.tech-block-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.tech-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand);
}

.tech-line {
    flex: 1;
    height: 1px;
    background: var(--border-dark);
}

.tech-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.tech-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-dark);
    transition: border-color 0.3s;
}

.tech-item:hover {
    border-color: var(--brand);
}

.tech-name {
    display: block;
    font-size: clamp(1.25rem, 1.75vw, 1.5rem);
    font-weight: 500;
    margin-bottom: 6px;
}

.tech-desc {
    font-size: 0.75rem;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Contacts ===== */
.contacts {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.contacts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.contacts-left {
    padding-right: 40px;
}

.contacts-subtitle {
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-link-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s;
}

.contact-link-item:hover {
    border-color: var(--brand);
}

.contact-icon-wrap {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    transition: background 0.3s;
}

.contact-link-item:hover .contact-icon-wrap {
    background: var(--brand);
    color: white;
}

.contact-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.contact-value {
    font-size: clamp(1.0625rem, 1.25vw, 1.25rem);
    font-weight: 500;
}

.contacts-right {
    padding-left: 40px;
    border-left: 1px solid var(--border);
}

.map-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-dark);
    color: #ffffff;
    padding: 60px 0 30px;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 30px;
}

.footer-logo {
    height: auto;
    width: 160px;
    filter: brightness(0) invert(1);
    margin-bottom: 8px;
}

.footer-text {
    font-size: 0.75rem;
    color: #666666;
}

.footer-nav {
    display: flex;
    gap: 32px;
}

.footer-nav a {
    font-size: 0.875rem;
    color: #888888;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--brand);
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: #666666;
}

/* ===== Scroll to Top ===== */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--text-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--brand);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .projects-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .about-left, .about-right {
        padding: 0;
        border: none;
    }
    
    .about-right {
        padding-top: 40px;
        border-top: 1px solid var(--border);
    }
    
    .contacts-layout {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .contacts-left, .contacts-right {
        padding: 0;
        border: none;
    }
    
    .contacts-right {
        padding-top: 40px;
    }
    
    .tech-showcase {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-toggle { display: flex; }
    
    .hero-logo { font-size: clamp(3rem, 12vw, 5rem); }
    
    .projects-showcase {
        grid-template-columns: 1fr;
    }
    
    .tech-items {
        grid-template-columns: 1fr;
    }
    
    .footer-main {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .about-stats-row {
        flex-wrap: wrap;
        gap: 24px;
    }
}

/* ===== Mobile Menu ===== */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 24px;
    gap: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
