/* Guide pages (guides/*.html, built by tools/guides/build.js). Uses site.css for tokens, header, buttons. No script:
   the motion is CSS only (drifting light, entrance, reading bar and sections that rise as you scroll). */
.gd { --gold: #f6c453; }
.gd main, .gd footer { position: relative; z-index: 1; }
.gdbg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.gdbg i { position: absolute; border-radius: 50%; opacity: .5; }
.gdbg i:nth-child(1) { width: 70vw; height: 50vw; left: -24vw; top: -26vw; background: radial-gradient(closest-side, rgba(20, 99, 243, .5), transparent); animation: gdD1 24s ease-in-out infinite; }
.gdbg i:nth-child(2) { width: 50vw; height: 40vw; right: -18vw; top: 30vh; background: radial-gradient(closest-side, rgba(47, 166, 255, .26), transparent); animation: gdD2 28s ease-in-out infinite; }
.gdbg i:nth-child(3) { width: 60vw; height: 40vw; left: 10vw; bottom: -30vw; background: radial-gradient(closest-side, rgba(10, 58, 166, .45), transparent); animation: gdD1 32s ease-in-out infinite reverse; }
@keyframes gdD1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(7vw, 5vw) scale(1.08); } }
@keyframes gdD2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-7vw, 7vw); } }

/* reading bar */
.gdprog { position: fixed; inset: 0 0 auto; z-index: 120; height: 3px; background: var(--grad); box-shadow: 0 0 10px rgba(47, 166, 255, .8); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .gdprog { animation: gdProg linear both; animation-timeline: scroll(root); }
  @keyframes gdProg { to { transform: scaleX(1); } }
}

/* header: language links look like the main site's TH / EN buttons */
.gd .lang a { display: inline-grid; place-items: center; min-width: 38px; height: 30px; padding: 0 10px; border-radius: 999px; font: 700 12.5px/1 var(--fd); letter-spacing: .06em; color: var(--muted); transition: color .2s; }
.gd .lang a:hover { color: var(--text); }
.gd .lang a[aria-current="true"] { color: #fff; background: var(--grad-btn); box-shadow: 0 4px 14px -6px rgba(20, 99, 243, .9); }
.gd .nav { margin-left: auto; }

.gd__main { padding: calc(var(--hdr) + 40px) 0 80px; max-width: 900px; }
.gd__crumb { display: flex; gap: 10px; font-size: 14px; color: var(--dim); }
.gd__crumb a { color: var(--muted); }
.gd__crumb a:hover { color: var(--text); }

.gd__head { margin-top: 26px; animation: gdIn .9s var(--ease) both; }
.gd__head .kicker .ic { width: 18px; height: 18px; }
.gd__head h1 { margin-top: 16px; font: 800 clamp(32px, 4.4vw, 50px)/1.22 var(--fd); text-wrap: balance; }
.gd__head h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gd__lead { margin-top: 18px; font-size: 18.5px; line-height: 1.75; color: var(--muted); animation: gdIn .9s .12s var(--ease) both; }
.gd__meta { margin-top: 14px; font-size: 14px; color: var(--dim); }
@keyframes gdIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.gd__toc { margin-top: 30px; padding: 20px 24px; border-radius: 20px; border: 1px solid var(--line2); background: rgba(10, 22, 50, .55); animation: gdIn .9s .24s var(--ease) both; }
.gd__toc p { font: 700 14px/1 var(--fd); letter-spacing: .08em; color: var(--sky); text-transform: uppercase; }
.gd__toc ol { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; list-style: decimal inside; color: var(--dim); font-size: 15px; }
.gd__toc a { color: var(--muted); }
.gd__toc a:hover { color: var(--text); }

.gd__sec { margin-top: 44px; scroll-margin-top: calc(var(--hdr) + 24px); }
@supports (animation-timeline: view()) {
  .gd__sec, .gd__rule, .gd__card, .gd__cta { animation: gdIn linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
}
.gd__sec h2 { font: 800 clamp(24px, 2.6vw, 30px)/1.3 var(--fd); }
.gd__sec > p { margin-top: 12px; font-size: 17px; line-height: 1.8; color: var(--muted); }
.gd__steps, .gd__list { margin-top: 14px; display: grid; gap: 8px; }
.gd__steps { counter-reset: st; }
.gd__steps li, .gd__list li { position: relative; padding: 12px 16px 12px 52px; border-radius: 14px; border: 1px solid var(--line); background: rgba(10, 22, 50, .45); font-size: 16px; line-height: 1.65; color: var(--text); }
.gd__steps li::before { counter-increment: st; content: counter(st); position: absolute; left: 14px; top: 11px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; font: 800 14px/1 var(--fd); color: #fff; background: var(--grad-btn); }
.gd__list li::before { content: ""; position: absolute; left: 22px; top: 21px; width: 8px; height: 8px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 10px var(--sky); }
.gd__tip { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 181, 74, .1); border: 1px solid rgba(255, 181, 74, .3); color: #ffd79a; font-size: 15.5px; line-height: 1.65; }
.gd__tip .ic { margin-top: 2px; color: var(--warn); }

.gd__rule { margin-top: 18px; padding: 22px 24px; border-radius: 20px; border: 1px solid var(--line); background: rgba(10, 22, 50, .5); scroll-margin-top: calc(var(--hdr) + 24px); transition: border-color .3s; }
.gd__rule:hover { border-color: rgba(98, 180, 255, .4); }
.gd__rule h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 700 20px/1.35 var(--fd); }
.gd__rule > p { margin-top: 8px; font-size: 16px; line-height: 1.75; color: var(--muted); }
.gd__tag { padding: 4px 10px; border-radius: 999px; font: 600 12.5px/1.2 var(--fb); color: #ffd79a; background: rgba(255, 181, 74, .12); border: 1px solid rgba(255, 181, 74, .35); }

.gd__cta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 22px; align-items: center; margin-top: 60px; padding: 30px; border-radius: 26px; border: 1px solid rgba(98, 180, 255, .35); background: radial-gradient(90% 140% at 0% 0%, rgba(20, 99, 243, .4), rgba(6, 14, 34, .92) 70%); box-shadow: 0 40px 90px -50px rgba(20, 99, 243, .9); }
.gd__cta > img { filter: drop-shadow(0 0 22px rgba(47, 166, 255, .7)); animation: gdBob 5s ease-in-out infinite; }
@keyframes gdBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.gd__cta h2 { font: 800 26px/1.25 var(--fd); }
.gd__cta p { margin-top: 6px; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.gd__ctab { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
.gd__ctab .ic { width: 18px; height: 18px; }

.gd__more { margin-top: 60px; }
.gd__more h2 { font: 800 26px/1.3 var(--fd); }
.gd__cards { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.gd__cards--idx { margin-top: 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gd__card { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 22px; border: 1px solid var(--line); background: rgba(10, 22, 50, .55); transition: transform .45s var(--spring), border-color .3s, background-color .3s; }
.gd__card:hover { transform: translateY(-6px); border-color: rgba(98, 180, 255, .45); background: rgba(14, 32, 72, .62); }
.gd__card > .ic { width: 46px; height: 46px; padding: 11px; border-radius: 14px; color: var(--sky); background: linear-gradient(145deg, rgba(47, 166, 255, .22), rgba(20, 99, 243, .12)); box-shadow: 0 0 0 1px rgba(98, 180, 255, .25) inset; }
.gd__card h3 { margin-top: 14px; font: 700 19px/1.35 var(--fd); }
.gd__card p { margin-top: 8px; flex: 1; font-size: 15px; line-height: 1.65; color: var(--muted); }
.gd__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 700; color: var(--sky); }
.gd__go .ic { width: 16px; height: 16px; transition: transform .35s var(--spring); }
.gd__card:hover .gd__go .ic { transform: translateX(4px); }

.gdft { position: relative; border-top: 1px solid var(--line); background: #02050d; }
.gdft__in { display: grid; gap: 8px; padding: 26px 0 34px; font-size: 13.5px; color: var(--dim); }
.gdft__in p:nth-child(2) { display: flex; flex-wrap: wrap; gap: 18px; }
.gdft__in a { color: var(--muted); }
.gdft__in a:hover { color: var(--text); }

@media (max-width: 760px) {
  .gd__toc ol, .gd__cards--idx { grid-template-columns: minmax(0, 1fr); }
  .gd .nav { display: none; }
  .gd .hdr__cta span { display: none; }
  .gd__cta { grid-template-columns: minmax(0, 1fr); }
}

/* language links as flags, like the site (owner 16 Oct) */
.gd .lang { padding: 0; gap: 8px; border: 0; background: none; }
.gd .lang a { position: relative; min-width: 0; width: 40px; height: 27px; padding: 0; border-radius: 7px; overflow: hidden; text-indent: -999px; color: transparent; background: center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); filter: grayscale(1) brightness(.55); opacity: .85; transition: filter .25s, opacity .25s, box-shadow .25s, transform .25s var(--spring); }
.gd .lang a[data-lang="th"], .gd .lang a[hreflang="th"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 4'%3E%3Crect width='6' height='4' fill='%23A51931'/%3E%3Crect y='.667' width='6' height='2.667' fill='%23F4F5F8'/%3E%3Crect y='1.333' width='6' height='1.333' fill='%232D2A4A'/%3E%3C/svg%3E"); }
.gd .lang a[data-lang="en"], .gd .lang a[hreflang="en"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='t'%3E%3Cpath d='M30,15h30v15zv15h-30zh-30v-15zv-15h30z'/%3E%3C/clipPath%3E%3Cpath d='M0,0v30h60v-30z' fill='%23012169'/%3E%3Cpath d='M0,0L60,30M60,0L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0L60,30M60,0L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0v30M0,15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0v30M0,15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E"); }
.gd .lang a:hover { filter: grayscale(.5) brightness(.85); opacity: 1; transform: translateY(-1px); }
.gd .lang a[aria-current="true"] { filter: none; opacity: 1; background-color: transparent; box-shadow: 0 0 0 2px rgba(225, 233, 246, .9), 0 6px 16px -6px rgba(0, 0, 0, .7); }
.gd .lang a { display: block; }
.gd__draft { display: inline-block; margin-bottom: 12px; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #f6c453; background: rgba(246, 196, 83, .1); border: 1px solid rgba(246, 196, 83, .35); }
