/* ===== ThaiEDA — landing page ===== */
:root {
  --bg: #0a0a0b;
  --bg-soft: #111114;
  --bg-card: #141417;
  --border: #232327;
  --border-soft: #1c1c20;
  --text: #f5f4f1;
  --text-dim: #a4a3a0;
  --text-faint: #6f6e6c;
  --accent: #f4ead5;        /* cream */
  --accent-ink: #16140f;
  --grad-1: #ff5d8f;
  --grad-2: #8b5cf6;
  --grad-3: #38bdf8;
  --grad-4: #fbbf24;
  --grad-5: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans Thai", "Space Grotesk", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans Thai", system-ui, sans-serif;
}
[data-theme="light"] {
  --bg: #faf9f6;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --border: #e7e4dd;
  --border-soft: #efece5;
  --text: #16140f;
  --text-dim: #5b5852;
  --text-faint: #8c8980;
  --accent: #16140f;
  --accent-ink: #f4ead5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--mono); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.nav__left { display: flex; gap: 22px; }
.nav__right { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.nav__link { color: var(--text-dim); font-size: 14px; font-weight: 500; transition: color .2s; }
.nav__link:hover { color: var(--text); }
.brand { display: flex; align-items: center; font-family: var(--display); font-weight: 700; }
.brand__name { font-size: 17px; letter-spacing: -.01em; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); cursor: pointer;
  display: grid; place-items: center; transition: all .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-faint); }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.star-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: transform .15s, box-shadow .2s;
}
.star-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(244,234,213,.15); }

/* ===== Hero ===== */
.hero { position: relative; padding: 96px 0 64px; text-align: center; overflow: hidden; }
.hero__glow {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; filter: blur(38px); opacity: .45; pointer-events: none;
}
.hero__glow .bar {
  width: 46px; height: 320px; border-radius: 60px;
  background: linear-gradient(180deg, var(--grad-1), transparent);
}
.hero__glow .bar:nth-child(2){ background: linear-gradient(180deg, var(--grad-2), transparent); height: 380px; }
.hero__glow .bar:nth-child(3){ background: linear-gradient(180deg, var(--grad-3), transparent); height: 260px; }
.hero__glow .bar:nth-child(4){ background: linear-gradient(180deg, var(--grad-4), transparent); height: 340px; }
.hero__glow .bar:nth-child(5){ background: linear-gradient(180deg, var(--grad-5), transparent); height: 300px; }
.hero__glow .bar:nth-child(6){ background: linear-gradient(180deg, var(--grad-1), transparent); height: 360px; }
.hero__glow .bar:nth-child(7){ background: linear-gradient(180deg, var(--grad-2), transparent); height: 240px; }
.hero__glow .bar:nth-child(8){ background: linear-gradient(180deg, var(--grad-3), transparent); height: 340px; }
.hero__glow .bar:nth-child(9){ background: linear-gradient(180deg, var(--grad-4), transparent); height: 290px; }
.hero__glow .bar:nth-child(10){ background: linear-gradient(180deg, var(--grad-5), transparent); height: 320px; }
.hero__content { position: relative; z-index: 1; max-width: 780px; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; margin-bottom: 26px;
}
.hero__title {
  font-family: var(--display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(38px, 7vw, 68px); line-height: 1.05; margin-bottom: 22px;
}
.hero__sub { color: var(--text-dim); font-size: clamp(15px, 2.2vw, 19px); max-width: 640px; margin: 0 auto 32px; }
.hero__sub strong { color: var(--text); }
.hero__sub-en { color: var(--text-faint); font-size: .92em; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(244,234,213,.18); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--text-faint); background: var(--bg-soft); }

/* ===== Terminal ===== */
.hero__terminal, .code-block {
  position: relative; text-align: left;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 620px; margin: 0 auto; overflow: hidden;
}
.terminal__bar { display: flex; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
.terminal__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.terminal__bar span:nth-child(1){ background: #ff5f57; }
.terminal__bar span:nth-child(2){ background: #febc2e; }
.terminal__bar span:nth-child(3){ background: #28c840; }
.terminal__body, .code-block pre { padding: 18px 20px; margin: 0; overflow-x: auto; }
.hero__terminal code, .code-block code { font-size: 13.5px; line-height: 1.85; color: var(--text); white-space: pre; }
.t-prompt { color: var(--grad-5); user-select: none; }
.t-comment { color: var(--text-faint); }
.t-kw { color: var(--grad-2); }
.t-str { color: var(--grad-4); }

/* ===== Strip ===== */
.strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 8px 24px 12px;
}
.strip__item {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 6px;
}
.strip__q { font-weight: 600; font-size: 15px; }
.strip__a { color: var(--text-dim); font-size: 13.5px; }

/* ===== Sections ===== */
.section { padding: 84px 24px; }
.label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px;
}
.section__title {
  font-family: var(--display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(28px, 4.5vw, 44px); line-height: 1.1; margin-bottom: 18px;
}
.section__lead { color: var(--text-dim); max-width: 640px; font-size: 16px; margin-bottom: 18px; }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px; }
.step {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 26px 24px; transition: border-color .25s, transform .25s;
}
.step:hover { border-color: var(--border); transform: translateY(-3px); }
.step__no { font-family: var(--mono); font-size: 13px; color: var(--text-faint); }
.step h3 { font-family: var(--display); font-size: 21px; margin: 10px 0 8px; letter-spacing: -.01em; }
.step p { color: var(--text-dim); font-size: 14.5px; }

/* ===== Feature grid ===== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 28px 26px; transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover { border-color: var(--border); transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: var(--bg-soft); border: 1px solid var(--border-soft); margin-bottom: 16px;
}
.card h3 { font-family: var(--display); font-size: 19px; margin-bottom: 8px; letter-spacing: -.01em; }
.card p { color: var(--text-dim); font-size: 14.5px; }
.card code, .faq code, .section__lead code, .strip code {
  font-size: .9em; background: var(--bg-soft); border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 6px; color: var(--text);
}

/* ===== Why grid ===== */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.why {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.why__tag {
  align-self: flex-start; font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  background: linear-gradient(120deg, color-mix(in srgb, var(--grad-2) 22%, transparent), color-mix(in srgb, var(--grad-3) 22%, transparent));
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; color: var(--text);
}
.why p { color: var(--text-dim); font-size: 14.5px; }

/* ===== Quickstart tabs ===== */
.qs { max-width: 760px; margin-top: 36px; }
.qs__tabs { display: inline-flex; gap: 4px; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.qs__tab {
  border: 0; background: transparent; color: var(--text-dim); cursor: pointer;
  padding: 8px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; font-family: var(--sans); transition: all .2s;
}
.qs__tab.is-active { background: var(--accent); color: var(--accent-ink); }
.code-block { max-width: 760px; display: none; }
.code-block.is-active { display: block; }
.copy-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 12px; border-radius: 8px; font-size: 12px; font-family: var(--mono); cursor: pointer; transition: all .2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-faint); }
.copy-btn.copied { color: var(--grad-5); border-color: var(--grad-5); }

/* ===== FAQ ===== */
.faq { max-width: 760px; margin-top: 36px; display: flex; flex-direction: column; gap: 10px; }
.faq__item {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 4px 22px; transition: border-color .2s;
}
.faq__item[open] { border-color: var(--border); }
.faq__item summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-family: var(--mono); font-size: 20px; color: var(--text-faint); transition: transform .2s; }
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { color: var(--text-dim); font-size: 15px; padding: 0 0 18px; }

/* ===== CTA ===== */
.cta { padding: 84px 0; border-top: 1px solid var(--border-soft); }
.cta__inner { text-align: center; max-width: 680px; }
.cta h2 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.02em; margin-bottom: 12px; }
.cta p { color: var(--text-dim); margin-bottom: 28px; }
.cta__term { max-width: 360px; margin: 0 auto 28px; padding-top: 4px; }
.cta__term pre { padding-top: 16px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border-soft); padding: 56px 0 32px; background: var(--bg-soft); }
.footer__inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer__brand p { color: var(--text-dim); font-size: 14px; margin-top: 12px; max-width: 240px; }
.footer__cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer__cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 14px; font-weight: 600; }
.footer__cols a { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 9px; transition: color .2s; }
.footer__cols a:hover { color: var(--text); }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-soft);
  color: var(--text-faint); font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .grid, .steps, .why-grid, .strip { grid-template-columns: repeat(2, 1fr); }
  .nav__left { display: none; }
}
@media (max-width: 560px) {
  .grid, .steps, .why-grid, .strip { grid-template-columns: 1fr; }
  .section { padding: 60px 20px; }
  .hero { padding: 64px 0 48px; }
  .nav__inner { grid-template-columns: auto 1fr; }
  .brand { order: -1; }
  .nav__right { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}
