:root {
    --bg-main: #0a0b0e;
    --bg-card: rgba(22, 24, 30, 0.7);
    --bg-card-hover: rgba(30, 34, 45, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 179, 71, 0.35);
    
    --primary: #f59e0b;
    --primary-glow: rgba(245, 158, 11, 0.25);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.2);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --font-main: 'Plus Jakarta Sans', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-thai: 'Noto Sans Thai', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html[lang="th"] {
    font-family: var(--font-thai);
}

html[lang="th"] .hero-title,
html[lang="th"] .section-title,
html[lang="th"] h1,
html[lang="th"] h2,
html[lang="th"] h3 {
    font-family: var(--font-thai);
    letter-spacing: -0.01em;
    line-height: 1.35;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow */
.background-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

.glow-1 {
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 450px;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(245, 158, 11, 0) 70%);
}

.glow-2 {
    bottom: 20%;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(59, 130, 246, 0) 70%);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography & Utilities */
h1, h2, h3, .brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(10, 11, 14, 0.75);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.version-badge {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(245, 158, 11, 0.12);
    color: var(--primary);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

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

/* Language Switcher Button */
.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.lang-opt {
    opacity: 0.5;
    transition: var(--transition);
}

.lang-opt.active {
    opacity: 1;
    color: var(--primary);
}

.lang-divider {
    opacity: 0.3;
    font-size: 0.75rem;
}

.nav-github {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.nav-github:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Hero Section */
.hero-section {
    padding: 160px 0 80px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fde68a;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 24px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero-description {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 36px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #111827;
    box-shadow: 0 6px 25px var(--primary-glow);
    position: relative;
    flex-direction: column;
    padding: 12px 28px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

.btn-subtext {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.hero-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    flex-wrap: wrap;
}

.dot-separator {
    color: rgba(255, 255, 255, 0.15);
}

/* Playground Section */
.playground-section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

.playground-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.playground-controls {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--text-main);
}

.toggle-btn.active {
    background: var(--primary);
    color: #111827;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.interactive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 860px) {
    .interactive-grid {
        grid-template-columns: 1fr;
    }
}

/* Trackpad Box */
.demo-trackpad {
    background: rgba(15, 17, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    cursor: crosshair;
    user-select: none;
    min-height: 280px;
    transition: var(--transition);
}

.demo-trackpad:hover {
    border-color: var(--border-highlight);
    background: rgba(20, 24, 34, 0.8);
}

.trackpad-icon {
    color: var(--primary);
    margin-bottom: 12px;
}

.trackpad-surface h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.trackpad-surface p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.stats-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-badge strong {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}

.haptic-visualizer {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

.haptic-visualizer.pulse {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(2.5);
}

/* Keyboard Box */
.demo-keyboard {
    background: rgba(15, 17, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.keyboard-header h3 {
    font-size: 1.15rem;
}

.badge-live {
    font-size: 0.75rem;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.25);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.demo-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    padding: 12px 16px;
    margin-bottom: 16px;
    outline: none;
    transition: var(--transition);
}

.demo-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.virtual-keys {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.key-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    height: 36px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.key:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.key.pressed {
    background: var(--primary);
    color: #111827;
    transform: translateY(2px);
    box-shadow: none;
}

.key-wide {
    min-width: 54px;
    font-size: 0.72rem;
}

.key-space {
    flex-grow: 1;
    max-width: 280px;
    font-size: 0.75rem;
}

/* Features Bento Grid */
.features-section {
    padding: 80px 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-4px);
}

.bento-wide {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .bento-wide {
        grid-column: span 1;
    }
}

.bento-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.bento-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.bento-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Installation Section */
.install-section {
    padding: 80px 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 800px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
}

.step-number {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #111827;
    border-radius: 50%;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.step-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.step-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.step-link:hover {
    text-decoration: underline;
}

.source-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.source-box h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--text-muted);
}

.code-block {
    background: #0f1117;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: left;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    color: #38bdf8;
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: pre;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 6px;
}

.footer-right {
    text-align: right;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-right a:hover {
    color: var(--primary);
}

@media (max-width: 600px) {
    .footer-right {
        text-align: left;
    }
}
