:root {
    /* Color Palette */
    --orange: #F7931A;
    --orange-glow: rgba(247, 147, 26, 0.4);
    --orange-light: #FFB84D;
    --black: #050505;
    --gray-900: #0A0A0A;
    --gray-800: #121212;
    --gray-700: #1E1E1E;
    --gray-border: #2A2A2A;
    --text-main: #FFFFFF;
    --text-muted: #A1A1AA;
    
    /* Spacing & Ratio */
    --section-gap: clamp(3rem, 6vh, 6rem);
    --container-width: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Sans Thai', -apple-system, sans-serif;
    background-color: var(--black);
    color: var(--text-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Ambient Glow Background */
.glow-bg {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 50% 0%, rgba(247,147,26,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(247,147,26,0.03) 0%, transparent 30%);
    z-index: -1;
    pointer-events: none;
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--black);
    box-shadow: 0 0 20px var(--orange-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-main); }

.nav-cta {
    background: var(--text-main) !important;
    color: var(--black) !important;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-weight: 600 !important;
    transition: transform 0.2s !important;
}

.nav-cta:hover { transform: scale(1.05); }

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero */
.hero {
    min-height: auto; 
    display: flex;
    align-items: center;
    padding-top: 140px; 
    padding-bottom: 2rem; 
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--orange);
    filter: blur(40px);
    opacity: 0.2;
    z-index: -1;
}

.hero-sub {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    font-weight: 300;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), #EA8812);
    color: var(--black);
    box-shadow: 0 8px 20px -6px var(--orange-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -8px var(--orange-glow);
}

.btn-outline {
    background: rgba(255,255,255,0.03);
    color: var(--text-main);
    border-color: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    border-color: var(--orange);
    background: rgba(247, 147, 26, 0.1);
}

/* Stats Section */
.stats {
    padding: 2rem 0;
    border-top: 1px solid var(--gray-border);
    border-bottom: 1px solid var(--gray-border);
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(10px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}

.stat-item {
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--gray-border);
}

.stat-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.stat-label {
    color: var(--orange);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Sections */
section { padding: var(--section-gap) 0; }

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- UNIFIED CARD STYLES --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--gray-800);
    border: 1px solid var(--gray-border);
    border-radius: 24px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; 
}

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

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: 0.5s;
}
.card:hover::after { left: 100%; }

.card.featured {
    background: linear-gradient(160deg, rgba(247,147,26,0.1), var(--gray-800));
    border: 1px solid rgba(247,147,26,0.3);
}

.card.featured .card-icon {
    background: var(--orange);
    color: var(--black);
    box-shadow: 0 0 20px var(--orange-glow);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    background: var(--gray-700);
    transition: all 0.3s;
}

.card-icon.fb { color: #1877F2; background: rgba(24, 119, 242, 0.1); }
.card-icon.line { color: #06C755; background: rgba(6, 199, 85, 0.1); }
.card-icon.discord { color: #5865F2; background: rgba(88, 101, 242, 0.1); }
.card-icon.map { color: var(--orange); background: rgba(247, 147, 26, 0.1); }
.card-icon.event { color: #FF5252; background: rgba(255, 82, 82, 0.1); }

/* Typography Fixes for Thai */
.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    min-height: 3rem; 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    /* แก้ปัญหาคำตกบรรทัดภาษาไทย */
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem; 
    flex-grow: 1; 

    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ปรับให้ description สามารถขยายได้บน mobile */
.card p.event-description {
    max-height: 4.8rem;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card p.event-description.expanded {
    max-height: 1000px;
}

.expand-btn {
    display: none; /* ซ่อนไว้ตามปกติ */
    background: none;
    border: none;
    color: var(--orange);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    text-align: left;
    width: 100%;
}

.expand-btn:hover {
    text-decoration: underline;
}

.card-arrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: auto; 
}

.card-arrow::after {
    content: '→';
    transition: transform 0.3s;
}

.card:hover .card-arrow { color: var(--orange); }
.card:hover .card-arrow::after { transform: translateX(5px); }

/* Button inside Card */
.card-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--gray-border);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    margin-top: auto;
    transition: 0.2s;
    cursor: pointer;
    user-select: none;
}
.card-btn:hover {
    background: var(--orange);
    color: var(--black);
    border-color: var(--orange);
}

/* Event Date Badge */
.event-date {
    display: inline-block;
    background: rgba(247, 147, 26, 0.2);
    color: var(--orange);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    position: relative;
}

@media(min-width: 768px) {
    .steps::before {
        content: '';
        position: absolute;
        top: 24px;
        left: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--gray-border), transparent);
        z-index: -1;
    }
}

.step {
    text-align: center;
    background: var(--black);
    padding: 0 1rem;
}

.step-num {
    width: 50px;
    height: 50px;
    background: var(--gray-800);
    border: 1px solid var(--gray-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--orange);
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 0 8px var(--black);
}

.step:hover .step-num {
    border-color: var(--orange);
    color: var(--white);
    background: var(--orange);
    box-shadow: 0 0 20px var(--orange-glow);
}

.step h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; }

/* CTA */
.cta-box {
    background: radial-gradient(circle at top right, rgba(247,147,26,0.1), transparent 60%), var(--gray-800);
    border: 1px solid var(--gray-border);
    border-radius: 32px;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.cta-box h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--gray-border);
    transition: background 0.2s;
}

.faq-q {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    user-select: none;
}

.faq-q:hover { color: var(--orange); }

.faq-icon {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--orange);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-a {
    max-height: 1000px; 
}

.faq-a-inner {
    padding-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 90%;
}

.faq-a-inner ul { padding-left: 1.25rem; margin-top: 0.5rem; }
.faq-a-inner li { margin-bottom: 0.5rem; }

/* Footer */
footer {
    border-top: 1px solid var(--gray-border);
    padding: 4rem 0 2rem;
    background: var(--gray-900);
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5,5,5,0.98);
    z-index: 999;
    padding: 6rem 2rem;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.mobile-menu.active { display: flex; }

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-border);
}

.mobile-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2.5rem;
}

/* --- Modal Styles --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--gray-800);
    border: 1px solid var(--gray-border);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

.modal-header { text-align: center; margin-bottom: 1.5rem; }
.modal-header h3 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 0.5rem; }
.modal-header p { font-size: 0.9rem; color: var(--text-muted); }

/* คำเตือนนโยบาย BTC Map */
.policy-notice {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid rgba(247, 147, 26, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.policy-notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.policy-notice-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.policy-notice-text strong {
    color: var(--orange);
    font-weight: 600;
}

.form-group { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label { display: block; color: var(--orange); font-size: 0.85rem; margin-bottom: 0.5rem; font-weight: 500; }

input, select, textarea {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--gray-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

input:focus, select:focus, textarea:focus { border-color: var(--orange); }

/* Mobile Swipe Hint */
.swipe-hint {
    display: none;
    text-align: right;
    font-size: 0.75rem;
    color: var(--orange);
    margin-bottom: 0.5rem;
    font-weight: 500;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}
.swipe-hint span { animation: pulse 1.5s infinite; }

@keyframes pulse {
    0% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
    100% { opacity: 0.5; transform: translateX(0); }
}

/* Responsive Styles & Mobile Slider */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .menu-btn { display: block; }
    
    .hero { text-align: center; padding-top: 120px; }
    .hero-content { margin: 0 auto; }
    .hero-btns { justify-content: center; }
    
    .stats-grid { 
        grid-template-columns: 1fr; 
        gap: 2rem;
    }
    .stat-item:not(:last-child)::after { display: none; }
    
    .footer-content { flex-direction: column; gap: 3rem; }

    .swipe-hint { display: flex; }

    /* Mobile Horizontal Slide */
    .cards-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding: 10px 1rem 2rem 1rem;
        -webkit-overflow-scrolling: touch;
        align-items: stretch;
    }

    .card {
        flex: 0 0 280px; 
        width: 280px;
        padding: 1.5rem;
        scroll-snap-align: center;
        display: flex;
        flex-direction: column;
    }

    /* แสดงปุ่ม "อ่านเพิ่มเติม" บน mobile เมื่อ description ยาวเกินไป */
    .expand-btn {
        display: block;
    }
}

