/* King Dollar Academy — ระบบดีไซน์กลาง ใช้ร่วมกันทุกหน้า
   แก้ที่ไฟล์นี้ไฟล์เดียว เปลี่ยนพร้อมกันทั้งเว็บ */

/* พื้นเข้มคือธีมหลักของแบรนด์นี้ :root จึงเก็บชุดสีเข้ม
   แล้วบล็อกด้านล่างค่อยแปลงโทเคนชุดเดียวกันเป็นธีมสว่าง */
:root {
  --ink:        #080B14;
  --ink-raise:  #0F1524;
  --ink-edge:   #1C2438;
  --hair:       #232C42;
  --text:       #E6EAF3;
  --text-dim:   #8A96B2;
  --text-faint: #5C6884;
  --brass:      #C79A44;
  --brass-soft: #8A6C2E;
  --brass-wash: rgba(199,154,68,0.10);
  --buy:        #3E9E6B;
  --sell:       #C05B52;
  --line-green: #06C755;
  --shadow:     0 1px 0 rgba(255,255,255,0.03) inset;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink:        #F5F4F0;
    --ink-raise:  #FFFFFF;
    --ink-edge:   #E3E1D9;
    --hair:       #D8D5CB;
    --text:       #171C28;
    --text-dim:   #5A6377;
    --text-faint: #8A93A5;
    --brass:      #8A6410;
    --brass-soft: #B9924A;
    --brass-wash: rgba(138,100,16,0.08);
    --buy:        #2F7F52;
    --sell:       #A94237;
    --shadow:     0 1px 2px rgba(23,28,40,0.04);
  }
}
:root[data-theme="light"] {
  --ink:        #F5F4F0;
  --ink-raise:  #FFFFFF;
  --ink-edge:   #E3E1D9;
  --hair:       #D8D5CB;
  --text:       #171C28;
  --text-dim:   #5A6377;
  --text-faint: #8A93A5;
  --brass:      #8A6410;
  --brass-soft: #B9924A;
  --brass-wash: rgba(138,100,16,0.08);
  --buy:        #2F7F52;
  --sell:       #A94237;
  --shadow:     0 1px 2px rgba(23,28,40,0.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display {
  font-family: "Chakra Petch", "IBM Plex Sans Thai", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -0.01em;
}
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.rule { border: 0; border-top: 1px solid var(--hair); margin: 0; }

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
}

/* ── รางสถานะด้านบน ─────────────────────────────────────── */
.rail {
  border-bottom: 1px solid var(--hair);
  background: var(--ink);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.rail-in { display: flex; align-items: center; gap: 20px; height: 56px; }
.mark {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap; text-decoration: none;
}
.mark span.sub { color: var(--text-faint); font-weight: 500; }
.mark-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-wash);
}
.rail-ticker {
  display: flex; gap: 18px; align-items: center;
  margin-left: auto; font-size: 12px; color: var(--text-faint);
  overflow-x: auto; scrollbar-width: none;
}
.rail-ticker::-webkit-scrollbar { display: none; }
.rail-ticker span { white-space: nowrap; }

/* ── ปุ่ม ────────────────────────────────────────────────── */
.btn-brass, .btn-line, .btn-ghost {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 4px;
  text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn-brass { background: var(--brass); color: #150F02; }
.btn-line  { background: var(--line-green); color: #06210F; }
.btn-brass:hover, .btn-line:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { border-color: var(--hair); color: var(--text-dim); font-weight: 600; }
.btn-ghost:hover { border-color: var(--brass-soft); color: var(--text); }
.btn-brass:focus-visible, .btn-line:focus-visible, .btn-ghost:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 3px;
}
.btn-full { width: 100%; }
.btn-sm { font-size: 13px; padding: 7px 14px; }

/* ── หัวหน้าเพจ ──────────────────────────────────────────── */
.page-head { padding: 56px 0 40px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 16px 0 0; }
.page-head p { margin-top: 16px; color: var(--text-dim); max-width: 60ch; }

section { padding: 48px 0; }
.sec-head { max-width: 60ch; margin-bottom: 32px; }
.sec-head h2 { font-size: clamp(22px, 3vw, 28px); margin-top: 12px; }
.sec-head p { margin-top: 12px; color: var(--text-dim); }

/* ── แคตตาล็อกเครื่องมือ — เป็นรายการ ไม่ใช่การ์ดซ้ำๆ ──── */
.tools { display: grid; gap: 0; }
.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
  gap: 24px; align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--hair);
}
.tool:last-child { border-bottom: 1px solid var(--hair); }
.tool-name { font-family: "Chakra Petch", sans-serif; font-weight: 600; font-size: 16px; }
.tool-name small {
  display: block; font-family: "IBM Plex Mono", monospace;
  font-size: 11px; color: var(--text-faint);
  font-weight: 400; letter-spacing: 0.04em; margin-top: 3px;
}
.tool-desc { font-size: 14px; color: var(--text-dim); }
.tool-get { display: flex; gap: 8px; align-items: center; }

/* ── แถบชุดรวม ───────────────────────────────────────────── */
.bundle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
  padding: 26px 28px;
  background: var(--ink-raise);
  border: 1px solid var(--ink-edge);
  border-left: 2px solid var(--brass);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.bundle h2 { font-size: 20px; }
.bundle p { color: var(--text-dim); font-size: 14px; margin-top: 8px; max-width: 52ch; }

/* ── แถบบอกว่าใครล็อกอินอยู่ ────────────────────────────── */
.whoami {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 11px 16px; margin-top: 20px;
  border: 1px solid var(--ink-edge); border-radius: 5px;
  background: var(--ink-raise);
  font-size: 13px;
}
.whoami-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.whoami-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--buy); flex: none; }
.link-quiet {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-faint); font: inherit; text-decoration: underline;
  text-underline-offset: 3px; transition: color 0.12s ease;
}
.link-quiet:hover { color: var(--sell); }
.link-quiet:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ── คู่มือติดตั้ง ───────────────────────────────────────── */
.steps { display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 40px 1fr; gap: 18px;
  padding: 20px 0; border-top: 1px solid var(--hair);
}
.step:last-child { border-bottom: 1px solid var(--hair); }
.step-n {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 20px; color: var(--brass); line-height: 1.3;
}
.step h3 { font-size: 15px; margin-bottom: 5px; }
.step p { font-size: 14px; color: var(--text-dim); max-width: 58ch; }
.step code {
  font-family: "IBM Plex Mono", monospace; font-size: 13px;
  color: var(--text); background: var(--brass-wash);
  padding: 1px 5px; border-radius: 3px;
}

.notice {
  border-left: 2px solid var(--brass);
  padding: 4px 0 4px 20px;
  font-size: 14px; color: var(--text-dim);
  max-width: 64ch;
}
.notice strong { color: var(--brass); font-weight: 600; }

/* ── ท้ายหน้า ────────────────────────────────────────────── */
footer { padding: 40px 0 52px; border-top: 1px solid var(--hair); margin-top: 24px; }
.foot-grid { display: flex; gap: 40px; justify-content: space-between; flex-wrap: wrap; }
.disclaim { font-size: 12px; color: var(--text-faint); max-width: 62ch; line-height: 1.8; }
.disclaim strong { color: var(--text-dim); font-weight: 500; }
.foot-meta { font-size: 12px; color: var(--text-faint); display: grid; gap: 6px; }

@media (max-width: 780px) {
  .tool { grid-template-columns: 1fr; gap: 10px; }
  .tool-get { width: 100%; }
  .tool-get .btn-brass, .tool-get .btn-ghost { flex: 1; }
  .rail-ticker { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
