/* =========================================================
   ARMARICH — สไตล์หลัก (โทนสีตามโลโก้ + สไตล์คลิปอ้างอิง)
   ========================================================= */
:root {
  --bg: #F1F5FC;
  --bg-soft: #E9F0FB;
  --blue: #2E6BD6;
  --blue-band: #8FB4F2;
  --blue-light: #C7DBFA;
  --navy: #26313F;
  --ink: #1B2430;
  --muted: #55637A;
  --yellow: #F5C64A;
  --white: #ffffff;
  --radius: 16px;
  --font: "Poppins", "Anuphan", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: min(1180px, 92%); margin: 0 auto; }

/* ---------- typography ---------- */
.section-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-title.center { text-align: center; }
.section-desc { color: var(--muted); margin-top: 18px; max-width: 46ch; }
.section-desc.center { margin-inline: auto; text-align: center; }
.tag {
  display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-light); padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}

/* ---------- buttons (offset-shadow style ตามคลิป) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; font-weight: 600; font-size: 1rem;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--white); color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 6px 6px 0 var(--blue); }
.btn-primary:hover { box-shadow: 2px 2px 0 var(--blue); }
.btn-line { background: #06C755; color: #fff; border-color: var(--ink); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 600;
  color: var(--ink); padding: 14px 8px;
}
.btn-ghost .play-dot {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 2px solid var(--ink); border-radius: 50%; font-size: .8rem;
  transition: background .2s, color .2s;
}
.btn-ghost:hover .play-dot { background: var(--ink); color: #fff; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 18px 0; transition: padding .3s ease, background .3s ease, box-shadow .3s ease;
}
.nav.scrolled { background: rgba(241,245,252,.92); backdrop-filter: blur(12px); padding: 10px 0; box-shadow: 0 2px 20px rgba(27,36,48,.08); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 34px; }
.logo-text { font-weight: 700; letter-spacing: .12em; font-size: 1.05rem; color: var(--navy); }
.nav-links { display: flex; gap: 34px; }
.nav-links a { font-weight: 500; font-size: .95rem; position: relative; padding: 4px 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--blue); transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang-toggle {
  border: 2px solid var(--ink); background: var(--white); border-radius: 999px;
  padding: 8px 16px; font-weight: 700; font-size: .85rem; letter-spacing: .05em;
  transition: background .2s, color .2s;
}
.lang-toggle:hover { background: var(--ink); color: #fff; }
.btn-nav { padding: 10px 22px; font-size: .92rem; box-shadow: 4px 4px 0 var(--ink); background: var(--yellow); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 6px; }
.hamburger span { width: 26px; height: 3px; background: var(--ink); border-radius: 2px; transition: .3s; }

/* ---------- hero ---------- */
.hero { padding-top: 150px; text-align: center; position: relative; overflow: hidden; }
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 600; line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero-sub { color: var(--muted); margin: 26px auto 0; max-width: 62ch; font-size: 1.05rem; }
.hero-cta { display: flex; justify-content: center; align-items: center; gap: 26px; margin-top: 38px; flex-wrap: wrap; }
.hero-scene { margin-top: 10px; }
.hero-scene svg { width: 100%; height: auto; }

/* hero SVG animations */
.blink { animation: blink 1.6s infinite; }
.blink.b2 { animation-delay: .5s; }
.blink.b3 { animation-delay: 1s; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }

.codebars rect { transform-origin: left center; animation: codegrow 3s ease-in-out infinite; }
.codebars rect:nth-child(2) { animation-delay: .4s; }
.codebars rect:nth-child(3) { animation-delay: .8s; }
.codebars rect:nth-child(4) { animation-delay: 1.2s; }
.codebars rect:nth-child(5) { animation-delay: 1.6s; }
@keyframes codegrow { 0%, 100% { transform: scaleX(.4); } 50% { transform: scaleX(1); } }

/* เส้น workflow วิ่งระหว่างโหนด (สไตล์ n8n) */
.flow-dash { stroke-dasharray: 7 9; animation: flowdash 1.1s linear infinite; }
@keyframes flowdash { to { stroke-dashoffset: -32; } }

/* วงคลื่นรอบ AI (ประมวลผล) */
.pulse-ring { transform-box: fill-box; transform-origin: center; animation: ringpulse 2.6s ease-out infinite; }
@keyframes ringpulse {
  0% { transform: scale(.75); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ข้อความแชตเด้งเข้าเป็นจังหวะ */
.msg { transform-box: fill-box; transform-origin: left bottom; animation: msgpop 6s ease-in-out infinite; }
.msg.m2 { animation-delay: 1.2s; transform-origin: right bottom; }
.msg.m3 { animation-delay: 2.4s; }
@keyframes msgpop {
  0%, 4% { transform: scale(0); opacity: 0; }
  12%, 82% { transform: scale(1); opacity: 1; }
  92%, 100% { transform: scale(1); opacity: 0; }
}

/* แท่งกราฟวิเคราะห์ข้อมูลโตขึ้น-ลง */
.bar { transform-box: fill-box; transform-origin: center bottom; animation: bargrow 3.2s ease-in-out infinite; }
.bar:nth-of-type(2) { animation-delay: .3s; }
.bar:nth-of-type(3) { animation-delay: .6s; }
.bar:nth-of-type(4) { animation-delay: .9s; }
@keyframes bargrow { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }

/* แขนกลใช้ SMIL animateTransform ใน SVG โดยตรง (กำหนดจุดหมุนแม่นยำกว่า CSS) */

/* องค์ประกอบลอย: ห่อด้วย g[transform] ชั้นนอกเสมอ แล้วแอนิเมตชั้นในเท่านั้น */
.float { animation: floaty 4.5s ease-in-out infinite; }
.float.f2 { animation-delay: 1.2s; animation-duration: 5.2s; }
.float.f3 { animation-delay: 2s; animation-duration: 4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.spin { transform-box: fill-box; transform-origin: center; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.twinkle path { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.twinkle path:nth-child(2) { animation-delay: .8s; }
.twinkle path:nth-child(3) { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(.5); opacity: .3; } 50% { transform: scale(1.15); opacity: 1; } }

.win { animation: winblink 3.5s ease-in-out infinite; }
.win.w2 { animation-delay: 1.1s; }
.win.w3 { animation-delay: 2.2s; }
@keyframes winblink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.plane { transform-box: fill-box; animation: plane 5s ease-in-out infinite; }
@keyframes plane { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(8px, -14px) rotate(2deg); } }
.trail path { stroke-dashoffset: 0; animation: trail 2.5s linear infinite; }
@keyframes trail { to { stroke-dashoffset: -26; } }

/* ---------- tech marquee ---------- */
.tech { padding: 70px 0 40px; text-align: center; }
.tech-label { color: var(--muted); font-weight: 500; margin-bottom: 28px; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track {
  display: flex; align-items: center; gap: 38px; width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-weight: 700; font-size: 1.45rem; color: var(--navy); white-space: nowrap; }
.marquee-track i { color: var(--blue); font-style: normal; font-size: .8rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- services (blue band) ---------- */
.band { background: var(--blue-band); position: relative; padding: 110px 0 100px; margin-top: 60px; }
.services .section-title { max-width: 22ch; }
.quote-badge {
  position: absolute; top: -55px; right: 8%; width: 110px; height: 110px; z-index: 5;
  background: var(--navy); border-radius: 50%; display: grid; place-items: center;
  transition: transform .3s ease;
}
.quote-badge:hover { transform: scale(1.1); }
.quote-badge svg { position: absolute; inset: 0; animation: spin 12s linear infinite; }
.badge-text textPath { fill: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .18em; }
.badge-arrow { color: var(--yellow); font-size: 1.6rem; }

.service-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 54px;
}
.service-card {
  background: var(--bg); border-radius: var(--radius); padding: 18px 18px 22px;
  border: 2px solid transparent;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.service-card:hover { transform: translateY(-8px); border-color: var(--ink); box-shadow: 8px 8px 0 rgba(27,36,48,.55); }
.card-art { background: var(--blue-light); border-radius: 12px; padding: 18px; }
.card-art svg { width: 100%; height: 120px; }
.card-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 16px; }
.card-foot h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.card-arrow {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border: 2px solid var(--ink); border-radius: 50%; font-size: 1rem;
  transition: background .25s, color .25s, transform .25s;
}
.service-card:hover .card-arrow { background: var(--ink); color: #fff; transform: rotate(45deg); }
.card-desc { color: var(--muted); font-size: .88rem; margin-top: 10px; }

/* ---------- work / simhouse ---------- */
.work { padding: 110px 0; }
.work-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 60px; align-items: center; }
.work-art svg { width: 100%; height: auto; }
.check-list { margin-top: 26px; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: baseline; font-weight: 500; }
.check-list li::before {
  content: "✓"; flex: none; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue);
  color: #fff; font-size: .75rem; font-weight: 700; transform: translateY(3px);
}
.work .btn { margin-top: 32px; }

/* ---------- process ---------- */
.process { padding: 40px 0 110px; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 60px; }
.step {
  background: var(--white); border-radius: var(--radius); padding: 30px 26px;
  border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--blue-light);
  transition: transform .3s ease, box-shadow .3s ease;
  position: relative;
}
.step:hover { transform: translate(-4px, -4px); box-shadow: 12px 12px 0 var(--blue-band); }
.step-num {
  font-size: 2.2rem; font-weight: 700; color: transparent;
  -webkit-text-stroke: 2px var(--blue); margin-bottom: 14px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .92rem; }

/* ---------- founder quote ---------- */
.quote-sec { padding: 0 0 110px; }
.quote-box {
  background: var(--blue-band); border-radius: 20px; padding: clamp(36px, 6vw, 70px);
  position: relative;
}
.quote-mark { width: 56px; margin-bottom: 26px; }
.quote-text { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 500; line-height: 1.7; max-width: 60ch; }
.quote-who { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.quote-avatar {
  width: 52px; height: 52px; background: var(--white); border-radius: 12px;
  display: grid; place-items: center; padding: 10px;
}
.quote-who strong { display: block; font-size: 1.02rem; }
.quote-who span { color: #33415580; font-size: .88rem; color: rgba(27,36,48,.65); }

/* ---------- why ---------- */
.why { padding: 0 0 110px; }
.why-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 70px; align-items: start; }
.why-intro .btn { margin-top: 30px; }
.why-items { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.why-item { padding: 28px 26px; border-left: 2px solid var(--blue-light); }
.why-item:nth-child(-n+2) { border-bottom: 2px solid var(--blue-light); }
.why-item svg { width: 48px; height: 48px; margin-bottom: 16px; }
.why-item h3 { font-size: 1.08rem; margin-bottom: 8px; }
.why-item p { color: var(--muted); font-size: .92rem; }

/* ---------- ai section ---------- */
.band-light { background: var(--blue-light); padding: 110px 0; }
.ai-grid { display: grid; grid-template-columns: 1fr 1.1fr 0.8fr; gap: 40px; align-items: center; }
.ai-art svg { width: 100%; height: auto; }
.ai-list { display: grid; gap: 18px; }
.ai-list li { display: flex; gap: 14px; align-items: baseline; font-weight: 500; }
.ai-list li::before { content: ""; flex: none; width: 26px; height: 2px; background: var(--ink); transform: translateY(-5px); }

/* ---------- faq ---------- */
.faq { padding: 110px 0; }
.faq-list { max-width: 820px; margin: 50px auto 0; display: grid; gap: 16px; }
.faq-item { background: var(--white); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; transition: box-shadow .25s ease; }
.faq-item.open { box-shadow: 6px 6px 0 var(--blue-light); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 24px; background: none; border: none; text-align: left;
  font-size: 1.05rem; font-weight: 600; color: var(--ink);
}
.faq-icon { font-size: 1.2rem; transition: transform .3s ease; }
.faq-item.open .faq-icon { transform: rotate(-90deg); color: var(--blue); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.faq-a p { padding: 0 24px 22px; color: var(--muted); }

/* ---------- connect ---------- */
.connect { padding: 0 0 110px; }
.connect-box {
  background: var(--blue-band); border-radius: 20px; padding: clamp(36px, 6vw, 70px);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center;
}
.connect-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 34px; }
.connect-art svg { width: 100%; max-width: 340px; margin-inline: auto; }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: #C5D2E4; padding: 70px 0 30px; }
.footer .logo-text { color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 50px; }
.footer-brand p { margin-top: 18px; max-width: 34ch; font-size: .95rem; }
.socials { display: flex; gap: 12px; margin-top: 24px; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 2px solid #C5D2E4; border-radius: 50%; color: #C5D2E4;
  transition: background .25s, color .25s, border-color .25s;
}
.socials a:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.socials svg { width: 18px; height: 18px; }
.footer-col { display: grid; gap: 12px; align-content: start; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 6px; }
.footer-col a { font-size: .95rem; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 60px; padding-top: 24px; border-top: 1px solid rgba(197,210,228,.2);
  font-size: .88rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- reveal (GSAP sets final state; fallback visible) ---------- */
[data-reveal] { will-change: transform, opacity; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .service-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .ai-grid { grid-template-columns: 1fr 1fr; }
  .ai-list { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr; gap: 30px; }
  .why-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: 0; background: var(--bg); z-index: 99;
    flex-direction: column; align-items: center; justify-content: center; gap: 30px;
    font-size: 1.3rem; opacity: 0; pointer-events: none; transition: opacity .3s ease;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; }
  .hamburger { display: flex; z-index: 100; }
  .btn-nav { display: none; }
  .hero { padding-top: 120px; }
  .service-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr; }
  .ai-list { grid-template-columns: 1fr; }
  .why-items { grid-template-columns: 1fr; }
  .why-item { border-left: none; border-bottom: 2px solid var(--blue-light); padding-left: 0; }
  .why-item:last-child { border-bottom: none; }
  .connect-box { grid-template-columns: 1fr; }
  .connect-art { order: -1; }
  .connect-art svg { max-width: 240px; }
  .quote-badge { width: 88px; height: 88px; top: -44px; right: 6%; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
  .footer-bottom { justify-content: center; text-align: center; }
}
