/* landing/styles.css — หน้าทางเข้ารวมของ SPP Step-1 · กลไกนำเข้าข้อมูลอัจฉริยะ
   ไฟล์ static ล้วน: ไม่มีสคริปต์ ไม่โหลดอะไรจากภายนอก (CSP ใน _headers: style-src 'self' · font-src 'self')
   ห้ามใส่ style="" ในหน้า HTML — CSP ไม่อนุญาตสไตล์ในบรรทัด ทุกอย่างอยู่ในไฟล์นี้ */

/* ฟอนต์ของโครงการ (สำเนาตรงไบต์จาก app/fonts — SIL Open Font License 1.1) */
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/anuphan-thai-400-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/anuphan-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/anuphan-thai-600-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/anuphan-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/prompt-thai-500-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/prompt-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/prompt-thai-600-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/prompt-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ชุดสี (โทนขาว-ฟ้าเทคโนโลยีสว่าง) — คู่สีตัวอักษร/พื้นมีเทสต์ความต่างของสีใน tests/landing.test.js */
:root {
  --bg: #f5f9ff;
  --surface: #ffffff;
  --sky-50: #eef5ff;
  --sky-100: #e2eefd;
  --line: #d7e5f6;
  --line-strong: #b9d3f2;

  --ink: #0b1f3a;
  --ink-2: #2a4466;
  --muted: #4b6282;

  --primary: #0b55c4;
  --primary-hover: #0a47a6;
  --on-primary: #ffffff;
  --accent: #1ec0ef;
  --accent-ink: #075e7a;

  --ai-bg: #ddf5fd;
  --ai-ink: #06536c;
  --human-bg: #ebe7ff;
  --human-ink: #3b2a8f;
  --rule-bg: #e3ebf6;
  --rule-ink: #1d3557;

  --demo-bg: #fff1dc;
  --demo-ink: #7a3e00;
  --warn-bg: #fff7e6;
  --warn-line: #f0c46a;
  --warn-ink: #5c3900;

  --footer-bg: #0b1f3a;
  --footer-ink: #e3eefc;
  --footer-muted: #a9c0de;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .05), 0 10px 30px -12px rgba(11, 85, 196, .22);
  --shadow-lg: 0 2px 6px rgba(11, 31, 58, .06), 0 28px 60px -24px rgba(11, 85, 196, .35);
  --font-body: "Anuphan", "Leelawadee UI", "Tahoma", system-ui, sans-serif;
  --font-head: "Prompt", "Anuphan", "Leelawadee UI", "Tahoma", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.3; margin: 0; color: var(--ink); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary); }
b { font-weight: 600; }
.nw { white-space: nowrap; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* ── หัวหน้า ───────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand__mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 6px 12px rgba(11, 85, 196, .28)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand__text b { font-family: var(--font-head); font-size: 17px; letter-spacing: .01em; }
.brand__text span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 15.5px; padding: 8px 12px; border-radius: 10px; }
.topnav a:hover { background: var(--sky-50); color: var(--primary); }
.topnav .topnav__cta { background: var(--primary); color: var(--on-primary); padding: 8px 16px; margin-left: 6px; }
.topnav .topnav__cta:hover { background: var(--primary-hover); color: var(--on-primary); }

/* ── ส่วนเปิด ──────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; text-align: center; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(30, 192, 239, .22), transparent 70%),
    radial-gradient(40% 50% at 12% 30%, rgba(11, 85, 196, .12), transparent 70%),
    radial-gradient(40% 50% at 88% 35%, rgba(30, 192, 239, .14), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero__bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(11, 85, 196, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 85, 196, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 75%);
}
.hero__in { display: flex; flex-direction: column; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; color: var(--accent-ink); background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 16px;
  flex-wrap: wrap; justify-content: center; column-gap: 8px;
}
.hero__title { margin-top: 26px; font-size: clamp(1.95rem, 5.4vw, 3.9rem); line-height: 1.22; letter-spacing: -.005em; max-width: 16em; }
.grad {
  background: linear-gradient(100deg, var(--primary) 10%, #1580d4 55%, #0a8fc0 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__name { margin-top: 18px; font-family: var(--font-head); font-weight: 500; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-2); }
.hero__lead { margin-top: 14px; max-width: 46em; font-size: clamp(1rem, 1.9vw, 1.12rem); color: var(--ink-2); }
.hero__cta { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.hero__pills { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero__pills li {
  display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  box-shadow: 0 1px 2px rgba(11, 31, 58, .04);
}
.hero__pills .ico { color: var(--primary); }

.hero__float { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 500; font-size: 14.5px; color: var(--ink);
  background: rgba(255, 255, 255, .88); border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px;
  box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.chip .ico { color: var(--primary); width: 20px; height: 20px; }
.chip em { font-style: normal; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ai-ink); background: var(--ai-bg); border-radius: 999px; padding: 1px 9px; }
.chip--a { left: 3%; top: 10%; }
.chip--b { right: 4%; top: 13%; animation-delay: -1.5s; }
.chip--b em { color: var(--human-ink); background: var(--human-bg); }
.chip--c { left: 5%; bottom: 16%; animation-delay: -3s; }
.chip--c em { color: var(--on-primary); background: var(--primary); }
.chip--d { right: 3%; bottom: 22%; animation-delay: -4.5s; }

/* ปุ่ม */
.btn {
  display: inline-flex; align-items: center; gap: 12px; text-align: left;
  text-decoration: none; border-radius: 14px; padding: 12px 22px; min-height: 56px;
  font-family: var(--font-head); font-weight: 500; font-size: 17px; line-height: 1.3;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 13.5px; opacity: .92; }
.btn .ico { width: 22px; height: 22px; }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 12px 26px -12px rgba(11, 85, 196, .7); }
.btn--primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--primary); border: 1.5px solid var(--line-strong); }
.btn--ghost:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--block { width: 100%; justify-content: center; }

/* ── ที่มา ─────────────────────────────────────────── */
.why { padding: 4px 0 8px; }
.why__in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow);
}
.why__text { flex: 1 1 420px; }
.why__text p { color: var(--ink-2); }
.why__chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 360px; justify-content: flex-end; }
.why__chips li {
  display: inline-flex; align-items: center; gap: 7px; font-size: 15px; color: var(--rule-ink);
  background: var(--rule-bg); border-radius: 10px; padding: 6px 12px;
}
.why__chips .ico { color: #b42318; width: 18px; height: 18px; }

/* ── หัวข้อของแต่ละส่วน ─────────────────────────────── */
.section { padding: 88px 0 24px; }
.section__head { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.kicker { font-family: var(--font-head); font-size: 15px; font-weight: 500; letter-spacing: .04em; color: var(--accent-ink); }
.section__head h2 { margin-top: 8px; font-size: clamp(1.6rem, 3.6vw, 2.35rem); }
.section__lead { margin-top: 14px; color: var(--ink-2); }

/* ── แผงแนวคิด ─────────────────────────────────────── */
.board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(340px, 450px) 56px minmax(0, 1fr);
  align-items: stretch;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(238, 245, 255, .9));
  border: 1px solid var(--line); border-radius: 28px; padding: 30px; box-shadow: var(--shadow-lg);
}
.board__col { display: flex; flex-direction: column; min-width: 0; }
.board__label { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: .03em; margin: 0 0 12px 4px; }
.cards { display: grid; grid-auto-rows: 1fr; gap: 12px; flex: 1; }
.card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: 0 1px 2px rgba(11, 31, 58, .04);
}
.card h4 { font-size: 16px; }
.card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin-top: 2px; }
.card__ico {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px;
  color: var(--primary); background: var(--sky-50); border: 1px solid var(--line);
}
.card__ico .ico { width: 22px; height: 22px; }
.card--out .card__ico { color: var(--accent-ink); background: var(--ai-bg); border-color: #b6e6f6; }
.card--doc { background: var(--sky-50); border-style: dashed; border-color: var(--line-strong); }
.card--pack { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(30, 192, 239, .12); }

.wire { width: 100%; height: 100%; overflow: visible; align-self: stretch; margin-top: 32px; }
.wire path { fill: none; vector-effect: non-scaling-stroke; }
.wire__base { stroke: #c4dbf6; stroke-width: 2; }
.wire__flow { stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 6 14; stroke-linecap: round; animation: wire-flow 1.6s linear infinite; }
.wire--out .wire__flow { animation-delay: -.8s; }

.board__core { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.core { width: 100%; height: auto; display: block; overflow: visible; }
.core__t { font-family: var(--font-head); text-anchor: middle; }
.core__t--ai { font-size: 21px; font-weight: 600; fill: var(--ink); text-anchor: start; }
.core__t--sub { font-size: 16px; font-weight: 500; fill: var(--accent-ink); text-anchor: start; }
.core__t--gate { font-size: 15px; font-weight: 500; fill: #ffffff; }
.core__t--idqi { font-size: 29px; font-weight: 600; fill: #ffffff; letter-spacing: .04em; }
.core__t--node { font-size: 18px; font-weight: 600; fill: var(--ink); }
.core__ico { fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.core__ico--light { stroke: #9fe3ff; }
.core__spin { transform-box: fill-box; transform-origin: center; animation: spin 60s linear infinite; }
.core__orbit { transform-box: view-box; transform-origin: 260px 292px; animation: spin 36s linear infinite reverse; }
.core__glow { transform-box: fill-box; transform-origin: center; animation: pulse 3.2s ease-in-out infinite; }
.core__slot { animation: blink 2.4s ease-in-out infinite; }
.core__ai { animation: float 5s ease-in-out infinite; }
.board__note { margin: 14px auto 0; max-width: 54em; text-align: center; font-size: 14.5px; color: var(--muted); }
.core__cap { margin-top: 6px; font-size: 14px; color: var(--muted); text-align: center; max-width: 30em; }

.legend { margin-top: 26px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.legend li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.legend h4 { font-size: 15.5px; }
.legend p { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 2px; }
.legend__ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; color: var(--primary); background: var(--sky-50); }
.legend__ico--ai { color: var(--ai-ink); background: var(--ai-bg); }
.legend__ico--gate { color: var(--on-primary); background: linear-gradient(135deg, var(--accent), var(--primary)); }
.legend__ico--box { color: #9fe3ff; background: var(--ink); }

/* ── ลำดับงาน ──────────────────────────────────────── */
.flow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.flow__step {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 18px;
  box-shadow: var(--shadow);
}
.flow__step::after {
  content: ""; position: absolute; top: 40px; right: -14px; width: 14px; height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--accent));
}
.flow__step::before {
  content: ""; position: absolute; top: 35px; right: -15px; width: 0; height: 0;
  border-left: 7px solid var(--accent); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  z-index: 1;
}
.flow__step:last-child::after, .flow__step:last-child::before { display: none; }
.flow__num {
  position: absolute; top: 12px; right: 14px; font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: var(--muted);
}
.flow__ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--primary); background: var(--sky-50); border: 1px solid var(--line); }
.flow__ico .ico { width: 24px; height: 24px; }
.flow__step h3 { font-size: 16.5px; }
.flow__step p { font-size: 14px; line-height: 1.6; color: var(--muted); }
.flow__step--gate { border-color: var(--line-strong); background: linear-gradient(180deg, #ffffff, var(--sky-50)); }
.flow__step--gate .flow__ico { color: var(--on-primary); background: linear-gradient(135deg, var(--accent), var(--primary)); border: 0; box-shadow: 0 8px 18px -8px rgba(11, 85, 196, .7); }
.flow__step--pack .flow__ico { color: var(--accent-ink); background: var(--ai-bg); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: 13px; line-height: 1.5; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.tag--ai { background: var(--ai-bg); color: var(--ai-ink); }
.tag--human { background: var(--human-bg); color: var(--human-ink); }
.tag--rule { background: var(--rule-bg); color: var(--rule-ink); }

/* ── หลักการ ───────────────────────────────────────── */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.principle__ico {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 14px;
  color: var(--on-primary); background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 10px 20px -10px rgba(11, 85, 196, .65);
}
.principle__ico .ico { width: 24px; height: 24px; }
.principle h3 { font-size: 18px; }
.principle p { margin-top: 6px; font-size: 15px; color: var(--muted); }

/* ── ทางเข้า 2 ระบบ ────────────────────────────────── */
.systems-sec { padding-bottom: 96px; }
.systems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.sys { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-lg); }
.sys--real { border-top: 5px solid var(--primary); }
.sys--demo { border-top: 5px solid #f0a23a; }
.sys__head { display: flex; align-items: center; gap: 14px; }
.sys__ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: var(--on-primary); background: linear-gradient(135deg, #2a7be6, var(--primary)); flex: none; }
.sys__ico .ico { width: 26px; height: 26px; }
.sys__ico--demo { color: var(--demo-ink); background: var(--demo-bg); }
.sys__kicker { font-size: 14px; color: var(--muted); }
.sys h3 { font-size: 24px; }
.sys > p { color: var(--ink-2); }
.badge { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 500; font-size: 15px; border-radius: 999px; padding: 5px 14px; }
.badge .ico { width: 18px; height: 18px; }
.badge--lock { background: var(--rule-bg); color: var(--rule-ink); }
.badge--demo { background: var(--demo-bg); color: var(--demo-ink); }
.sys__steps { counter-reset: s; display: grid; gap: 8px; }
.sys__steps li { counter-increment: s; position: relative; padding-left: 38px; color: var(--ink-2); font-size: 15.5px; }
.sys__steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-size: 14px; color: var(--primary);
  background: var(--sky-50); border: 1px solid var(--line-strong);
}
.sys__note { font-size: 14.5px; color: var(--muted); text-align: center; }

.links { display: grid; gap: 10px; }
.link {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.link:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.link__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--primary); background: var(--surface); border: 1px solid var(--line); flex: none; }
.link__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.link__text b { font-family: var(--font-head); font-weight: 500; font-size: 16.5px; }
.link__text small { font-size: 14px; color: var(--muted); }
.link__go { color: var(--primary); }
.link--app .link__ico { color: var(--demo-ink); background: var(--demo-bg); border-color: #f5d3a1; }

.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 14px; padding: 16px 18px; color: var(--warn-ink); }
.warn h4 { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--warn-ink); }
.warn h4 .ico { width: 20px; height: 20px; }
.warn ul { margin-top: 8px; display: grid; gap: 6px; }
.warn li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.6; }
.warn li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: #c77700; }

/* ── ท้ายหน้า ──────────────────────────────────────── */
.footer { background: var(--footer-bg); color: var(--footer-ink); padding: 34px 0; }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer__name { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.footer__brand p:not(.footer__name) { color: var(--footer-muted); font-size: 15px; }
.footer__tag { font-family: var(--font-head); font-weight: 500; color: var(--footer-muted); }

/* ── ภาพเคลื่อนไหว (ปิดเองเมื่อเครื่องตั้งลดการเคลื่อนไหว) ── */
@keyframes wire-flow { to { stroke-dashoffset: -40; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes blink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1239px) { .hero__float { display: none; } }

/* ── จอกลาง: ลำดับงานเป็นเส้นแนวตั้ง (7 การ์ดแนวนอนแคบเกินเมื่อจอ < 1240 px) · แผงแนวคิดเรียงบน-ล่างที่ < 1080 px ── */
@media (max-width: 1239px) {
  .flow { grid-template-columns: 1fr; gap: 0; max-width: 720px; margin-inline: auto; }
  .flow__step {
    display: grid; grid-template-columns: 46px 1fr; column-gap: 16px; row-gap: 4px; align-items: start;
    border-radius: 0; border-width: 0 0 0 0; box-shadow: none; background: transparent; padding: 0 0 26px 0;
  }
  .flow__step--gate { background: transparent; }
  .flow__step > :not(.flow__ico):not(.flow__num) { grid-column: 2; }
  .flow__ico { grid-row: 1 / span 3; position: relative; z-index: 1; }
  .flow__step::after { top: 50px; left: 22px; right: auto; width: 2px; height: calc(100% - 52px); background: linear-gradient(180deg, var(--accent), var(--line-strong)); }
  .flow__step::before { display: none; }
  .flow__num { position: static; grid-column: 2; grid-row: auto; order: -1; font-size: 13px; }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend li:last-child { grid-column: 1 / -1; }
}
@media (max-width: 1079px) {
  .board { grid-template-columns: 1fr; padding: 24px; gap: 8px; }
  .wire { display: none; }
  .board__core { order: 0; padding: 8px 0; }
  .board__in { order: -1; }
  .board__out { order: 1; }
  .board__core::before, .board__core::after {
    content: ""; display: block; width: 2px; height: 30px; margin: 4px auto;
    background: linear-gradient(180deg, var(--line-strong), var(--accent));
  }
  .core { max-width: 420px; }
  .board .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board__out .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board__out .card--pack { grid-column: 1 / -1; }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── มือถือ ────────────────────────────────────────── */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topnav a:not(.topnav__cta) { display: none; }
  .topnav .topnav__cta { margin-left: 0; padding: 8px 14px; }
  .brand__text span { font-size: 13px; }
  .hero { padding: 56px 0 48px; }
  .eyebrow { border-radius: 16px; font-size: 13.5px; padding: 6px 14px; line-height: 1.55; }
  .eyebrow__sep { display: none; }
  .hero__cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 420px; }
  .btn { width: 100%; justify-content: flex-start; }
  .why__in { padding: 18px; }
  .why__chips { justify-content: flex-start; }
  .section { padding-top: 64px; }
  .section__head { margin-bottom: 28px; }
  .board { padding: 16px; border-radius: 22px; }
  .board .cards, .board__out .cards { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .legend { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .systems { grid-template-columns: 1fr; }
  .sys { padding: 20px; }
  .footer__in { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .brand__text span { display: none; }
}

/* ── หน้าไม่พบ (404.html) ──────────────────────────── */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 48px 0;
  background: radial-gradient(50% 50% at 50% 20%, rgba(30, 192, 239, .18), transparent 70%), var(--bg); }
.notfound__in { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.notfound h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.notfound p:not(.kicker) { color: var(--ink-2); }
