:root {
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --primary: #2F6BFF;
  --primary-soft: #E8F0FF;
  --accent: #FF5C8A;
  --accent-soft: #FFE8EF;
  --success: #12B76A;
  --text: #1A2332;
  --muted: #5B6B7C;
  --border: #E3E9F2;
  --shadow: 0 16px 40px rgba(26, 35, 50, 0.1);
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Sarabun", "Noto Sans Thai", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Standalone landing.html */
body:not(.app-booted) {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body:not(.app-booted) a { color: inherit; text-decoration: none; }

/* Merged landing inside index.html */
body.landing-mode {
  height: auto;
  min-height: 100%;
  font-family: var(--font-body);
  line-height: 1.5;
  overflow: auto;
}
body.landing-mode .app { height: auto; min-height: 100vh; }
body.landing-mode a { color: inherit; text-decoration: none; }

.lp-root { min-height: 100vh; background: var(--bg); color: var(--text); }

.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(26, 35, 50, 0.48);
  backdrop-filter: blur(6px);
}
.login-overlay[hidden] { display: none !important; }
.login-overlay .login-card { position: relative; max-height: min(92vh, 720px); overflow: auto; }
.login-overlay-close {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 1.25rem;
}
.login-overlay-close:hover { background: var(--primary-soft); color: var(--text); }

img { max-width: 100%; display: block; }

.lp-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 249, 252, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.lp-nav.is-scrolled { border-bottom-color: var(--border); }
.lp-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.02em; color: var(--text);
}
.lp-brand svg { width: 40px; height: 40px; overflow: visible; }
.lp-nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-user-chip {
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.lp-root .btn,
.login-overlay .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border-radius: 12px;
  font-weight: 700; font-size: 0.95rem; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.lp-root .btn:hover,
.login-overlay .btn:hover { transform: translateY(-1px); }
.lp-root .btn-primary,
.login-overlay .btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.28);
}
.lp-root .btn-primary:hover,
.login-overlay .btn-primary:hover { background: #2558e0; }
.lp-root .btn-accent,
.login-overlay .btn-accent {
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px rgba(255, 92, 138, 0.28);
}
.lp-root .btn-ghost,
.login-overlay .btn-ghost {
  background: rgba(255,255,255,0.7); color: var(--text); border-color: var(--border);
}
.lp-root .btn-lg,
.login-overlay .btn-lg { min-height: 54px; padding: 0 26px; font-size: 1rem; }

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}
.hero-media {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(26,35,50,0.2) 0%, rgba(26,35,50,0.52) 52%, rgba(26,35,50,0.82) 100%),
    url("../assets/landing/hero-multi-industry.png") center / cover no-repeat;
  transform: scale(1.02);
  animation: hero-drift 18s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.06) translateY(-1.5%); }
}
.hero-content {
  position: relative; z-index: 1;
  width: min(720px, 100%);
  padding: clamp(40px, 8vh, 96px) clamp(16px, 4vw, 48px) clamp(48px, 10vh, 88px);
}
.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800; letter-spacing: -0.04em;
  margin: 0 0 12px; line-height: 1.05;
  text-shadow: 0 8px 28px rgba(0,0,0,0.25);
  animation: fade-up 0.7s ease both;
}
.hero-lead {
  margin: 0 0 28px;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  max-width: 34ch;
  color: rgba(255,255,255,0.92);
  animation: fade-up 0.7s ease 0.12s both;
}
.hero-ctas {
  display: flex; flex-wrap: wrap; gap: 12px;
  animation: fade-up 0.7s ease 0.22s both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  padding: clamp(56px, 10vw, 100px) clamp(16px, 4vw, 48px);
}
.section-inner { width: min(1120px, 100%); margin: 0 auto; }
.section-kicker {
  color: var(--primary); font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 10px;
}
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em; margin: 0 0 12px; line-height: 1.15;
}
.section-lead {
  margin: 0; color: var(--muted); max-width: 52ch; font-size: 1.05rem;
}

.modules {
  background:
    radial-gradient(ellipse at top left, rgba(47,107,255,0.08), transparent 45%),
    radial-gradient(ellipse at bottom right, rgba(255,92,138,0.07), transparent 40%),
    var(--bg);
}
.module-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.module-tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 8px 4px 4px;
  transition: transform 0.2s ease;
}
.module-tile:hover { transform: translateY(-4px); }
.module-tile img {
  width: 52px; height: 52px; border-radius: 14px;
  box-shadow: 0 6px 16px rgba(26, 35, 50, 0.1);
}
.module-tile h3 {
  margin: 0; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.02em;
}
.module-tile p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.industries {
  background:
    radial-gradient(ellipse at top right, rgba(47,107,255,0.07), transparent 42%),
    radial-gradient(ellipse at bottom left, rgba(18,183,106,0.06), transparent 38%),
    var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.industry-spotlight {
  margin-top: 28px;
  overflow: hidden;
  min-height: 160px;
  max-height: 220px;
  box-shadow: var(--shadow);
  animation: fade-up 0.8s ease both;
}
.industry-spotlight img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 40%;
}
.industry-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 20px;
}
.industry-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px 8px;
  transition: transform 0.2s ease;
}
.industry-tile:hover { transform: translateY(-4px); }
.industry-tile img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(26, 35, 50, 0.1);
}
.industry-th {
  margin: 4px 0 0;
  font-family: "Sarabun", "Noto Sans Thai", "Manrope", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}
.industry-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.industry-tile p:not(.industry-th) {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 34ch;
}

.feature {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}
.feature--flip { grid-template-columns: 0.95fr 1.05fr; }
.feature--flip .feature-copy { order: 2; }
.feature--flip .feature-visual { order: 1; }
.feature-visual {
  border-radius: 0;
  overflow: hidden;
  min-height: 320px;
  box-shadow: var(--shadow);
  animation: fade-up 0.8s ease both;
}
.feature-visual img {
  width: 100%; height: 100%; min-height: 320px; object-fit: cover;
}
.feature-copy h2 { margin-top: 0; }

.cta-band {
  background:
    linear-gradient(135deg, rgba(47,107,255,0.12), rgba(255,92,138,0.1)),
    var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.cta-band .section-inner { max-width: 720px; }
.cta-band .hero-ctas { justify-content: center; margin-top: 24px; }

.lp-footer {
  padding: 28px clamp(16px, 4vw, 48px) 40px;
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 0.9rem;
}
.lp-footer strong { color: var(--text); }

@media (max-width: 960px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-spotlight img { height: 180px; }
  .feature, .feature--flip { grid-template-columns: 1fr; }
  .feature--flip .feature-copy,
  .feature--flip .feature-visual { order: initial; }
  .feature-visual, .feature-visual img { min-height: 240px; }
}

@media (max-width: 560px) {
  .module-grid { grid-template-columns: 1fr; }
  .industry-grid { grid-template-columns: 1fr; }
  .industry-spotlight { max-height: 160px; }
  .industry-spotlight img { height: 160px; }
  .lp-nav-actions .btn-ghost { display: none; }
  .hero { min-height: calc(100svh - 68px); }
}
