*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito','Noto Sans Thai', sans-serif; background: #fff; color: #0f172a; min-height: 100vh; }

/* ── HERO ────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px 100px;
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(254,202,202,.7) 0%, transparent 65%),
        radial-gradient(ellipse 45% 35% at 10% 90%, rgba(252,165,165,.25) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 90% 80%, rgba(252,165,165,.2) 0%, transparent 60%),
        #fff;
}
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px);
    background-size: 56px 56px;
}
[data-theme="dark"] body { background: #100608; color: #fff; }
[data-theme="dark"] .hero-bg {
    background:
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(220,38,38,.55) 0%, transparent 65%),
        radial-gradient(ellipse 45% 35% at 10% 90%, rgba(185,28,28,.25) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 90% 80%, rgba(239,68,68,.15) 0%, transparent 60%),
        #100608;
}
[data-theme="dark"] .hero-bg::after {
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 56px 56px;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo */
.hero-logo-wrap {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 28px;
    background: rgba(220,38,38,.08);
    border: 1px solid rgba(220,38,38,.2);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 40px rgba(220,38,38,.18);
}
[data-theme="dark"] .hero-logo-wrap {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.1);
    box-shadow: 0 8px 40px rgba(220,38,38,.25);
}
.hero-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* Tag */
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(220,38,38,.1);
    border: 1px solid rgba(239,68,68,.35);
    border-radius: 100px;
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 28px;
}
.hero-tag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    flex-shrink: 0;
}
[data-theme="dark"] .hero-tag { background: rgba(220,38,38,.18); border-color: rgba(239,68,68,.45); color: #fca5a5; }

/* Title */
.hero-title {
    font-family: 'Nunito', sans-serif !important;
    font-size: clamp(36px, 5.5vw, 60px) !important;
    font-weight: 900 !important;
    line-height: 1.08;
    margin-bottom: 22px;
    color: #0f172a;
}
.hero-title span {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 60%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="dark"] .hero-title { color: #fff; }
[data-theme="dark"] .hero-title span {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 40%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sub */
.hero-sub {
    font-size: 16px;
    color: #64748b;
    font-weight: 600;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 38px;
}
[data-theme="dark"] .hero-sub { color: rgba(255,255,255,.48); }

/* CTA */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 13px 30px;
    border-radius: 12px;
    text-decoration: none;
    transition: opacity .2s, transform .2s;
    box-shadow: 0 10px 36px rgba(220,38,38,.45);
}
.hero-cta:hover { opacity: .88; transform: translateY(-2px); }

/* Scroll indicator */
.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(15,23,42,.28);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
    animation: bob 2s ease-in-out infinite;
}
[data-theme="dark"] .hero-scroll { color: rgba(255,255,255,.25); }
@keyframes bob {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(7px); }
}

/* ── PORTFOLIO SECTION ──────────────────────────────── */
.portfolio-section {
    background: #f8fafc;
    padding: 80px 24px 100px;
}
.section-wrap { max-width: 1100px; margin: 0 auto; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 16px;
}
.section-label {
    font-size: 11.5px;
    font-weight: 800;
    color: #dc2626;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.section-title {
    font-family: 'Nunito', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}
.section-count {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
    padding-bottom: 4px;
}

/* ── PORTFOLIO GRID ─────────────────────────────────── */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

/* ── PORTFOLIO CARD ─────────────────────────────────── */
.p-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: box-shadow .22s, transform .22s;
}
.p-card:hover {
    box-shadow: 0 16px 48px rgba(15,23,42,.12);
    transform: translateY(-4px);
}
.p-card-thumb {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}
.p-card-thumb img.org-img {
    max-width: 75%;
    max-height: 130px;
    object-fit: contain;
}
.initial-wrap {
    width: 90px;
    height: 90px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.p-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.p-card-title {
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}
.p-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}
.p-card-meta i { color: #dc2626; font-size: 11px; }
.p-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 4px;
}
.p-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 800;
    transition: background .15s, color .15s;
}
.p-card:hover .p-card-btn {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}
.p-card-arrow {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 12px;
    transition: background .15s, color .15s;
}
.p-card:hover .p-card-arrow { background: #dc2626; color: #fff; }

/* ── EMPTY STATE ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: #94a3b8;
}
.empty-state i { font-size: 48px; display: block; margin-bottom: 16px; color: #cbd5e1; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: #334155; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── FOOTER ─────────────────────────────────────────── */
.footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    padding: 28px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}
.footer .brand { color: #dc2626; }
[data-theme="dark"] .footer { background: #0d1117; border-color: rgba(255,255,255,.06); color: #718096; }
[data-theme="dark"] .footer .brand { color: #fc8181; }

/* ── DARK MODE: PORTFOLIO SECTION ───────────────────── */
/* Hero section stays dark always — only portfolio section toggles */
[data-theme="dark"] .portfolio-section { background: #0f172a; }
[data-theme="dark"] .section-title { color: #f1f5f9; }
[data-theme="dark"] .section-count { color: #64748b; }
[data-theme="dark"] .p-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .p-card:hover { box-shadow: 0 16px 48px rgba(0,0,0,.5); }
[data-theme="dark"] .p-card-thumb { background: #162032; }
[data-theme="dark"] .p-card-title { color: #f1f5f9; }
[data-theme="dark"] .p-card-meta { color: #64748b; }
[data-theme="dark"] .p-card-btn { background: rgba(220,38,38,.2); color: #fca5a5; }
[data-theme="dark"] .p-card:hover .p-card-btn { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
[data-theme="dark"] .p-card-arrow { background: #0f172a; color: #64748b; }
[data-theme="dark"] .p-card:hover .p-card-arrow { background: #dc2626; color: #fff; }
[data-theme="dark"] .empty-state { color: #64748b; }
[data-theme="dark"] .empty-state h3 { color: #94a3b8; }
[data-theme="dark"] .empty-state i { color: #334155; }

/* ── PALETTE ────────────────────────────────────────── */
.pal-red     { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.pal-orange  { background: linear-gradient(135deg, #c2410c, #fb923c); }
.pal-rose    { background: linear-gradient(135deg, #be123c, #fb7185); }
.pal-violet  { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.pal-blue    { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.pal-emerald { background: linear-gradient(135deg, #065f46, #34d399); }
.pal-slate   { background: linear-gradient(135deg, #334155, #94a3b8); }
