:root {
    --font-main: "Inter", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-thai: "Noto Sans Thai", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --page-bg: #f4f7fb;
    --panel-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #667085;
    --line: #dfe5ee;
    --brand: #1565d8;
    --brand-dark: #0f4fb3;
    --fresh: #10b981;
    --ink: #111827;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #0b1220;
    --panel-bg: #111827;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --line: #273449;
    --brand: #60a5fa;
    --brand-dark: #3b82f6;
    --fresh: #34d399;
    --ink: #e5e7eb;
}

body {
    min-height: 100vh;
    background: #ffffff;
    color: var(--text-main);
    font-family: var(--font-main);
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body {
    background: var(--page-bg);
}

.landing-nav {
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

:root[data-theme="dark"] .landing-nav {
    border-bottom-color: var(--line);
    background: rgba(17, 24, 39, 0.92) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    display: inline-flex;
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--fresh));
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(21, 101, 216, 0.22);
}

.brand-mark i {
    font-size: 1.35rem;
    line-height: 1;
    transform: translateY(1px);
}

.brand-mark .brand-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 9px;
    height: 9px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: #ffd166;
}

.brand-text {
    display: inline-flex;
    align-items: baseline;
    color: var(--text-main);
}

.brand-text strong {
    font-size: 1.2rem;
    font-weight: 800;
}

.brand-text small {
    color: var(--fresh);
    font-size: 1.03rem;
    font-weight: 800;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
}

.nav-link:hover {
    color: var(--brand);
}

.nav-link.active {
    color: var(--brand);
}

.theme-toggle {
    min-width: 88px;
}

.btn {
    border-radius: 9px;
    font-weight: 700;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 12px 26px rgba(21, 101, 216, 0.18);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

:root[data-theme="dark"] .btn-light {
    border-color: var(--line);
    background: #172033;
    color: var(--text-main);
}

:root[data-theme="dark"] .btn-light:hover,
:root[data-theme="dark"] .btn-light:focus-visible {
    border-color: #334155;
    background: #1f2937;
    color: #ffffff;
}

:root[data-theme="dark"] .btn-outline-secondary {
    border-color: #334155;
    color: var(--text-main);
}

:root[data-theme="dark"] .btn-outline-secondary:hover,
:root[data-theme="dark"] .btn-outline-secondary:focus-visible {
    background: #172033;
    color: #ffffff;
}

:root[data-theme="dark"] .dropdown-menu {
    border-color: var(--line);
    background: #111827;
    color: var(--text-main);
}

:root[data-theme="dark"] .dropdown-item {
    color: var(--text-main);
}

:root[data-theme="dark"] .dropdown-item:hover,
:root[data-theme="dark"] .dropdown-item:focus {
    background: #172033;
    color: #ffffff;
}

:root[data-theme="dark"] .dropdown-item.active {
    background: var(--brand-dark);
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 72px 0 64px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
}

:root[data-theme="dark"] .hero-section,
:root[data-theme="dark"] .public-hero {
    background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
}

.hero-section::before {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(21, 101, 216, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 101, 216, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
    pointer-events: none;
}

:root[data-theme="dark"] .hero-section::before,
:root[data-theme="dark"] .public-hero::before {
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.12) 1px, transparent 1px);
}

.hero-grid {
    display: grid;
    position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 0.9fr);
    align-items: center;
    gap: 54px;
}

.hero-copy h1 {
    max-width: 760px;
    margin: 18px 0 18px;
    font-family: var(--font-thai);
    font-size: clamp(2.35rem, 4.5vw, 4.7rem);
    font-weight: 800;
    line-height: 1.05;
}

.hero-copy p {
    max-width: 660px;
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-thai);
    font-size: 1.08rem;
    line-height: 1.8;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 800;
}

:root[data-theme="dark"] .hero-badge {
    border-color: rgba(96, 165, 250, 0.45);
    background: #132744;
    color: #bfdbfe;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.free-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: #047857;
    font-weight: 700;
}

:root[data-theme="dark"] .free-note {
    color: var(--fresh);
}

.product-preview {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 28px 70px rgba(17, 24, 39, 0.14);
}

:root[data-theme="dark"] .product-preview,
:root[data-theme="dark"] .demo-shell {
    border-color: var(--line);
    background: rgba(17, 24, 39, 0.88);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
}

.preview-topbar div {
    display: flex;
    gap: 6px;
}

.preview-topbar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.preview-topbar span:first-child {
    background: #ef4444;
}

.preview-topbar span:nth-child(2) {
    background: #f59e0b;
}

.preview-topbar span:nth-child(3) {
    background: #10b981;
}

.preview-search,
.preview-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text-muted);
}

:root[data-theme="dark"] .preview-search,
:root[data-theme="dark"] .preview-link {
    background: #0f172a;
    color: var(--text-muted);
}

.preview-category {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
}

:root[data-theme="dark"] .preview-category {
    background: #111827;
}

.preview-category.compact {
    width: 70%;
}

.preview-category-title {
    margin-bottom: 2px;
    font-weight: 800;
}

.preview-link {
    background: transparent;
    color: var(--text-main);
    font-weight: 700;
}

:root[data-theme="dark"] .preview-link {
    color: var(--text-main);
}

.preview-link i {
    color: var(--brand);
}

.feature-section,
.tips-section,
.free-section {
    padding: 72px 0;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2,
.tips-grid h2,
.free-panel h2 {
    margin: 0;
    font-family: var(--font-thai);
    font-size: clamp(1.65rem, 2.5vw, 2.35rem);
    font-weight: 800;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.feature-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
}

:root[data-theme="dark"] .feature-card,
:root[data-theme="dark"] .public-steps li,
:root[data-theme="dark"] .faq-item {
    background: var(--panel-bg);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.feature-card i {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--brand);
    font-size: 1.25rem;
}

:root[data-theme="dark"] .feature-card i {
    background: #132744;
    color: #bfdbfe;
}

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
}

.feature-card p,
.tips-grid p,
.free-panel p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
}

.tips-section {
    background: #f8fafc;
}

:root[data-theme="dark"] .tips-section {
    background: #0f172a;
}

.tips-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1fr);
    align-items: start;
    gap: 48px;
}

.tips-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: tips;
}

.tips-list li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-main);
    font-weight: 700;
    counter-increment: tips;
}

:root[data-theme="dark"] .tips-list li {
    background: var(--panel-bg);
}

.tips-list li::before {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 10px;
    background: var(--ink);
    color: #ffffff;
    content: counter(tips);
    font-weight: 800;
}

:root[data-theme="dark"] .tips-list li::before {
    background: #0f172a;
    color: #bfdbfe;
}

.free-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
    border-radius: 18px;
    background: #111827;
    color: #ffffff;
}

:root[data-theme="dark"] .free-panel {
    background: #0f172a;
    border: 1px solid var(--line);
}

.free-panel p {
    max-width: 760px;
    color: #d1d5db;
}

.site-footer {
    display: grid;
    min-height: 84px;
    place-items: center;
    padding: 24px 0;
    background: #111827;
    color: #d1d5db;
    font-size: 0.95rem;
    text-align: center;
}

.public-hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 44px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
}

.public-hero::before {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(21, 101, 216, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 101, 216, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
    pointer-events: none;
}

.public-hero .container-xxl {
    position: relative;
}

.public-hero h1 {
    max-width: 920px;
    margin: 18px 0;
    font-family: var(--font-thai);
    font-size: clamp(2.1rem, 4vw, 4rem);
    font-weight: 800;
    line-height: 1.08;
}

.public-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-thai);
    font-size: 1.08rem;
    line-height: 1.8;
}

.public-section {
    padding: 64px 0;
}

.public-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.public-card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-steps {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: workflow;
}

.public-steps li {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.05);
    counter-increment: workflow;
}

.public-steps li::before {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 12px;
    background: var(--brand);
    color: #ffffff;
    content: counter(workflow);
    font-weight: 800;
    grid-row: 1 / span 2;
}

.public-steps h2,
.faq-item h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 800;
    grid-column: 2;
}

.public-steps p,
.faq-item p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
}

.public-steps p {
    grid-column: 2;
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-item {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.05);
}

.demo-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(17, 24, 39, 0.12);
}

.demo-sidebar {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    background: #111827;
}

.demo-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #ffffff;
    font-weight: 800;
}

.demo-sidebar button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #d1d5db;
    font-weight: 700;
    text-align: left;
}

.demo-sidebar button.active,
.demo-sidebar button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.demo-board {
    display: grid;
    gap: 18px;
    padding: 22px;
    background: #f8fafc;
}

:root[data-theme="dark"] .demo-board {
    background: #0f172a;
}

.demo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.demo-toolbar .preview-search {
    flex: 1;
    background: #ffffff;
}

:root[data-theme="dark"] .demo-toolbar .preview-search {
    background: #111827;
}

.demo-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.public-cta-section {
    padding-top: 0;
}

@media (max-width: 991.98px) {
    .hero-grid,
    .tips-grid {
        grid-template-columns: 1fr;
    }

    .product-preview {
        max-width: 680px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .public-card-grid,
    .public-steps,
    .demo-shell,
    .demo-columns {
        grid-template-columns: 1fr;
    }

    .demo-sidebar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .demo-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 44px 0 48px;
    }

    .hero-actions,
    .free-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .btn,
    .free-panel .btn {
        width: 100%;
    }

    .preview-category.compact {
        width: 100%;
    }

    .feature-section,
    .tips-section,
    .free-section {
        padding: 48px 0;
    }

    .public-hero,
    .public-section {
        padding: 44px 0;
    }

    .public-steps li {
        grid-template-columns: 1fr;
    }

    .public-steps li::before,
    .public-steps h2,
    .public-steps p {
        grid-column: 1;
    }

    .demo-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .demo-toolbar .btn {
        width: 100%;
    }

    .demo-sidebar {
        grid-template-columns: 1fr 1fr;
    }
}
