/* หน้าแรกสาธารณะ (app/Views/public/landing.php) — โหลดเฉพาะหน้านี้ ต่อจาก public.css
   แนวเดียวกับหน้าแรก BAP Hackathon เดิม: เวทีสีดำ กริดเลื่อน จุดเชื่อมโยง (landing.js) ตัวอักษรเรืองแสง การ์ดลอยเมื่อชี้
   แต่ใช้สีเหลือง–ดำของ AI SIAM แทนแดง · เวทีเป็นสีดำทั้งโหมดสว่างและมืด จึงกำหนดสีของตัวเองใน .lp ไม่ใช้ token ของธีม */

.lp {
  --lp-bg: #0b0b0a;
  --lp-ink: #f4f2ea;
  --lp-muted: #aaa696;
  --lp-dim: #77735f;
  --lp-line: rgba(255, 255, 255, .08);
  --lp-card: rgba(255, 255, 255, .03);
  --lp-y: #dfcc63;
  --lp-y-hi: #ecdb85;
  background: var(--lp-bg); color: var(--lp-ink);
  position: relative; overflow: hidden;
}
.lp a { color: inherit; }
.lp a:hover { text-decoration: none; }
.lp :focus-visible { outline: 3px solid rgba(223, 204, 99, .75); outline-offset: 3px; }

/* ผู้ที่ยังไม่ล็อกอิน: เวทีเต็มความกว้างจอ ต่อจากแถบนำทางสาธารณะลงไปจนสุดหน้า */
body:has(.content-plain .lp) { background: #0b0b0a; }
.content-plain:has(.lp) { padding-bottom: 0; }
.content-plain:has(.lp) .pub-nav { margin-bottom: 0; }
.content-plain .lp { margin: 0 calc(50% - 50vw); }
/* ผู้ที่ล็อกอินแล้ว (/explore): อยู่ในกรอบเนื้อหาข้างเมนู */
.content:not(.content-plain) .lp { border-radius: 18px; }

/* ── เวทีหลัก ───────────────────────────────────────────── */
.lp-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: calc(100svh - 58px);
  display: flex; align-items: center; justify-content: center;
  padding: 72px 24px 48px; text-align: center;
}
.content:not(.content-plain) .lp-hero { min-height: 0; padding: 64px 24px 44px; }
.lp-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 85% 55% at 50% -8%, rgba(223, 204, 99, .26) 0%, transparent 65%);
}
/* ขอบล่างของเวทีค่อยๆ จางเป็นพื้นดำ (วาดทับกริดและจุด เพราะมาทีหลังใน z-index เดียวกัน) */
.lp-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: -1; pointer-events: none;
  background: linear-gradient(transparent, var(--lp-bg));
}
.lp-gridbg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(223, 204, 99, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(223, 204, 99, .065) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: lpGrid 22s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, #000 20%, transparent 80%);
          mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, #000 20%, transparent 80%);
}
@keyframes lpGrid { to { background-position: 60px 60px; } }
.lp-canvas { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.lp-hero-in { position: relative; max-width: 980px; display: flex; flex-direction: column; align-items: center; }

.lp-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 18px; border-radius: 99px;
  background: rgba(223, 204, 99, .1); border: 1px solid rgba(223, 204, 99, .38);
  color: var(--lp-y-hi); font: 600 13px/1.4 "Outfit", "IBM Plex Sans", sans-serif;
  letter-spacing: .14em; text-transform: uppercase;
}
.lp-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--lp-y);
  box-shadow: 0 0 10px var(--lp-y); animation: lpBlink 1.6s ease-in-out infinite;
}
@keyframes lpBlink { 50% { opacity: .25; } }

.lp-mark {
  height: clamp(84px, 13vw, 160px); width: auto; margin: 30px 0 22px;
  color: var(--lp-y);
  filter: drop-shadow(0 0 26px rgba(223, 204, 99, .45)) drop-shadow(0 0 80px rgba(223, 204, 99, .22));
}

.lp-title {
  margin: 0; color: #fff; font-weight: 700;
  font-size: clamp(34px, 6.2vw, 74px); line-height: 1.28; letter-spacing: -.005em;
}
.lp-title span {
  display: block; color: var(--lp-y);
  text-shadow: 0 0 50px rgba(223, 204, 99, .45), 0 0 110px rgba(223, 204, 99, .2);
}
.lp-tagline {
  margin: 20px 0 0; color: #8f8b78;
  font: 500 clamp(12px, 1.35vw, 15px)/1.6 "Outfit", "IBM Plex Sans", sans-serif;
  letter-spacing: .24em; text-transform: uppercase;
}
.lp-lead { max-width: 690px; margin: 18px 0 32px; color: var(--lp-muted); font-size: 19px; line-height: 1.75; }

/* ปุ่ม */
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lp .lp-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 30px; border-radius: 12px; border: 1.5px solid var(--lp-y);
  background: var(--lp-y); color: #141414; font-size: 17px; font-weight: 600; line-height: 1.4;
  transition: transform .2s, box-shadow .2s, background-color .2s, border-color .2s, color .2s;
}
.lp .lp-btn::before {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transition: transform .6s ease;
}
.lp .lp-btn:hover { background: var(--lp-y-hi); border-color: var(--lp-y-hi); transform: translateY(-2px); box-shadow: 0 10px 32px rgba(223, 204, 99, .32); }
.lp .lp-btn:hover::before { transform: translateX(100%); }
.lp .lp-btn-ghost { background: transparent; color: #e9e6da; border-color: rgba(255, 255, 255, .2); }
.lp .lp-btn-ghost::before { display: none; }
.lp .lp-btn-ghost:hover { background: rgba(223, 204, 99, .08); border-color: var(--lp-y); color: var(--lp-y-hi); box-shadow: none; }
.lp-g { width: 20px; height: 20px; flex: none; }

/* ตัวเลข — กล่องแบบนาฬิกานับถอยหลังของ Hackathon */
.lp-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }
.lp-stat {
  position: relative; overflow: hidden; min-width: 150px;
  padding: 16px 22px 14px; border-radius: 14px;
  background: var(--lp-card); border: 1px solid var(--lp-line);
}
.lp-stat::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 204, 99, .7), transparent);
}
.lp-stat b {
  display: block; color: #fff; font: 800 40px/1.1 "Outfit", "IBM Plex Sans", sans-serif;
  font-variant-numeric: tabular-nums;
}
.lp-stat span { display: block; margin-top: 4px; color: var(--lp-muted); font-size: 14px; }

.lp .lp-scroll { margin-top: 40px; color: var(--lp-muted); font-size: 14.5px; letter-spacing: .04em; }
.lp-scroll span { display: inline-block; animation: lpBob 2s ease-in-out infinite; }
.lp .lp-scroll:hover { color: var(--lp-y); }
@keyframes lpBob { 50% { transform: translateY(5px); } }

/* ── ส่วนถัดไป ─────────────────────────────────────────── */
.lp-sec { position: relative; max-width: 1180px; margin: 0 auto; padding: 76px 24px 4px; }
.content:not(.content-plain) .lp-sec { padding-top: 52px; }
.lp-head { text-align: center; margin-bottom: 36px; }
.lp-head h2 { margin: 6px 0 0; color: #fff; font-size: clamp(26px, 3.3vw, 38px); line-height: 1.35; }
.lp-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; text-align: left; flex-wrap: wrap; }
.lp-eyebrow {
  color: var(--lp-y); font: 700 12.5px/1.4 "Outfit", "IBM Plex Sans", sans-serif;
  letter-spacing: .24em; text-transform: uppercase;
}
.lp .lp-more { color: var(--lp-y); font-weight: 600; }
.lp .lp-more:hover { color: var(--lp-y-hi); }

/* ประตูสู่หน้าสาธารณะ 5 บาน — จัดแถวตามความกว้างของส่วนนี้ (container query ใช้ได้ทั้งหน้าเต็มจอและ /explore ที่มีเมนูข้าง)
   กว้าง: 5 ช่องแถวเดียว · กลาง: 3 + 2 (แถวล่างอยู่กลาง) · แคบ: 2 + 2 + 1 (ใบสุดท้ายอยู่กลาง) · แคบมาก: ทีละใบ */
.lp-sec { container-type: inline-size; }
.lp-doors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.lp-door { grid-column: span 2; }
.lp-door:nth-child(4) { grid-column: 2 / span 2; }
@container (min-width: 1040px) {
  .lp-doors { grid-template-columns: repeat(5, 1fr); }
  .lp-door, .lp-door:nth-child(4) { grid-column: auto; }
}
@container (max-width: 700px) {
  .lp-doors { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .lp-door:nth-child(4) { grid-column: span 2; }
  .lp-door:nth-child(5) { grid-column: 2 / span 2; }
}
@container (max-width: 440px) {
  .lp-doors { grid-template-columns: 1fr; }
  .lp-door, .lp-door:nth-child(4), .lp-door:nth-child(5) { grid-column: auto; }
}
.lp .lp-door {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 26px 22px 22px; border-radius: 18px;
  background: var(--lp-card); border: 1.5px solid var(--lp-line);
  transition: transform .25s cubic-bezier(.34, 1.4, .64, 1), border-color .2s, box-shadow .25s;
}
.lp-door::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(ellipse at 50% 0%, rgba(223, 204, 99, .16) 0%, transparent 70%);
}
.lp .lp-door:hover { transform: translateY(-5px); border-color: rgba(223, 204, 99, .5); box-shadow: 0 16px 42px rgba(0, 0, 0, .55), 0 0 0 1px rgba(223, 204, 99, .14); }
.lp-door:hover::before { opacity: 1; }
.lp-door-ico {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  background: rgba(223, 204, 99, .1); border: 1px solid rgba(223, 204, 99, .28); color: var(--lp-y);
}
.lp-door-ico svg { width: 26px; height: 26px; }
.lp-door b { margin-top: 10px; color: #fff; font-size: 19px; line-height: 1.4; }
.lp-door-desc { color: var(--lp-muted); font-size: 15px; line-height: 1.65; }
.lp-door-go { margin-top: auto; padding-top: 8px; color: var(--lp-y); font-size: 20px; transition: transform .2s; }
.lp-door:hover .lp-door-go { transform: translateX(5px); }

/* ขั้นตอนเริ่มใช้งาน — เส้นเชื่อมแบบไทม์ไลน์ของ Hackathon */
.lp-steps { list-style: none; margin: 0 auto; padding: 0; max-width: 1020px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.lp-steps::before {
  content: ''; position: absolute; top: 28px; left: 17%; right: 17%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 204, 99, .55) 18%, rgba(223, 204, 99, .55) 82%, transparent);
}
.lp-step { position: relative; text-align: center; padding: 0 6px; }
.lp-step-no {
  position: relative; display: inline-grid; place-items: center;
  width: 56px; height: 56px; margin-bottom: 16px; border-radius: 50%;
  background: var(--lp-bg); border: 1.5px solid rgba(223, 204, 99, .6); color: var(--lp-y);
  font: 700 18px/1 "Outfit", "IBM Plex Sans", sans-serif;
  box-shadow: 0 0 0 6px rgba(223, 204, 99, .06), 0 0 26px rgba(223, 204, 99, .22);
}
.lp-step b { display: block; color: #fff; font-size: 19px; line-height: 1.4; }
.lp-step > span:last-child { display: block; margin-top: 6px; color: var(--lp-muted); font-size: 15.5px; line-height: 1.7; }

/* การ์ดผลงานล่าสุด (การ์ดมาตรฐานจาก _kit.php) บนพื้นดำ */
.lp-works .pub-card {
  background: var(--lp-card); border: 1.5px solid var(--lp-line); border-radius: 16px; padding: 18px;
  transition: transform .25s cubic-bezier(.34, 1.4, .64, 1), border-color .2s;
}
.lp-works .pub-card:hover { transform: translateY(-3px); border-color: rgba(223, 204, 99, .4); }
.lp-works .pub-card h3 { color: #fff; }
.lp-works .pub-card p, .lp-works .pub-who { color: var(--lp-muted); }
.lp-works .pub-type { color: var(--lp-y); opacity: .85; }
.lp-works .pub-card a { color: var(--lp-y-hi); }

/* ชวนเริ่ม + เครดิต */
.lp-final {
  position: relative; max-width: 1180px; margin: 84px auto 0; padding: 60px 24px 64px; text-align: center;
  border-top: 1px solid var(--lp-line);
}
.lp-final::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 50% 110%, rgba(223, 204, 99, .14), transparent 70%);
}
.lp-final > * { position: relative; }
.lp-final h2 { margin: 0; color: #fff; font-size: clamp(26px, 3.3vw, 38px); line-height: 1.35; }
.lp-final p { margin: 10px auto 26px; max-width: 620px; color: var(--lp-muted); font-size: 17px; line-height: 1.7; }

.lp-credit {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px;
  padding: 16px 24px 20px; border-top: 1px solid rgba(255, 255, 255, .06); background: rgba(0, 0, 0, .35);
  color: var(--lp-dim); font-size: 14px;
}
.lp-credit strong { color: #cfcbbb; font-weight: 600; }
.lp-sep { color: #3a3832; }
.lp .lp-credit a { color: var(--lp-muted); text-decoration: underline; text-underline-offset: 3px; }
.lp .lp-credit a:hover { color: var(--lp-y); }

/* ── ภาพเคลื่อนไหวตอนเปิดหน้า / เลื่อนถึง ───────────────────
   ใช้ fill-mode backwards — จบแล้วไม่ค้าง transform ไว้ การ์ดจึงยังลอยตอนชี้ได้
   .lp-reveal ซ่อนเฉพาะเมื่อ landing.js ทำงาน (ใส่ .is-js) ไม่มี JS ก็เห็นครบ */
.lp-in { animation: lpDown .7s ease var(--d, 0s) backwards; }
.lp-mark.lp-in { animation-delay: .12s; }
@keyframes lpDown { from { opacity: 0; transform: translateY(-14px); } }
.lp.is-js .lp-reveal:not(.is-in) { opacity: 0; }
.lp-reveal.is-in { animation: lpUp .65s ease var(--d, 0s) backwards; }
@keyframes lpUp { from { opacity: 0; transform: translateY(22px); } }

@media (prefers-reduced-motion: reduce) {
  .lp *, .lp *::before, .lp *::after { animation: none !important; transition: none !important; }
  .lp-canvas { display: none; }
}

@media (max-width: 760px) {
  .lp-hero { min-height: 0; padding: 52px 18px 40px; }
  .lp-mark { margin: 24px 0 18px; }
  .lp-lead { font-size: 17px; }
  .lp-stats { margin-top: 34px; gap: 10px; }
  .lp-stat { min-width: calc(50% - 5px); flex: 1 1 calc(50% - 5px); padding: 14px 16px 12px; }
  .lp-stat b { font-size: 32px; }
  .lp-sec { padding: 56px 18px 4px; }
  .lp-head { margin-bottom: 26px; }
  .content:not(.content-plain) .lp { border-radius: 0; }

  /* ขั้นตอนเป็นไทม์ไลน์แนวตั้ง */
  .lp-steps { grid-template-columns: 1fr; gap: 22px; max-width: 520px; }
  .lp-steps::before { top: 10px; bottom: 10px; left: 27px; right: auto; width: 1px; height: auto;
    background: linear-gradient(180deg, transparent, rgba(223, 204, 99, .55) 12%, rgba(223, 204, 99, .55) 88%, transparent); }
  .lp-step { display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; text-align: left; padding: 0; }
  .lp-step-no { grid-row: span 2; margin: 0; }
  .lp-step b { align-self: end; }

  .lp-final { margin-top: 64px; padding: 48px 18px 52px; }
}
@media (max-width: 420px) {
  .lp .lp-btn { width: 100%; justify-content: center; }
}
