:root {
    --bg-cream: #fbf8ee;
    --navy-primary: #002e5e;
    --navy-hover: #001f40;
    --navy-light: #e8eef5;
    --text-muted: #536479;
    --border-color: #e5e0d3;
}

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

body.home-landing-body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-cream);
    color: var(--navy-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================
   1. Header Navigation
   ========================================================== */
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 60px;
    background: transparent;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.minimal-icon {
    width: 28px;
    height: 28px;
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--navy-primary);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.landing-nav .nav-item,
.landing-nav .nav-btn {
    text-decoration: none;
    background: transparent;
    border: none;
    color: var(--navy-primary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Prompt', sans-serif;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.landing-nav .nav-item:hover,
.landing-nav .nav-btn:hover {
    background-color: var(--navy-light);
    color: var(--navy-hover);
}

/* ==========================================================
   2. Main Layout (Hero Section)
   ========================================================== */
/* 1. เปลี่ยนการจัดแนวตั้งให้ดันขึ้นด้านบนเล็กน้อย หรือยึดกึ่งกลางพอดี */
.hero-section {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center; /* หรือปรับเป็น flex-start หากต้องการให้ขอบบนเท่ากันเป๊ะ */
    padding: 20px 50px 40px;
    gap: 40px;
}

.hero-content {
    width: 100%;
    max-width: 580px;
}

.project-pill {
    display: inline-block;
    background-color: var(--navy-light);
    color: var(--navy-primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 46, 94, 0.08);
}

.hero-title {
    font-size: 3rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 16px;
}

.highlight-text {
    color: #175496;
}

.hero-desc {
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 24px;
    word-break: break-word;
}

.action-wrap {
    margin-bottom: 30px;
}

.btn-portal-entry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--navy-primary);
    color: #ffffff;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: 25px;
    font-size: 0.98rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 46, 94, 0.2);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-portal-entry:hover {
    background-color: var(--navy-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 46, 94, 0.3);
}

/* ==========================================================
   3. Technology Stack Badges
   ========================================================== */
.tech-section {
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.tech-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #8391a2;
    margin-bottom: 12px;
}

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

.tech-chip {
    background-color: #ffffff;
    color: var(--navy-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    white-space: nowrap;
}

/* ==========================================================
   4. Hero Graphic & Diagram Card (แก้รูปเล็กกรอบใหญ่)
   ========================================================== */
/* 2. ดึงการ์ดรูปฝั่งขวาให้ยกตัวขึ้นเล็กน้อย */
.hero-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: -30px; /* ดึงการ์ดรูปยกขึ้นมาให้ระนาบตรงกับหัวข้อ Smart Village */
}

.diagram-surface {
    width: 100%;
    max-width: 680px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 8px; /* ขอบชิด เพื่อให้รูปภาพขยายได้เต็มที่โดยไม่เหลือก้นกรอบขาว */
    box-shadow: 0 14px 35px rgba(0, 46, 94, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    animation: floatingHero 4.5s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.diagram-surface:hover {
    animation-play-state: paused;
    transform: translateY(-6px);
}

.diagram-surface img {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: contain; /* แสดงรูปเต็มตัวโดยไม่โดนบีบสัดส่วน */
    display: block;
    border-radius: 18px;
}

@keyframes floatingHero {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* ==========================================================
   5. Modals (About & Team)
   ========================================================== */
.info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 46, 94, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.info-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.info-modal-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 620px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px 28px;
    box-shadow: 0 16px 40px rgba(0, 46, 94, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 26px;
    color: #8898aa;
    cursor: pointer;
}

.btn-close-modal:hover {
    color: #dc3545;
}

.modal-body {
    color: #334e68;
    font-size: 0.92rem;
    line-height: 1.65;
    word-break: break-word;
}

.modal-body h4 {
    color: var(--navy-primary);
    font-size: 1rem;
    margin: 14px 0 6px 0;
}

.modal-feature-list {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-feature-list li {
    word-break: break-word;
    line-height: 1.55;
}

.team-grouped-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.team-group-block {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
}

.group-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-color);
}

.group-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.member-card {
    background-color: var(--bg-cream);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy-primary);
}

.member-role {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.advisor-box {
    background-color: var(--navy-light);
    border-left: 4px solid var(--navy-primary);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.84rem;
}

.advisor-box .sub-advisor {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ==========================================================
   6. Responsive Layout (มือถือ และ แท็บเล็ต)
   ========================================================== */
@media (max-width: 900px) {
    .landing-header {
        padding: 18px 24px;
        flex-direction: column;
        gap: 14px;
    }

    .landing-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .landing-nav .nav-item,
    .landing-nav .nav-btn {
        font-size: 0.88rem;
        padding: 6px 10px;
    }

    /* สลับเป็น 1 คอลัมน์เดี่ยวเต็มความกว้าง */
    .hero-section {
        display: flex;
        flex-direction: column;
        padding: 10px 20px 40px;
        gap: 24px;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        order: 1; /* ข้อความอยู่บน */
    }

    .hero-title {
        font-size: 2.2rem;
        word-break: break-word;
    }

    .project-pill {
        margin: 0 auto 12px;
    }

    .action-wrap {
        display: flex;
        justify-content: center;
    }

    .btn-portal-entry {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    .tech-badges {
        justify-content: center;
    }

    /* การ์ดรูปภาพบนจอมือถือ */
    .hero-graphic {
        order: 2; /* รูปภาพอยู่ถัดลงมา */
        width: 100%;
        margin-top: 0; /* รีเซ็ตบนมือถือ */
    }

    .diagram-surface {
        max-width: 440px;
        padding: 6px;
        border-radius: 16px;
        animation: none; /* ปิดแอนิเมชันลอยบนมือถือเพื่อความลื่นไหล */
    }

    .diagram-surface img {
        max-height: 280px;
    }

    .group-cards {
        grid-template-columns: 1fr;
    }
}
