/* -------------------------------------------------------------------------- */
/* 1. Global Setup & Variables */
/* -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Mitr:wght@300;400;500;600&display=swap');

:root {
    /* Brand Colors */
    --primary: #E65A3A;
    /* Burnt Orange - Brand Identity */
    --primary-dark: #C24125;
    --primary-light: #FF8C73;

    /* Neutral Colors (Slate) */
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;

    /* Semantic Colors */
    --text-main: var(--slate-800);
    --text-muted: var(--slate-500);
    --bg-body: #FFFFFF;
    --bg-surface: #FFFFFF;
    --bg-subtle: var(--slate-50);
    --border: var(--slate-200);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-thai: 'Mitr', sans-serif;

    /* Spacing & Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --container-width: 1200px;
    --header-height: 80px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-main: var(--slate-100);
        --text-muted: var(--slate-400);
        --bg-body: var(--slate-900);
        --bg-surface: var(--slate-800);
        --bg-subtle: var(--slate-800);
        --border: var(--slate-700);
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-primary), var(--font-thai);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

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

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-lg {
    margin-bottom: 3rem;
}

section {
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* 2. UI Components */
/* -------------------------------------------------------------------------- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    gap: 0.5rem;
}

.btn--primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(230, 90, 58, 0.39);
}

.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 90, 58, 0.23);
    color: white;
}

.btn--ghost {
    background: transparent;
    color: var(--text-main);
    border-color: var(--slate-200);
}

.btn--ghost:hover {
    border-color: var(--text-main);
    background: var(--slate-50);
    color: var(--slate-800);
}

.btn--lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 2rem;
    transition: all 0.3s ease;
}

/* Icons */
.icon {
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}

/* -------------------------------------------------------------------------- */
/* 3. Header & Navigation */
/* -------------------------------------------------------------------------- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    .header {
        background: rgba(15, 23, 42, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo a {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

#line-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

#line-chat-button:hover {
    transform: scale(1.05);
}

.line-tooltip {
    width: max-content;
}

/* Desktop Nav */
.desktop-nav {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-nav {
        display: block;
    }

    .desktop-nav ul {
        display: flex;
        list-style: none;
        gap: 2rem;
    }

    .desktop-nav a {
        color: var(--text-muted);
        font-weight: 500;
        font-size: 0.95rem;
    }

    .desktop-nav a:hover {
        color: var(--primary);
    }
}

/* Language Switcher */
.lang-switch-group {
    display: flex;
    background: var(--bg-subtle);
    padding: 4px;
    border-radius: 8px;
    margin-left: 1.5rem;
}

.lang-toggle-input {
    display: none;
}

.lang-label {
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

#lang-en-toggle:checked+.lang-label,
#lang-th-toggle:checked+.lang-label {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {

    #lang-en-toggle:checked+.lang-label,
    #lang-th-toggle:checked+.lang-label {
        background: var(--slate-700);
        color: white;
    }
}

/* Language Logic */
.th-text {
    display: none;
}

.en-text {
    display: inline;
}

#lang-th-toggle:checked~* .en-text {
    display: none;
}

#lang-th-toggle:checked~* .th-text {
    display: inline;
}

/* Mobile Menu Toggle */
.nav-toggle-input {
    display: none;
}

.hamburger-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1002;
}

.line {
    width: 100%;
    height: 2px;
    background: var(--text-main);
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .hamburger-label {
        display: none;
    }
}

/* Mobile Nav Drawer */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-surface);
    padding: 6rem 2rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    border-left: 1px solid var(--border);
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-toggle-input:checked~.mobile-nav {
    transform: translateX(0);
}

.nav-toggle-input:checked~.nav-overlay {
    opacity: 1;
    visibility: visible;
}

.nav-toggle-input:checked~.header-content .hamburger-label .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle-input:checked~.header-content .hamburger-label .line:nth-child(2) {
    opacity: 0;
}

.nav-toggle-input:checked~.header-content .hamburger-label .line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* -------------------------------------------------------------------------- */
/* 4. Hero Section */
/* -------------------------------------------------------------------------- */

#hero {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 6rem;
    background: radial-gradient(circle at 50% 0%, #FFF1EE 0%, #FFFFFF 100%);
}

@media (prefers-color-scheme: dark) {
    #hero {
        background: radial-gradient(circle at 50% 0%, var(--slate-800) 0%, var(--slate-900) 100%);
    }
}

.hero-headline {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (prefers-color-scheme: dark) {
    .hero-headline {
        background: linear-gradient(135deg, var(--slate-50) 0%, var(--slate-300) 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

.hero-subcopy {
    font-size: 1.25rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
    line-height: 1.7;
}

.cta-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

@media (min-width: 640px) {
    .cta-group {
        flex-direction: row;
    }
}

.trust-row {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: center;
    padding-top: 2rem;
    border-top: 1px solid var(--slate-200);
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .trust-row {
        flex-direction: row;
        gap: 4rem;
    }
}

.trust-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.trust-item .icon {
    color: var(--primary);
}

/* -------------------------------------------------------------------------- */
/* 5. About Section */
/* -------------------------------------------------------------------------- */

#about {
    background: var(--bg-surface);
}

.value-points {
    display: grid;
    gap: 2rem;
    margin-top: 4rem;
}

@media (min-width: 768px) {
    .value-points {
        grid-template-columns: repeat(3, 1fr);
    }
}

.value-card {
    text-align: left;
    border: none;
    background: var(--bg-subtle);
    padding: 2.5rem;
}

.value-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* -------------------------------------------------------------------------- */
/* 6. Plans Section */
/* -------------------------------------------------------------------------- */

#plans {
    background: var(--slate-900);
    color: white;
}

/* #plans h2,
#plans p {
    color: white;
} */

#plans .text-muted {
    color: var(--slate-400);
}

.pricing-card {
    background: white;
    color: var(--slate-800);
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: none;
}

.pricing-card p {
    color: var(--slate-500);
    margin-bottom: 0.5rem;
}

.pricing-card .price-display {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin: 1rem 0;
}

.ribbon {
    position: absolute;
    top: 40px;
    right: -50px;
    background: var(--primary);
    color: white;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.price-list {
    list-style: none;
    text-align: left;
    margin: 2rem 0;
    padding-top: 2rem;
    border-top: 1px dashed var(--slate-200);
}

.price-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--slate-800);
}

.price-list .icon {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.price-note {
    font-size: 0.875rem;
    margin-top: 1.5rem;
    font-style: italic;
}

/* -------------------------------------------------------------------------- */
/* 7. Portfolio Section */
/* -------------------------------------------------------------------------- */

#work {
    background: var(--bg-subtle);
}

.portfolio-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.portfolio-item {
    padding: 0;
    overflow: hidden;
    border: none;
    background: transparent;
    box-shadow: none;
}

.portfolio-figure {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover .portfolio-figure {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.placeholder-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .placeholder-img {
    transform: scale(1.05);
}

figcaption {
    margin-top: 1rem;
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-main);
}

.portfolio-link {
    display: block;
    text-align: center;
    margin-top: 3rem;
    font-weight: 600;
    font-size: 1.125rem;
}

/* -------------------------------------------------------------------------- */
/* 8. Workflow Section */
/* -------------------------------------------------------------------------- */

#how {
    background: var(--bg-surface);
}

.workflow-grid {
    display: grid;
    gap: 2rem;
    margin-top: 4rem;
    counter-reset: step;
}

@media (min-width: 768px) {
    .workflow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .workflow-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.step-card {
    position: relative;
    padding: 2rem;
    background: var(--bg-subtle);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
}

.step-card::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(230, 90, 58, 0.3);
}

/* -------------------------------------------------------------------------- */
/* 9. Contact & Footer */
/* -------------------------------------------------------------------------- */

#contact {
    background: linear-gradient(to bottom, var(--bg-subtle) 0%, white 100%);
    text-align: center;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
    margin: 3rem 0;
}

@media (min-width: 640px) {
    .contact-details {
        flex-direction: row;
        gap: 3rem;
    }
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

.contact-item .icon {
    color: var(--primary);
}

.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--bg-surface);
}