/* ============ LARN.io — Design System ============ */
:root {
  --bg: #060a14;
  --bg-alt: #0a101f;
  --surface: #0e1628;
  --surface-2: #131c33;
  --border: rgba(148, 163, 184, .14);
  --text: #e8edf7;
  --text-dim: #9aa7bd;
  --text-faint: #64748b;
  --cyan: #22d3ee;
  --indigo: #818cf8;
  --grad: linear-gradient(100deg, #22d3ee, #818cf8);
  --radius: 16px;
  --font: 'Inter', 'Noto Sans Thai', 'Noto Sans SC', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

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

html[lang="th"] body { line-height: 1.8; }

.container { width: min(1140px, 100% - 48px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { line-height: 1.4; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

::selection { background: rgba(34, 211, 238, .3); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--nav-h);
  background: rgba(6, 10, 20, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 32px; height: 32px; }
.brand-name { font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; }
.brand-dot { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-dim); font-size: .92rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-cta {
  color: var(--bg); background: var(--grad);
  padding: 8px 18px; border-radius: 999px; font-weight: 600;
}
.nav-links a.nav-cta:hover { filter: brightness(1.12); }

.nav-right { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  display: flex; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.lang-btn {
  border: 0; background: transparent; color: var(--text-dim);
  font-family: var(--font); font-size: .78rem; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: all .2s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--grad); color: var(--bg); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 72px;
  overflow: hidden;
}
#neuralCanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero-glow {
  position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, .13), rgba(129, 140, 248, .07) 45%, transparent 70%);
}
.hero-inner { position: relative; text-align: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); background: rgba(14, 22, 40, .6);
  padding: 7px 16px; border-radius: 999px;
  font-size: .82rem; color: var(--text-dim); margin-bottom: 28px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 0 0 rgba(34, 211, 238, .5);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .45); }
  70% { box-shadow: 0 0 0 9px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.hero-title { font-size: clamp(2.2rem, 6vw, 4.3rem); font-weight: 800; margin-bottom: 22px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero-acronym { font-size: clamp(.72rem, 1.6vw, .95rem); color: var(--text-faint); letter-spacing: .06em; margin-bottom: 24px; }
.hero-acronym b { color: var(--cyan); font-weight: 600; }

.hero-sub { max-width: 720px; margin: 0 auto 40px; color: var(--text-dim); font-size: clamp(1rem, 2vw, 1.15rem); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 30px; border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  transition: all .25s;
}
.btn-primary { background: var(--grad); color: #04121a; box-shadow: 0 8px 30px rgba(34, 211, 238, .22); }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: rgba(14, 22, 40, .5); }
.btn-ghost:hover { border-color: rgba(34, 211, 238, .5); transform: translateY(-2px); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: 860px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(14, 22, 40, .5); backdrop-filter: blur(8px);
  padding: 26px 18px;
}
.stat-num { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-num > span { background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: .8rem; color: var(--text-dim); margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding: 104px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { text-align: center; max-width: 760px; margin: 0 auto 60px; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 14px;
}
.section-sub { color: var(--text-dim); margin-top: 16px; font-size: 1.02rem; }

/* ---------- Research cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 30px;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity .3s;
}
.card:hover { transform: translateY(-5px); border-color: rgba(34, 211, 238, .35); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, .14), rgba(129, 140, 248, .14));
  border: 1px solid rgba(34, 211, 238, .25);
  color: var(--cyan); margin-bottom: 20px;
}
.card-icon svg { width: 26px; height: 26px; }

.card-tag { display: block; font-size: .68rem; letter-spacing: .2em; color: var(--text-faint); margin-bottom: 10px; }
.card h3 { font-size: 1.28rem; margin-bottom: 12px; }
.card > p { color: var(--text-dim); font-size: .95rem; margin-bottom: 18px; }

.card-list li {
  position: relative; padding-left: 24px;
  color: var(--text-dim); font-size: .9rem; margin-bottom: 9px;
}
.card-list li::before {
  content: ""; position: absolute; left: 2px; top: .58em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad);
}

/* ---------- Pipeline ---------- */
.pipeline {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  counter-reset: step;
}
.pipe-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 26px;
  transition: transform .3s, border-color .3s;
}
.pipe-step:hover { transform: translateY(-4px); border-color: rgba(129, 140, 248, .4); }
.pipe-num {
  display: inline-block; font-size: .78rem; font-weight: 600;
  color: var(--indigo); border: 1px solid rgba(129, 140, 248, .35);
  border-radius: 8px; padding: 3px 10px; margin-bottom: 16px;
}
.pipe-step h4 { font-size: 1.06rem; margin-bottom: 8px; }
.pipe-step p { color: var(--text-dim); font-size: .9rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: start; }
.about-text h2 { margin-bottom: 20px; }
.about-text p { color: var(--text-dim); margin-bottom: 16px; }

.principles { display: flex; flex-direction: column; gap: 18px; }
.principle {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  transition: border-color .3s;
}
.principle:hover { border-color: rgba(34, 211, 238, .35); }
.principle-icon {
  flex: 0 0 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, .14), rgba(129, 140, 248, .14));
  color: var(--cyan);
}
.principle-icon svg { width: 22px; height: 22px; }
.principle h4 { font-size: 1rem; margin-bottom: 5px; }
.principle p { color: var(--text-dim); font-size: .88rem; }

/* ---------- Company / Legal ---------- */
.legal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  max-width: 980px; margin: 0 auto;
}
.legal-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; flex-direction: column; gap: 7px;
}
.legal-label { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.legal-value { font-weight: 600; font-size: .98rem; }
.legal-note {
  text-align: center; color: var(--text-faint); font-size: .82rem;
  max-width: 720px; margin: 36px auto 0;
}

/* ---------- Contact ---------- */
.contact-wrap { text-align: center; max-width: 680px; }
.contact-actions { margin: 34px 0 26px; }
.contact-addr { color: var(--text-faint); font-size: .9rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 48px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand p { color: var(--text-dim); font-size: .88rem; margin-top: 10px; max-width: 340px; }
.footer-meta { text-align: right; font-size: .85rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; }
.footer-meta .mono { font-size: .76rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse-dot { animation: none; }
  #neuralCanvas { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .legal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .container { width: min(1140px, 100% - 40px); }
  .section { padding: 76px 0; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(6, 10, 20, .97); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 22px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 4px; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a.nav-cta { margin-top: 12px; text-align: center; padding: 13px; }

  .hero { min-height: auto; padding-bottom: 56px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 22px 10px; }
  .hero-actions { margin-bottom: 52px; }

  .pipeline { grid-template-columns: 1fr; }
  .legal-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
}

@media (max-width: 420px) {
  .lang-btn { padding: 5px 8px; font-size: .72rem; }
  .brand-name { font-size: 1.05rem; }
}
