/* =====================================================================
   Alanh ICT — one-page marketing site
   Light theme · brand: navy/royal/cyan + gold · Lao-first
   ===================================================================== */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Noto Sans Lao", "Phetsarath OT", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1, h2, h3 { line-height: 1.32; color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* ---------- Tokens ---------- */
:root {
  --navy: #0B2447;
  --navy-2: #122e57;
  --royal: #1D4ED8;
  --royal-2: #1740b8;
  --cyan: #2E9BE6;
  --cyan-2: #38a9f0;
  --gold: #F5B301;
  --gold-2: #ffc531;
  --ink: #0A1E3F;
  --text: #3c4a63;
  --muted: #5a6b85;
  --bg: #ffffff;
  --bg-alt: #f1f6fd;
  --card: #ffffff;
  --line: #e3ebf6;
  --wa: #25d366;
  --fb: #1877f2;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 6px 20px rgba(11, 36, 71, .06);
  --shadow: 0 18px 46px rgba(11, 36, 71, .12);
  --shadow-lg: 0 30px 70px rgba(11, 36, 71, .18);
  --container: 1160px;
  --topbar-h: 68px;
  --gradient: linear-gradient(135deg, #0B2447 0%, #1D4ED8 55%, #2E9BE6 100%);
  --gradient-soft: linear-gradient(135deg, #eaf2ff 0%, #e2ecfe 100%);
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(18px, 4vw, 32px); }
.container-narrow { max-width: 800px; }
.section { padding-block: clamp(56px, 8vw, 108px); }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(30px, 5vw, 52px); }
.kicker {
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700;
  color: var(--royal); margin-bottom: 10px;
}
.kicker.light { color: var(--gold-2); }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.section-sub { margin-top: 12px; color: var(--muted); font-size: clamp(.98rem, 2vw, 1.08rem); }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 700; font-size: .98rem;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
  white-space: nowrap; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-gold { background: var(--gold); color: #23303f; box-shadow: 0 10px 24px rgba(245, 179, 1, .32); }
.btn-gold:hover { background: var(--gold-2); box-shadow: 0 14px 30px rgba(245, 179, 1, .42); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--royal); color: var(--royal); }
.btn-ghost-light { color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 10px 24px rgba(37, 211, 102, .3); }
.btn-wa:hover { box-shadow: 0 14px 30px rgba(37, 211, 102, .4); }
.btn-fb { background: var(--fb); color: #fff; box-shadow: 0 10px 24px rgba(24, 119, 242, .3); }
.btn-fb:hover { box-shadow: 0 14px 30px rgba(24, 119, 242, .4); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid transparent; transition: box-shadow .25s ease, border-color .25s ease, background-color .25s ease;
}
/* Frosted blur only on desktop — avoids a per-scroll-frame GPU blur repaint on low-end mobile */
@media (min-width: 721px) {
  .topbar { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px); }
}
.topbar.scrolled { box-shadow: 0 6px 24px rgba(11, 36, 71, .08); border-bottom-color: var(--line); background: rgba(255, 255, 255, .95); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-weight: 800; font-size: 1.24rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-name .ict { color: var(--royal); margin-left: 5px; }
.brand-name.light { color: #fff; }
.brand-name.light .ict { color: var(--cyan-2); }

.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); }
.nav > a:not(.btn) { color: var(--ink); font-weight: 600; font-size: .98rem; position: relative; padding: 6px 0; }
.nav > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--royal); transition: width .25s ease;
}
.nav > a:not(.btn):hover::after { width: 100%; }
.nav-cta { padding: 10px 18px; font-size: .92rem; }

.burger { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.burger span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(36px, 6vw, 72px) clamp(48px, 7vw, 96px); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(1000px 520px at 78% -10%, rgba(46, 155, 230, .16), transparent 60%),
    radial-gradient(760px 460px at 8% 8%, rgba(29, 78, 216, .10), transparent 60%),
    linear-gradient(180deg, #f7fafe 0%, #ffffff 62%);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero-mark { width: clamp(96px, 12vw, 132px); height: auto; margin-bottom: 18px; }
.hero-tagline {
  text-transform: uppercase; letter-spacing: .22em; font-weight: 800; font-size: clamp(.78rem, 1.6vw, .92rem);
  color: var(--royal); margin-bottom: 16px;
}
.hero-tagline span { color: var(--gold); margin-inline: 4px; }
.hero-title { font-size: clamp(2rem, 5.2vw, 3.5rem); letter-spacing: -0.02em; }
.line-wrap { display: block; overflow: hidden; padding-bottom: .06em; }
.line { display: block; will-change: transform; }
.hero-title .accent {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { margin-top: 18px; color: var(--text); font-size: clamp(1rem, 2vw, 1.14rem); max-width: 40ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 26px; }
.hero-chips li { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; font-weight: 600; }
.hero-chips .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(46, 155, 230, .16); }

.hero-device { position: relative; }
.hero-device img {
  width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .6);
}

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 26px; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(29, 78, 216, .25); }
.service-icon {
  width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center;
  background: var(--gradient-soft); color: var(--royal); margin-bottom: 18px;
  transition: background .3s ease, color .3s ease, transform .3s ease;
}
.service-icon svg { width: 28px; height: 28px; }
.service-card:hover .service-icon { background: var(--gradient); color: #fff; transform: scale(1.05); }
.service-card h3 { font-size: 1.14rem; margin-bottom: 8px; }
.service-card p { color: var(--muted); font-size: .96rem; }

/* ---------- Audience ---------- */
.audience-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.audience-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-weight: 600; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.audience-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(46, 155, 230, .4); }
.audience-chip span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gradient-soft); color: var(--royal); }
.audience-chip svg { width: 18px; height: 18px; }

/* ---------- Process ---------- */
.process-track { position: relative; }
.process-line { position: absolute; top: 30px; left: 9%; width: 82%; height: 8px; z-index: 0; display: none; }
/* Connector line shows only where the 3-column layout exists (steps collapse to 1-col below 961px) */
@media (min-width: 961px) { .process-line { display: block; } }
.process-line-path { stroke: var(--cyan); }
.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; z-index: 1; }
.process-step {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 62px 26px 30px; text-align: center; box-shadow: var(--shadow-sm);
}
.process-num {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--gradient); color: #fff; font-weight: 800; font-size: 1.12rem;
  box-shadow: 0 10px 24px rgba(29, 78, 216, .28); border: 4px solid #fff;
}
.process-step h3 { font-size: 1.24rem; margin-bottom: 8px; }
.process-step h3 .en { display: block; font-size: .72rem; letter-spacing: .18em; color: var(--royal); font-weight: 700; margin-top: 4px; }
.process-step p { color: var(--muted); font-size: .96rem; }

/* ---------- Portfolio ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work-item {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm); cursor: pointer; background: #eef3fb;
  transition: transform .3s ease, box-shadow .3s ease;
}
.work-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.work-item:hover { box-shadow: var(--shadow); }
.work-item:hover img { transform: scale(1.06); }
.work-item figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 26px 18px 14px; color: #fff; font-size: .92rem; font-weight: 600;
  background: linear-gradient(to top, rgba(10, 30, 63, .82), transparent);
}

/* ---------- Why ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why-item {
  display: flex; flex-direction: column; gap: 8px; padding: 26px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.why-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.why-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; background: var(--gradient-soft); color: var(--royal); margin-bottom: 6px; }
.why-icon svg { width: 26px; height: 26px; }
.why-item h3 { font-size: 1.08rem; }
.why-item p { color: var(--muted); font-size: .94rem; }

/* ---------- Reviews ---------- */
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.review-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 26px; box-shadow: var(--shadow-sm); }
.review-card .stars { color: #b8860b; letter-spacing: 2px; font-size: 1.05rem; margin-bottom: 12px; }
.review-card p { color: var(--text); font-style: italic; }
.review-card cite { display: block; margin-top: 16px; font-style: normal; font-weight: 700; color: var(--ink); font-size: .92rem; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; font-size: 1.02rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-mark { position: relative; flex: 0 0 auto; width: 20px; height: 20px; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; background: var(--royal); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.faq-mark::before { top: 9px; left: 2px; width: 16px; height: 2.5px; }
.faq-mark::after { top: 2px; left: 8.75px; width: 2.5px; height: 16px; }
.faq-item[open] .faq-mark::after { transform: rotate(90deg); opacity: 0; }
.faq-answer { padding: 0 22px 20px; }
.faq-answer p { color: var(--muted); }
.faq-item[open] .faq-answer { animation: faqIn .26s ease; }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Contact ---------- */
.section-cta { background: var(--gradient); color: #fff; position: relative; overflow: hidden; }
.section-cta .section-sub { color: rgba(255, 255, 255, .82); }
.section-cta h2 { color: #fff; }
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 4vw, 52px); align-items: center; }
.contact-copy .section-sub { margin-bottom: 24px; }
.contact-list { display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.contact-list a { color: #fff; }
.contact-list a:hover { text-decoration: underline; }
.contact-list .ci { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; flex: 0 0 auto; }
.contact-list .ci svg { width: 22px; height: 22px; }
.contact-card { background: #fff; color: var(--ink); border-radius: var(--radius-lg); padding: 30px 28px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; }
.contact-card-title { font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.contact-card-sub { color: var(--muted); font-size: .96rem; margin-bottom: 6px; }
.contact-card .btn { width: 100%; }

/* ---------- Footer ---------- */
.foot { background: var(--navy); color: rgba(255, 255, 255, .8); padding-block: clamp(36px, 5vw, 56px) 22px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand .brand-mark { width: 42px; height: 42px; }
.foot-tag { color: var(--cyan-2); letter-spacing: .12em; font-size: .78rem; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-links a { font-weight: 600; color: rgba(255, 255, 255, .82); }
.foot-links a:hover { color: #fff; }
.foot-copy { padding-top: 18px; font-size: .88rem; color: rgba(255, 255, 255, .6); }
.foot-copy a { color: rgba(255, 255, 255, .8); }
.foot-copy a:hover { color: #fff; }

/* ---------- Floating action button ---------- */
.fab {
  position: fixed; right: clamp(16px, 3vw, 26px); bottom: clamp(16px, 3vw, 26px); z-index: 90;
  width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff;
  display: grid; place-items: center; box-shadow: 0 14px 30px rgba(37, 211, 102, .45);
  animation: fabPulse 2.4s ease-in-out infinite; transition: transform .2s ease;
}
.fab:hover { transform: scale(1.08); }
.fab svg { width: 30px; height: 30px; }
@keyframes fabPulse { 0%, 100% { box-shadow: 0 14px 30px rgba(37, 211, 102, .45), 0 0 0 0 rgba(37, 211, 102, .4); } 50% { box-shadow: 0 14px 30px rgba(37, 211, 102, .45), 0 0 0 12px rgba(37, 211, 102, 0); } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(8, 20, 40, .92); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(94vw, 1100px); max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow-lg); width: auto; }
.lightbox-close { position: absolute; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.8rem; line-height: 1; display: grid; place-items: center; }
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }

/* =====================================================================
   Motion — reveal states (gated so no-JS / reduced-motion see content)
   ===================================================================== */
html.js:not(.reduce-motion) .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}
html.js:not(.reduce-motion) .reveal.in { opacity: 1; transform: none; }

/* Hero animated pieces — hidden pre-animation; GSAP tweens them in (no CSS transition here) */
html.js:not(.reduce-motion) #heroLogo .pixel,
html.js:not(.reduce-motion) #heroLogo .swoosh,
html.js:not(.reduce-motion) #heroLogo .a-left,
html.js:not(.reduce-motion) #heroLogo .a-right { opacity: 0; }
html.js:not(.reduce-motion) .hero .line { transform: translateY(110%); }
html.js:not(.reduce-motion) .hero-tagline,
html.js:not(.reduce-motion) .hero-lead,
html.js:not(.reduce-motion) .hero-cta,
html.js:not(.reduce-motion) .hero-chips { opacity: 0; }

/* ---------- Lenis smooth-scroll base ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-device { order: -1; max-width: 560px; }
  .hero-lead { max-width: none; }
  .services-grid, .work-grid, .why-grid, .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .burger { display: flex; }
  .nav {
    position: fixed; inset: var(--topbar-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--line); padding: 14px 22px 22px;
    box-shadow: var(--shadow); transform: translateY(-140%); transition: transform .3s ease; visibility: hidden;
  }
  .nav.open { transform: translateY(0); visibility: visible; }
  .nav > a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav > a:not(.btn)::after { display: none; }
  .nav-cta { margin-top: 10px; text-align: center; }
  .services-grid, .why-grid, .reviews-grid { grid-template-columns: 1fr; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .work-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .btn { padding: 12px 20px; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* =====================================================================
   Reduced motion — safety net (in case class toggle races)
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero .line { transform: none !important; }
  #heroLogo .pixel, #heroLogo .swoosh, #heroLogo .a-left, #heroLogo .a-right { opacity: 1 !important; }
  .hero-tagline, .hero-lead, .hero-cta, .hero-chips { opacity: 1 !important; }
  .fab { animation: none; }
  .faq-item[open] .faq-answer { animation: none !important; }
  .work-item img, .service-card, .btn, .audience-chip, .why-item { transition: none !important; }
}
