:root {
  --bg: #f6f7fa; --panel: #ffffff; --band: #eef1f6; --line: #e2e5eb; --line2: #d3d8e0;
  --text: #1b1f27; --muted: #5d6879; --faint: #98a2b3;
  --accent: #1e6ff0; --accent-2: #155ad0; --accent-soft: #e6effe;
  --ok: #079455; --danger: #d92d20;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 28px rgba(16,24,40,.08);
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Leelawadee UI", "Noto Sans Thai", "Sarabun", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141a; --panel: #181c24; --band: #151920; --line: #262c37; --line2: #323a47;
    --text: #e8ebf1; --muted: #a3adbd; --faint: #6b7587;
    --accent: #4b8dff; --accent-2: #6aa1ff; --accent-soft: #1b2a44;
    --ok: #3ccb7f; --danger: #ff6b5e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 780px; }
.muted { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { text-decoration: none; background: var(--band); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.lg { height: 50px; padding: 0 26px; font-size: 17px; border-radius: 12px; }
.btn:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { color: var(--muted); font-size: 15px; }
.top-nav a:hover { color: var(--text); text-decoration: none; }

/* hero */
.hero { padding: 72px 0 80px; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
h1 { margin: 0 0 20px; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.25; letter-spacing: -.01em; }
.accent { color: var(--accent); }
.lead { margin: 0 0 28px; font-size: 18px; color: var(--muted); max-width: 40em; }
.lead b { color: var(--text); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

.hero-card { display: flex; flex-direction: column; gap: 16px; }
.kit { background: var(--panel); border: 2px solid var(--accent); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.kit-h { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.kit-k { margin-top: 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kit-sk { font: 600 16px/1.5 var(--mono); color: var(--accent); word-break: break-all; margin-top: 4px; }
.kit-sk .dim { color: var(--faint); }
.kit-blank { border-bottom: 1.5px dashed var(--line2); height: 30px; }
.kit-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 12.5px var(--mono); padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* sections */
section { padding: 72px 0; }
section.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.sec-lead { margin: 0 0 32px; color: var(--muted); font-size: 17px; max-width: 46em; }

/* flow diagram */
.flow { margin: 0 0 36px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); overflow-x: auto; }
.flow svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--font); }
.f-box { stroke-width: 1.5; }
.f-dev { fill: var(--accent-soft); stroke: var(--accent); }
.f-srv { fill: var(--band); stroke: var(--line2); }
.f-pill { fill: var(--panel); stroke: var(--line2); }
.f-key { fill: var(--accent); stroke: var(--accent); }
.f-key + text { fill: #fff; }
.f-line { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.f-arrow { fill: var(--muted); }
.f-title { fill: var(--text); font-weight: 700; font-size: 16px; }
.f-c { fill: var(--text); font-size: 13.5px; text-anchor: middle; }
.f-strong { font-weight: 700; fill: #fff; }
.f-small { font-size: 12px; fill: var(--muted); }
.f-t { fill: var(--ok); font-size: 14px; }
.f-no { fill: var(--danger); }
.f-small2 { fill: var(--muted); font-size: 13px; font-style: italic; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 15px; }

/* features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; }
.feat h3 { margin: 0 0 8px; font-size: 17px; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; }

/* spec table */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.spec { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.spec th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--band); }
.spec tr:last-child td { border-bottom: 0; }
.spec td:first-child { font-weight: 700; white-space: nowrap; }
.spec td:last-child { color: var(--muted); }

/* faq */
details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative; padding-right: 48px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-size: 22px; color: var(--muted); }
details[open] summary::after { content: "−"; }
details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* final */
.final { padding: 80px 0; }
.final-in { text-align: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-radius: 22px; padding: 56px 24px; }
.final-in h2 { color: #fff; }
.final-in p { margin: 0 0 24px; opacity: .9; font-size: 17px; }
.final-in .btn.primary { background: #fff; color: #1546b8; border-color: #fff; }
.final-in .btn.primary:hover { background: #eef3ff; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 14px; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-in span:first-child { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 960px) {
  .hero-in { grid-template-columns: 1fr; gap: 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .top-nav { display: none; }
  .top-in .btn { margin-left: auto; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 44px 0 56px; }
  section { padding: 52px 0; }
  .grid, .steps { grid-template-columns: 1fr; }
  .cta .btn { flex: 1 1 100%; }
  .lead { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
