/*
 * หน้า About
 *  1) ป้ายพลิกตัวเลขวิ่งไปหาวันก่อตั้ง   2) การ์ดเรื่องราวซ้อนกัน
 *  3) ม่านเปิดสองฝั่ง                   4) เอกสารคำมั่น เซ็นชื่อ + ประทับตรา
 * ใช้ --p (0→1) จาก assets/scrub.js
 */
body:has(.ab-hero) { background: #14110f; }
.ab-hero, .ab-deck, .ab-split, .ab-promise { color: #f4efe6; }
.ab-hero :is(p, span, i), .ab-deck :is(p, span, li), .ab-split :is(p, span, li, a), .ab-promise :is(p, span, li, b) { font-family: "Anuphan", sans-serif; }
.ab-tag { margin: 0 0 16px; font-size: 12px; letter-spacing: .34em; color: #ffb454; }
.ab-tag.dark { color: #b8540a; }
.about-sticky, .ab-hero-stage, .ab-deck-stage, .ab-pstage { position: sticky; top: 0; height: 100svh; min-height: 560px; box-sizing: border-box; overflow: hidden; }

/* ---------- 1) ป้ายพลิกวันที่ ---------- */
.ab-hero { position: relative; height: 300svh; background: radial-gradient(60% 50% at 50% 38%, #3a2615, #14110f 70%); }
.ab-hero-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 96px 20px 40px; }
.ab-hero h1 { margin: 0 0 clamp(14px, 2.4vw, 30px); font-size: clamp(26px, 3.4vw, 46px); font-weight: 800; letter-spacing: .02em; color: #f4efe6; }
.ab-hero h1 span { font-family: inherit; }
.ab-flap { display: flex; align-items: center; justify-content: center; gap: .42em; font-size: clamp(34px, 8.4vw, 128px); line-height: 1.16; font-family: "Archivo Black", "Anuphan", sans-serif; }
.ab-flap .g { display: flex; gap: .07em; }
.ab-flap .col { --k0: clamp(0, (var(--p, 0) - var(--s)) / .42, 1); --k: calc(var(--k0) * var(--k0) * (3 - 2 * var(--k0)));
  position: relative; display: block; width: .72em; height: 1.16em; overflow: hidden; border-radius: .09em; color: #fff7e8;
  background: linear-gradient(#2a2420 50%, #1d1815 50%); box-shadow: inset 0 0 0 1px #ffffff14, 0 .18em .4em #0008; }
.ab-flap .col::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #0b0908; box-shadow: 0 1px 0 #ffffff12; }
.ab-flap .col.m { width: 2.3em; }
.ab-flap .strip { display: flex; flex-direction: column; transform: translateY(calc(var(--t) * -1.16em * var(--k))); }
.ab-flap .strip > span { display: block; height: 1.16em; line-height: 1.16em; text-align: center; }
.ab-flap .col.m .strip > span { font-size: .8em; line-height: 1.45em; height: 1.45em; }
.ab-flap .col.m .strip { transform: translateY(calc(var(--t) * -1.16em * var(--k))); }
.ab-flap .col.m { height: 1.16em; }
.ab-flap .col.m .strip > span span { font-family: inherit; }
.ab-be { margin: clamp(16px, 2.6vw, 30px) 0 0; font-size: clamp(15px, 1.6vw, 21px); letter-spacing: .08em; color: #ffb454;
  opacity: clamp(0, (var(--p, 0) - .6) / .1, 1); transform: translateY(calc((1 - clamp(0, (var(--p, 0) - .6) / .1, 1)) * 14px)); }
.ab-lead { margin: 14px 0 0; max-width: 40em; font-size: clamp(15px, 1.5vw, 20px); line-height: 1.8; color: #d4cabb;
  opacity: clamp(0, (var(--p, 0) - .7) / .12, 1); transform: translateY(calc((1 - clamp(0, (var(--p, 0) - .7) / .12, 1)) * 18px)); }
.ab-cue { position: absolute; bottom: 28px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .16em; color: #b9ad9c; opacity: calc(1 - clamp(0, var(--p, 0) * 6, 1)); }
.ab-cue i { width: 1px; height: 34px; background: linear-gradient(#ffb454, transparent); animation: ab-drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes ab-drip { 0% { transform: scaleY(0); } 60%, 100% { transform: scaleY(1); } }

/* ---------- 2) การ์ดซ้อน ---------- */
.ab-deck { position: relative; height: 460svh; background: #14110f; }
.ab-deck-stage { display: grid; place-items: center; padding: 84px 20px 30px; }
.ab-cards { position: relative; width: min(1060px, 92vw); height: min(64svh, 560px); }
.ab-card { --in: clamp(0, (var(--p, 0) - var(--s) + .02) / .2, 1); --sh: clamp(0, (var(--p, 0) - var(--s) - .1) / .6, 1);
  position: absolute; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(18px, 4vw, 64px); padding: clamp(22px, 4vw, 58px); border-radius: 30px; overflow: hidden;
  box-shadow: 0 -10px 40px #0006, 0 30px 60px #0007;
  transform: translateY(calc((1 - var(--in)) * 112%)) translateY(calc(var(--sh) * -46px)) scale(calc(1 - var(--sh) * .1)); }
.ab-card:first-child { --in: 1; }
.ab-card::after { content: ""; position: absolute; inset: 0; background: #000; opacity: calc(var(--sh) * .5); pointer-events: none; }
.ab-card.c0 { background: linear-gradient(135deg, #e8912a, #a8480c); }
.ab-card.c1 { background: linear-gradient(135deg, #d8465b, #7c1d3d); }
.ab-card.c2 { background: linear-gradient(135deg, #17a58f, #0a4f66); }
.ab-card.c3 { background: linear-gradient(135deg, #6a5cff, #261c80); }
.ab-card .num { margin: 0; font-size: clamp(70px, 14vw, 210px) !important; line-height: .9; font-weight: 800; color: transparent; -webkit-text-stroke: 2px #ffffffcc; font-family: "Archivo Black", "Anuphan", sans-serif; }
.ab-card h2 { margin: 0 0 14px; font-size: clamp(26px, 3.6vw, 52px); line-height: 1.1; font-weight: 800; color: #fff; }
.ab-card h2 span { font-family: inherit; }
.ab-card p:not(.num) { margin: 0 0 18px; max-width: 36em; font-size: clamp(14px, 1.35vw, 18px); line-height: 1.8; color: #ffffffe6; }
.ab-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ab-card li { padding: 7px 14px; border-radius: 99px; font-size: 13px; background: #00000033; border: 1px solid #ffffff44; }

/* ---------- 3) ม่านเปิดสองฝั่ง ---------- */
.ab-split { position: relative; padding: clamp(60px, 9vw, 130px) clamp(20px, 6vw, 96px); background: #14110f; }
.ab-split-in { max-width: 1180px; margin: 0 auto; }
.ab-panels { --o: clamp(0, (var(--p, 0) - .12) / .3, 1); position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: min(62svh, 520px); border-radius: 30px; overflow: hidden; }
.ab-panels .pn { position: relative; display: flex; align-items: stretch; }
.ab-panels .pn.a { background: radial-gradient(80% 80% at 0 0, #f0a03a55, transparent 60%), linear-gradient(160deg, #3a2412, #1c130c); clip-path: inset(0 0 0 calc((1 - var(--o)) * 100%)); }
.ab-panels .pn.b { background: radial-gradient(80% 80% at 100% 100%, #35e0ff44, transparent 60%), linear-gradient(200deg, #0d2740, #071322); clip-path: inset(0 calc((1 - var(--o)) * 100%) 0 0); }
.pn-body { padding: clamp(24px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; opacity: clamp(0, (var(--o) - .55) * 3, 1); transform: translateY(calc((1 - clamp(0, (var(--o) - .55) * 3, 1)) * 20px)); }
.pn .k { margin: 0 0 12px; font-size: 12px; letter-spacing: .26em; color: #ffb454; }
.pn.b .k { color: #5fe6ff; }
.pn h3 { margin: 0 0 20px; font-size: clamp(24px, 2.8vw, 40px); line-height: 1.15; font-weight: 800; color: #fff; }
.pn h3 span { font-family: inherit; }
.pn ul { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 12px; }
.pn li { position: relative; padding-left: 26px; font-size: clamp(14px, 1.3vw, 17px); line-height: 1.6; color: #e6ddd0; }
.pn li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: #ffb454; }
.pn.b li::before { background: #5fe6ff; }
.ab-link { display: inline-flex; align-items: center; gap: 12px; width: fit-content; padding: 11px 22px; border: 1px solid #ffffff55; border-radius: 99px; color: #fff; text-decoration: none; font-size: 14px; transition: background .3s, gap .3s; }
.ab-link i { width: 18px; height: 1px; background: currentColor; position: relative; } .ab-link i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; rotate: 45deg; }
.ab-link:hover { background: #ffffff1f; gap: 18px; }
.ab-panels .seam { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; translate: -50% 0; background: linear-gradient(transparent, #fff, transparent); box-shadow: 0 0 24px 4px #ffb45499; opacity: calc(1 - var(--o)); pointer-events: none; }

/* ---------- 4) เอกสารคำมั่น ---------- */
.ab-promise { position: relative; height: 380svh; background: radial-gradient(60% 50% at 50% 50%, #2a1d12, #14110f 75%); }
.ab-pstage { display: grid; place-items: center; padding: 84px 16px 24px; }
.ab-paper { --rise: clamp(0, var(--p, 0) / .1, 1); position: relative; width: min(760px, 94vw); max-height: calc(100svh - 110px); padding: clamp(22px, 3.4vw, 46px) clamp(22px, 4vw, 56px) clamp(22px, 3vw, 36px); color: #2a2118; background: #f6eedc;
  background-image: repeating-linear-gradient(#0000 0 31px, #e3d6b8 31px 32px); border-radius: 6px; box-shadow: 0 40px 80px #000a;
  transform: translateY(calc((1 - var(--rise)) * 60svh)) rotate(calc((1 - var(--rise)) * 6deg - .6deg)); }
.ab-paper h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 40px); line-height: 1.1; font-weight: 800; color: #2a2118; }
.ab-paper h2 span { font-family: inherit; }
.ab-paper ol { margin: 0; padding: 0; list-style: none; display: grid; gap: clamp(8px, 1.3vw, 14px); }
.ab-paper li { --a: calc(.1 + var(--k) * .11); --g: clamp(0, (var(--p, 0) - var(--a)) / .1, 1); display: grid; grid-template-columns: 2em 1fr; gap: 12px; align-items: start;
  opacity: var(--g); transform: translateX(calc((1 - var(--g)) * -26px)); }
.ab-paper li .n { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; border: 1.5px solid #b8540a; color: #b8540a; font-size: 14px; font-weight: 700; }
.ab-paper li b { display: block; font-size: clamp(15px, 1.5vw, 19px); color: #2a2118; }
.ab-paper li b span { font-family: inherit; }
.ab-paper li div > span { display: block; font-size: clamp(13px, 1.2vw, 15.5px); line-height: 1.55; color: #5a4a37; }
.ab-sign { position: relative; margin-top: clamp(14px, 2vw, 26px); padding-top: 12px; border-top: 1px solid #c9b88f; min-height: 88px; }
.ab-sign svg { display: block; width: clamp(170px, 30vw, 250px); height: auto; overflow: visible; }
.ab-sign .ink { fill: none; stroke: #1d2a6b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - clamp(0, (var(--p, 0) - .68) / .16, 1)); }
.ab-sign p { margin: 2px 0 0; font-size: 13px; color: #6a5844; letter-spacing: .02em; }
.ab-sign p span { font-family: inherit; }
.ab-sign .seal { --s: clamp(0, (var(--p, 0) - .86) / .08, 1); position: absolute; right: 0; top: -8px; width: clamp(96px, 15vw, 132px); aspect-ratio: 1; color: #b3263e; opacity: var(--s);
  transform: scale(calc(2.4 - var(--s) * 1.4)) rotate(calc(-36deg + var(--s) * 24deg)); mix-blend-mode: multiply; }
.ab-sign .seal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ab-sign .seal img { position: absolute; inset: 27%; width: 46%; height: 46%; object-fit: contain; filter: saturate(.8); }

@media (max-width: 900px) {
  .ab-hero { height: 260svh; }
  .ab-flap { font-size: clamp(22px, 7.8vw, 44px); gap: .3em; }
  .ab-flap .col.m { width: 2.4em; }
  .ab-deck { height: 420svh; }
  .ab-cards { height: min(74svh, 620px); }
  .ab-card { grid-template-columns: 1fr; align-content: center; gap: 6px; padding: 22px 20px; }
  .ab-card .num { font-size: 56px !important; }
  .ab-card h2 { font-size: 26px; margin-bottom: 8px; }
  .ab-card p:not(.num) { font-size: 13.5px; line-height: 1.65; margin-bottom: 12px; }
  .ab-panels { grid-template-columns: 1fr; }
  .ab-panels .pn.a { clip-path: inset(0 0 calc((1 - var(--o)) * 100%) 0); }
  .ab-panels .pn.b { clip-path: inset(calc((1 - var(--o)) * 100%) 0 0 0); }
  .ab-panels .seam { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 2px; translate: 0 -50%; }
  .ab-promise { height: 360svh; }
  .ab-paper { padding: 22px 18px 18px; }
  .ab-paper li { gap: 9px; }
  .ab-paper li div > span { font-size: 12.5px; line-height: 1.45; }
  .ab-sign { min-height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .ab-hero, .ab-deck, .ab-promise { height: auto; }
  .ab-hero-stage, .ab-deck-stage, .ab-pstage { position: relative; height: auto; min-height: 0; overflow: visible; }
  .ab-cards { height: auto; display: grid; gap: 18px; }
  .ab-card { position: relative; transform: none; }
}
@media (max-width: 900px) {
  .ab-sign .seal { top: -42px; width: 92px; }
  .ab-sign p { padding-right: 0; }
}
