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

:root {
  /* ─── Dark Mode (default) ─── */
  --bg: #030712;
  --bg-soft: rgba(17, 24, 39, 0.7);
  --card: rgba(30, 41, 59, 0.45);
  --card-hover: rgba(30, 41, 59, 0.65);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(139, 92, 246, 0.35);
  --text: #f3f4f6;
  --text-dim: #9ca3af;
  --nav-bg: rgba(3, 7, 18, 0.75);
  --nav-mobile-bg: rgba(3, 7, 18, 0.97);
  --blue: #3b82f6;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --accent-grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #d946ef 100%);
  --glow-grad: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.35));
  --radius: 16px;
  --maxw: 1200px;
  --font-heading: "Outfit", "Sarabun", -apple-system, sans-serif;
  --font-body: "Inter", "Sarabun", -apple-system, sans-serif;
  --section-bg: transparent;
  --section-stripe: rgba(255, 255, 255, 0.01);
  --section-stripe-border: rgba(255, 255, 255, 0.04);
  --footer-bg: rgba(3, 7, 18, 0.8);
  --pill-bg: rgba(139, 92, 246, 0.1);
  --pill-text: #d8b4fe;
  --pill-border: rgba(139, 92, 246, 0.2);
}

/* ─── Light Mode ─── */
html.light {
  --bg: #f0f4ff;
  --bg-soft: rgba(224, 231, 255, 0.8);
  --card: rgba(255, 255, 255, 0.75);
  --card-hover: rgba(255, 255, 255, 0.95);
  --card-border: rgba(99, 102, 241, 0.12);
  --card-border-hover: rgba(99, 102, 241, 0.4);
  --text: #0f172a;
  --text-dim: #334155;
  --nav-bg: rgba(240, 244, 255, 0.85);
  --nav-mobile-bg: rgba(240, 244, 255, 0.98);
  --blue: #2563eb;
  --purple: #7c3aed;
  --cyan: #0891b2;
  --accent-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #c026d3 100%);
  --glow-grad: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(124, 58, 237, 0.2));
  --section-bg: transparent;
  --section-stripe: rgba(99, 102, 241, 0.04);
  --section-stripe-border: rgba(99, 102, 241, 0.12);
  --footer-bg: rgba(224, 231, 255, 0.85);
  --pill-bg: rgba(99, 102, 241, 0.1);
  --pill-text: var(--purple);
  --pill-border: rgba(99, 102, 241, 0.25);
}

/* ─── Global theme transition (body only — ไม่ override animations อื่น) ─── */
body {
  transition: background-color 0.35s ease, color 0.35s ease;
}
.nav, .nav * {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: 0.35s;
  transition-timing-function: ease;
}

/* ─── Theme Toggle Button ─── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--card-hover);
  border-color: var(--card-border-hover);
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
}

.theme-toggle:active {
  transform: scale(0.95);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background animated mesh */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(217, 70, 239, 0.05) 0%, transparent 60%);
  animation: bgPulse 20s ease-in-out infinite alternate;
}

/* Light mode: softer background orbs */
html.light body::before {
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(192, 38, 211, 0.04) 0%, transparent 60%);
}

@keyframes bgPulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

a {
  color: inherit;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Scroll Reveal Utilities */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.21, 1.02, 0.43, 1.01), transform 0.8s cubic-bezier(0.21, 1.02, 0.43, 1.01);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
  transition: transform 0.3s ease;
}

.brand:hover img {
  transform: rotate(15deg) scale(1.05);
}

.brand .sub {
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 2px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 28px;
}

.navlinks a:not(.btn) {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.navlinks a:not(.btn):hover {
  color: var(--text);
}

.navlinks a:not(.btn).active {
  color: var(--text);
  position: relative;
}

.navlinks a:not(.btn).active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 2px;
}

/* World-Class Floating Dropdown Menu (Hover Only) */
.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown-toggle {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dropdown:hover .dropdown-toggle,
.dropdown-toggle.active {
  color: var(--text);
  background: rgba(59, 130, 246, 0.08);
}

.dropdown-toggle .arrow {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.25s ease;
}

.dropdown:hover .dropdown-toggle .arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* Floating Dropdown Card - Hidden by default, floats over navbar */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  
  /* ซ่อนเป็นค่าเริ่มต้น (จะแสดงเฉพาะตอนเอาเมาส์ชี้เท่านั้น) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 9999;
}

/* แสดงผลเฉพาะตอนเอาเมาส์ชี้ (Hover) เท่านั้น */
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text-dim) !important;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--text) !important;
}

.dropdown-item-icon {
  font-size: 1.1rem;
}

@media (max-width: 1080px) {
  .dropdown {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .dropdown-toggle {
    width: 100%;
    padding: 8px 0;
    justify-content: space-between;
  }
  /* ซ่อนเมนูย่อยบนมือถือเป็นค่าเริ่มต้น - แสดงเมื่อกด (toggle) */
  .dropdown-menu {
    position: static !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-left: 2px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 0 0 16px !important;
    max-height: 0;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    transition: opacity 0.2s ease, max-height 0.3s ease, padding 0.2s ease !important;
  }
  /* แสดงเมนูย่อยเมื่อมี class .open (เพิ่มโดย JS) */
  .dropdown.open .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    max-height: 200px;
    padding: 6px 0 6px 16px !important;
    gap: 4px !important;
    margin-top: 4px;
    margin-bottom: 8px;
  }
  .dropdown.open .dropdown-toggle .arrow {
    transform: rotate(180deg);
  }
  .dropdown-item {
    padding: 6px 8px !important;
    white-space: normal !important;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: var(--card-hover);
  border-color: var(--card-border-hover);
}

@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex;
  }
  .navlinks {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 90;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--nav-mobile-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    padding: 8px 24px 24px;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.9);
    transform: translateY(-15px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  }
  .navlinks.open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
  .navlinks a:not(.btn) {
    padding: 16px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 1.05rem;
  }
  .navlinks a.btn {
    margin: 20px 0 4px;
    justify-content: center;
  }
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.btn-primary > * {
  position: relative;
  z-index: 2;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(139, 92, 246, 0.4), 0 0 15px 2px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Custom Social Buttons (Overriding standard gradients) */
.btn-line {
  background: #00C300 !important;
  border-color: #00C300 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0, 195, 0, 0.3) !important;
}
.btn-line::before {
  background: linear-gradient(135deg, #00D300 0%, #00B300 100%) !important;
}
.btn-line:hover {
  box-shadow: 0 6px 20px rgba(0, 195, 0, 0.4) !important;
}

.btn-facebook {
  background: #1877F2 !important;
  border-color: #1877F2 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.3) !important;
}
.btn-facebook::before {
  background: linear-gradient(135deg, #2b87ff 0%, #1565C0 100%) !important;
}
.btn-facebook:hover {
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4) !important;
}

.btn-ghost {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: var(--card-hover);
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.btn[disabled], .btn.soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.soon:hover {
  transform: none;
  box-shadow: none;
}

/* badge / pill */
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid var(--pill-border);
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* hero */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: var(--blue);
  filter: blur(150px);
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 7vw, 4rem);
  margin: 28px 0 20px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.hero h1 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
}

.hero p.lead {
  color: var(--text-dim);
  font-size: 1.2rem;
  max-width: 720px;
  margin: 0 auto 38px;
  line-height: 1.8;
}

.hero .ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .meta {
  margin-top: 24px;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
}

.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  max-width: 760px;
  margin: 64px auto 0;
  border-top: 1px solid var(--card-border);
  padding-top: 40px;
}

.hero-stat {
  flex: 1 1 150px;
  text-align: center;
  padding: 8px 16px;
}

.hero-stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.hero-stat span {
  display: block;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 6px;
}

.hero-stats-caption {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 20px 0 0;
}

/* section */
section {
  padding: 96px 0;
  position: relative;
}

#screenshots, #boards {
  background: var(--section-stripe);
  border-top: 1px solid var(--section-stripe-border);
  border-bottom: 1px solid var(--section-stripe-border);
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.section-head .pill {
  margin-bottom: 16px;
}

.section-head h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0;
}

/* how it works - 3 steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

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

.step {
  text-align: center;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background-color 0.35s ease, color 0.35s ease;
  backdrop-filter: blur(8px);
}

.step:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
}

.step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px -6px rgba(59, 130, 246, 0.5);
  position: relative;
}

.step-num::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.step h3 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.step p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  section {
    padding: 64px 0;
  }
  .hero {
    padding: 80px 0 48px;
  }
  .section-head {
    margin-bottom: 40px;
  }
  .sim-banner {
    padding: 36px 24px;
  }
  .download-card {
    padding: 32px 24px;
  }
}

/* features grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

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

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.35s ease, color 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-border-hover);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5), 0 0 15px -3px rgba(139, 92, 246, 0.15);
}

.feature-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-grad);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.feature-card .icon svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.feature-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* screenshots */
.tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--card-border-hover);
}

.tab-btn.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px -4px rgba(139, 92, 246, 0.5);
}

.shot-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: 0 35px 70px -25px rgba(0, 0, 0, 0.8), 0 0 40px -10px rgba(59, 130, 246, 0.1);
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(8px);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.shot-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--card-border);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.shot-chrome span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--card-border);
}

.shot-chrome span:nth-child(1) { background: #ef4444; }
.shot-chrome span:nth-child(2) { background: #f59e0b; }
.shot-chrome span:nth-child(3) { background: #22c55e; }

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.shot-panel {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shot-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* simulator banner */
.sim-banner {
  border-radius: var(--radius);
  padding: 56px;
  background:
    radial-gradient(600px 300px at 85% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(139, 92, 246, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.sim-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  opacity: 0.02;
  pointer-events: none;
}

.sim-banner-text {
  max-width: 680px;
  margin: 0 auto;
}

.sim-banner h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 20px 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sim-banner p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0 0 24px;
  line-height: 1.7;
}

.sim-points {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  text-align: left;
  display: inline-block;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.sim-points li {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.check-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #10b981;
}

/* boards */
.board-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

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

@media (max-width: 640px) {
  .board-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .board-list {
    grid-template-columns: 1fr;
  }
}

.board-chip {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.35s ease, color 0.35s ease;
}

.board-chip:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.4);
}

.board-photo {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.board-photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.board-chip:hover .board-photo img {
  transform: scale(1.08);
}

.board-chip span {
  display: block;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.78rem;
  margin-top: 6px;
}

/* download */
.download-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.download-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
}

.download-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.download-card .os-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.download-card .os-icon svg {
  width: 26px;
  height: 26px;
  color: #fff;
}

/* footer */
footer {
  border-top: 1px solid var(--card-border);
  padding: 48px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  background: var(--footer-bg);
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

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

footer a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: var(--text);
}

.foot-links {
  display: flex;
  gap: 24px;
}

@media (max-width: 640px) {
  footer .container {
    flex-direction: column;
    text-align: center;
  }
  .foot-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* manual layout */
.manual-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 96px;
}

@media (max-width: 860px) {
  .manual-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.manual-toc {
  align-self: start;
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  font-size: 0.92rem;
  backdrop-filter: blur(8px);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

@media (min-width: 861px) {
  .manual-toc {
    position: sticky;
    top: 100px;
  }
}

.manual-toc div.toc-title {
  font-family: var(--font-heading);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual-toc a {
  display: block;
  padding: 8px 0;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.manual-toc a:hover {
  color: var(--text);
  transform: translateX(4px);
}

.manual-content h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.manual-content h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  scroll-margin-top: 100px;
  letter-spacing: -0.01em;
}

.manual-content h2:first-of-type {
  border-top: none;
  margin-top: 24px;
}

.manual-content p {
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.8;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
}

.manual-content table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
}

.manual-content th, .manual-content td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
}

.manual-content tr:last-child td {
  border-bottom: none;
}

.manual-content th {
  color: var(--text);
  font-weight: 700;
  background: var(--card-hover);
}

.manual-content kbd {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-bottom-width: 2.5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text);
}

.manual-content code {
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--purple);
}

.manual-content pre {
  background: #090d16;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  font-size: 0.9rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.manual-content pre code {
  border: none;
  background: none;
  padding: 0;
  color: #e2e8f0;
}

.manual-content ul, .manual-content ol {
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.8;
  padding-left: 24px;
}

.manual-content li {
  margin-bottom: 8px;
}

.note {
  border: 1px solid var(--card-border-hover);
  background: var(--card);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 0.98rem;
  margin: 24px 0;
  line-height: 1.7;
  color: var(--text);
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3), 0 4px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

.scroll-to-top:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }
}

/* Dev Guide Bento Card */
.dev-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 36px;
  margin: 28px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.35s ease, color 0.35s ease;
}

.dev-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.5), 0 0 15px -3px rgba(139, 92, 246, 0.1);
}

.dev-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.dev-card p {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.6;
}

.dev-features {
  display: grid;
  gap: 18px;
}

.dev-feat-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.dev-feat-icon {
  font-size: 1.25rem;
  padding: 6px;
  background: rgba(139, 92, 246, 0.12);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--purple);
}

.dev-feat-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 2px;
}

.dev-feat-item span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.dev-card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--card-border);
  padding-left: 32px;
  gap: 20px;
}

.dev-pdf-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
}

.pdf-icon {
  width: 64px;
  height: 64px;
  color: #a855f7;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.25));
}

.dev-pdf-preview span {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .dev-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px;
  }
  .dev-card-action {
    border-left: none;
    border-top: 1px solid var(--card-border);
    padding-left: 0;
    padding-top: 24px;
  }
}

/* ═══════════════════════════════════════════════════════════
   BLOG / KNOWLEDGE BASE STYLES
   ═══════════════════════════════════════════════════════════ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 2rem;
}

.blog-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.2), 0 0 20px -5px rgba(99, 102, 241, 0.15);
}

.blog-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.blog-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.4;
  font-weight: 700;
}

.blog-excerpt {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 20px;
  flex-grow: 1;
  /* จำกัดให้แสดงแค่ 3 บรรทัดแล้วมี ... */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-excerpt p {
  margin: 0;
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ─── Article Typography ─── */
.article-content {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.8;
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
  font-family: var(--font-heading);
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-dim);
}

.article-content a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--purple);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
}

.article-content blockquote {
  border-left: 4px solid var(--purple);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--card);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-dim);
}

.article-content pre {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.article-content code {
  font-family: 'Consolas', 'Courier New', monospace;
}

/* Inline code (Not block) */
.article-content p code, .article-content li code {
  background: rgba(99, 102, 241, 0.1);
  color: var(--purple);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  color: var(--text-dim);
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   LIGHT MODE FINE-TUNING
   ═══════════════════════════════════════════════════════════ */
html.light {

  /* ─── Hero glow ลด opacity ─── */
  .hero::after { opacity: 0.08; }

  /* ─── dev-feat-item strong (hardcoded #fff ในโค้ด) ─── */
  .dev-feat-item strong { color: var(--text); }

  /* ─── board-chip hover shadow ─── */
  .board-chip:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 24px -10px rgba(99, 102, 241, 0.2);
  }

  /* ─── feature card hover shadow ─── */
  .feature-card:hover {
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.15), 0 0 15px -3px rgba(99, 102, 241, 0.1);
  }

  /* ─── shot-frame: ไม่ dark background บน light mode ─── */
  .shot-frame {
    background: rgba(240, 244, 255, 0.9);
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.15), 0 0 20px -5px rgba(99, 102, 241, 0.1);
  }
  .shot-chrome {
    background: rgba(99, 102, 241, 0.05);
    border-bottom-color: var(--card-border);
  }

  /* ─── sim-banner: ปรับเป็น light gradient ─── */
  .sim-banner {
    background:
      radial-gradient(600px 300px at 85% 0%, rgba(124, 58, 237, 0.08), transparent 70%),
      linear-gradient(135deg, rgba(240, 244, 255, 0.95), rgba(224, 231, 255, 0.9));
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 15px 40px -10px rgba(99, 102, 241, 0.12);
  }

  /* ─── scroll-to-top button ─── */
  .scroll-to-top {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--purple);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }

  /* ─── tab-btn.active: gradient ยังสวยได้ ─── */
  .tab-btn.active {
    box-shadow: 0 4px 15px -4px rgba(99, 102, 241, 0.35);
  }

  /* ─── mobile nav shadow ─── */
  .navlinks.open {
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.15);
  }

  /* ─── manual-toc active link ─── */
  .manual-toc a.active {
    color: var(--purple);
    font-weight: 600;
  }

  /* ─── step hover border ─── */
  .step:hover {
    border-color: rgba(99, 102, 241, 0.3);
  }
}

/* ─── Category Filters ─── */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.cat-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.cat-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-2px);
}

.cat-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ─── WP Article Content ─── */
.article-content {
  line-height: 1.8;
  font-size: 1.1rem;
  color: var(--text);
}
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}
.article-content figure {
  margin: 1.5rem 0;
  text-align: center;
}
.article-content figcaption {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.article-content h2, .article-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.article-content a {
  color: var(--blue);
  text-decoration: underline;
}

