/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0a1628;
    --navy-mid:   #112240;
    --navy-light: #1a3a6e;
    --green:      #00c853;
    --green-dark: #00a843;
    --blue:       #4fc3f7;
    --blue-dark:  #0288d1;
    --white:      #ffffff;
    --gray:       #8892a4;
    --bg:         #f0f4ff;
    --card-bg:    #ffffff;
    --radius:     16px;
    --shadow:     0 8px 32px rgba(10,22,40,.12);
    --shadow-lg:  0 20px 60px rgba(10,22,40,.18);
    --transition: 0.35s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans Thai', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--navy);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== PARTICLES ===== */
#particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: .35;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 10px 40px;
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    transition: box-shadow var(--transition);
}
.header.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}
.logo-wrap {
    display: flex;
    align-items: center;
}
.logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    display: block;
}
.logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--green), var(--blue));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
}
.logo-text { display: flex; flex-direction: column; }
.logo-main {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
    line-height: 1.1;
}
.logo-sub {
    font-size: 9px;
    font-weight: 600;
    color: var(--green);
    letter-spacing: 2px;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #0d2954 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

/* Floating shapes */
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .15;
}
.shape-1 {
    width: 500px; height: 500px;
    background: var(--green);
    top: -100px; right: -100px;
    animation: float1 8s ease-in-out infinite;
}
.shape-2 {
    width: 350px; height: 350px;
    background: var(--blue);
    bottom: -80px; left: -80px;
    animation: float2 10s ease-in-out infinite;
}
.shape-3 {
    width: 250px; height: 250px;
    background: #7c4dff;
    top: 40%; left: 40%;
    animation: float3 12s ease-in-out infinite;
}
@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-30px,20px) scale(1.05)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(20px,-30px) scale(1.08)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-20px,15px) scale(.95)} }

.hero-container {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    padding: 140px 40px 80px;
    display: grid;
    grid-template-columns: 1fr 1.65fr;
    gap: 56px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,200,83,.15);
    border: 1px solid rgba(0,200,83,.3);
    color: var(--green);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: .5px;
}

.hero-title {
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 20px;
}
.text-green  { color: var(--green); }
.text-light-blue { color: var(--blue); }

.hero-desc {
    font-size: 16px;
    color: rgba(255,255,255,.7);
    margin-bottom: 36px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}
.stat { text-align: center; }
.stat-num {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--green);
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    color: rgba(255,255,255,.55);
    margin-top: 4px;
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,.15);
}

/* Image card */
.hero-image { position: relative; }

.image-card {
    position: relative;
    border-radius: 24px;
    overflow: visible;
    animation: heroFloat 5s ease-in-out infinite;
}
@keyframes heroFloat {
    0%,100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-16px) scale(1.01); }
}

/* blurred glow behind the image */
.image-card::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(0,200,83,.35), rgba(79,195,247,.25));
    filter: blur(40px);
    z-index: -1;
    animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
    0%,100% { opacity: .7; transform: scale(1); }
    50%      { opacity: 1;  transform: scale(1.04); }
}

/* animated rainbow border */
.image-card::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--green), var(--blue), #7c4dff, var(--green));
    background-size: 300% 300%;
    animation: borderShift 4s linear infinite;
    z-index: -1;
}
@keyframes borderShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.banner-img {
    width: 100%;
    display: block;
    border-radius: 22px;
    box-shadow: 0 40px 100px rgba(0,0,0,.55);
}
.image-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,200,83,.06), rgba(79,195,247,.06));
    border-radius: 22px;
    pointer-events: none;
}

/* Scroll hint */
.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.4);
    font-size: 11px;
    letter-spacing: 1px;
}
.scroll-icon {
    width: 32px; height: 32px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    animation: bounceDown 2s ease-in-out infinite;
}
@keyframes bounceDown {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* ===== TUTORIALS SECTION ===== */
.tutorials {
    position: relative;
    z-index: 1;
    padding: 100px 0 120px;
}

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

.section-header {
    text-align: center;
    margin-bottom: 64px;
}
.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(0,200,83,.12), rgba(79,195,247,.12));
    border: 1px solid rgba(0,200,83,.25);
    color: var(--green-dark);
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: .5px;
}
.section-title {
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 12px;
}
.section-desc {
    font-size: 16px;
    color: var(--gray);
}

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 36px 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.06);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green), var(--blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.card:hover::before { transform: scaleX(1); }

.card-number {
    position: absolute;
    top: 20px; right: 24px;
    font-size: 52px;
    font-weight: 800;
    color: rgba(0,0,0,.04);
    line-height: 1;
    user-select: none;
    font-family: 'Inter', sans-serif;
}

.card-icon-wrap { margin-bottom: 20px; }
.card-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, rgba(0,200,83,.1), rgba(79,195,247,.1));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: var(--green-dark);
    transition: transform var(--transition), background var(--transition);
}
.card:hover .card-icon {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: #fff;
    transform: rotate(-5deg) scale(1.05);
}

.card-body { flex: 1; margin-bottom: 24px; }
.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
    line-height: 1.3;
}
.card-role {
    font-size: 13px;
    color: var(--green-dark);
    font-weight: 600;
    margin-bottom: 12px;
}
.card-desc {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.7;
}

.card-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--green), #00b041);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,200,83,.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #00e65c, var(--green));
    box-shadow: 0 6px 20px rgba(0,200,83,.4);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--navy-light);
    border: 1.5px solid rgba(10,22,40,.15);
}
.btn-outline:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--navy);
    padding: 32px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}
.footer-logo i { color: var(--green); font-size: 18px; }
.footer-copy {
    color: rgba(255,255,255,.35);
    font-size: 12px;
}

/* ===== ANIMATIONS (Scroll Reveal) ===== */
.reveal-up, .reveal-left, .reveal-right {
    opacity: 0;
    transition: opacity .7s ease, transform .7s ease;
}
.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: none;
}

.card.reveal-up {
    transition-delay: var(--delay, 0ms);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .hero-container {
        grid-template-columns: 1fr;
        padding: 100px 24px 60px;
        text-align: center;
    }
    .hero-stats { justify-content: center; }
    .hero-image { order: -1; max-width: 480px; margin: 0 auto; }
    .cards-grid { grid-template-columns: 1fr; }
    .header { padding: 14px 24px; }
}
@media (max-width: 600px) {
    .container { padding: 0 20px; }
    .tutorials { padding: 60px 0 80px; }
    .card { padding: 28px 20px 20px; }
    .card-buttons { flex-direction: column; }
    .btn { justify-content: center; }
    .footer { padding: 24px 20px; }
}
