:root {
    --bg-color: #121214;
    --surface-color: #1a1a1e;
    --accent-color: #0070f3;
    --text-color: #e4e4e7;
    --text-muted: #a1a1aa;
    --border-color: #2d2d34;
    --header-height: 70px;
    --footer-height: 50px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    flex-shrink: 0;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
}

.logo a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-color);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

main {
    flex-grow: 1;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow: hidden;
    position: relative;
}

footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.page-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.carousel-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.carousel-section h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem 4rem;
    overflow: hidden;
}

.carousel-track-wrapper {
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.project-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-slide h3 a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.8rem;
}

.project-slide h3 a:hover {
    color: var(--accent-color);
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.tech-tag {
    background-color: #27272a;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.project-slide p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #27272a;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.5rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.carousel-btn:hover {
    background: var(--border-color);
}

.btn-prev { left: 1rem; }
.btn-next { right: 1rem; }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    flex-grow: 1;
    min-height: 0;
}

.about-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-info p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contacts-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 8px;
}

.contacts-card h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.contacts-card p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
}

.map-box {
    width: 100%;
    height: 100%;
    max-height: 450px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.map-box iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.order-section {
    max-width: 650px;
    width: 100%;
    margin: 0 auto;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 8px;
}

.order-section h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input, .form-group textarea {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    width: 100%;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: none;
}

.submit-btn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.submit-btn:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-message {
    text-align: center;
    font-size: 0.95rem;
    min-height: 24px;
}

.project-detail-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: center;
    flex-grow: 1;
    min-height: 0;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.back-link:hover {
    color: var(--text-color);
}

.project-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    min-height: 0;
}

.project-scrollable {
    overflow-y: auto;
    padding-right: 1rem;
    max-height: 320px;
}

.project-scrollable::-webkit-scrollbar {
    width: 6px;
}

.project-scrollable::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.project-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.project-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tech-tag-detail {
    background-color: #27272a;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #d4d4d8;
}

.project-image-box {
    width: 100%;
    height: 100%;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media screen and (max-width: 768px) {
    body {
        height: auto;
        overflow: auto;
    }
    main {
        height: auto;
        overflow: visible;
    }
    .page-container {
        height: auto;
        padding: 2rem 1rem;
    }
    .nav-links {
        position: fixed;
        right: 0px;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        background-color: var(--surface-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.3s ease-in;
        z-index: 999;
        padding-top: 3rem;
        border-top: 1px solid var(--border-color);
    }
    .nav-links.active {
        transform: translateX(0%);
    }
    .burger {
        display: block;
    }
    .about-grid, .project-detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .map-box {
        height: 300px;
    }
    .carousel-container {
        padding: 2rem 1rem;
    }
    .carousel-btn {
        display: none;
    }
    .project-scrollable {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    .project-image-box {
        height: 250px;
    }
}

.demo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.demo-modal-content {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.demo-modal-content h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.demo-modal-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.demo-modal-btn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.demo-modal-btn:hover {
    background-color: #0056b3;
}
