/* Tanyanon — Crystal Navy theme (rounded glass) */
:root {
  --abyss: #040A1C;
  --deep: #0A1F4D;
  --cobalt: #1C4FD8;
  --glint: #5FD4FF;
  --ice: #BFE3FF;
  --frost: #EAF6FF;

  --text: #DCEBFF;
  --muted: #93ABCF;
  --line: rgba(191, 227, 255, 0.14);

  --font-latin: "Be Vietnam Pro";
  --font-cjk: "Noto Sans SC", "PingFang SC", "Microsoft YaHei";
  --font-display: var(--font-latin), "Anuphan", var(--font-cjk), system-ui, sans-serif;
  --font-body: var(--font-latin), "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", var(--font-cjk), system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; background: #040A1C; }
/* Hidden for a moment while a saved language is applied (see lang-boot.js) */
html[data-lang-pending] body { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(70rem 42rem at 85% -10%, rgba(28, 79, 216, 0.28), transparent 62%),
    radial-gradient(48rem 30rem at -10% 75%, rgba(10, 31, 77, 0.7), transparent 70%),
    var(--abyss);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
html:lang(th) body { line-height: 1.8; }
html:lang(zh-CN) body { line-height: 1.85; letter-spacing: .02em; }

h1, h2, h3 { font-family: var(--font-display); color: var(--frost); line-height: 1.25; margin: 0; }
h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 600; letter-spacing: -0.015em; max-width: 17ch; }
html:lang(th) h1, html:lang(zh-CN) h1 { letter-spacing: 0; line-height: 1.3; }
h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 500; }
p  { margin: 0; }

a { color: var(--ice); }
a:focus-visible, select:focus-visible { outline: 2px solid var(--glint); outline-offset: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 18px; height: 18px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--frost); color: var(--abyss); padding: .5rem 1rem; border-radius: 999px;
}
.skip:focus { top: 1rem; }

/* ---------- Glass surface ---------- */
.glass {
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background:
    linear-gradient(180deg, rgba(16, 40, 96, .72), rgba(5, 14, 39, .86)) padding-box,
    linear-gradient(160deg, rgba(234, 246, 255, .42), rgba(191, 227, 255, .06) 40%, rgba(95, 212, 255, .26)) border-box;
  box-shadow: inset 0 1px 0 rgba(234, 246, 255, .08), 0 24px 60px -30px rgba(0, 0, 0, .8);
}

/* ---------- Header ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(4, 10, 28, .72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; gap: 2rem; min-height: 4.25rem; }

.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; }
.brand-en { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--frost); letter-spacing: -0.01em; }
.brand-th { font-family: "Anuphan", "IBM Plex Sans Thai", sans-serif; font-size: .95rem; color: var(--muted); }

.links { display: flex; gap: 1.75rem; margin-left: auto; }
.links a { color: var(--muted); text-decoration: none; font-size: .97rem; }
.links a:hover { color: var(--frost); }

.tools { display: flex; align-items: center; gap: .75rem; }

.lang { position: relative; display: block; }
.lang::after {
  content: ""; position: absolute; right: .85rem; top: 50%; width: 6px; height: 6px;
  border-right: 1.5px solid var(--ice); border-bottom: 1.5px solid var(--ice);
  transform: translateY(-70%) rotate(45deg); pointer-events: none; border-radius: 1px;
}
.lang-ic { position: absolute; left: .7rem; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ice); pointer-events: none; }
.lang select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: .88rem; line-height: 1.2;
  color: var(--frost);
  background: rgba(191, 227, 255, .08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem 2.1rem .45rem 2.1rem;
  cursor: pointer;
}
.lang select:hover { background: rgba(191, 227, 255, .14); }
.lang option { color: #0A1F4D; background: #fff; }

.ver {
  font-size: .8rem; font-variant-numeric: tabular-nums;
  color: var(--glint); text-decoration: none;
  padding: .32rem .7rem;
  border: 1px solid rgba(95, 212, 255, .35);
  border-radius: 999px;
}
.ver:hover { background: rgba(95, 212, 255, .1); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem); }

/* Soft refracted light — the one bold element on the page */
.hero-light {
  position: absolute; inset: -20% -10% auto auto; width: 62rem; height: 46rem; pointer-events: none;
  background:
    radial-gradient(closest-side at 62% 42%, rgba(95, 212, 255, .30), transparent 70%),
    radial-gradient(closest-side at 40% 60%, rgba(28, 79, 216, .55), transparent 72%),
    radial-gradient(closest-side at 75% 70%, rgba(191, 227, 255, .16), transparent 70%);
  filter: blur(40px);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4rem, 2rem, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .hero-light { animation: none; } }

.hero-grid {
  position: relative;
  display: grid; align-items: center; gap: 3rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}
.lede { margin-top: 1.5rem; max-width: 36rem; font-size: 1.15rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.25rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 500;
  padding: .85rem 1.65rem; border-radius: 999px;
  transition: background-color .2s, box-shadow .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--frost), var(--glint));
  color: #06173A;
  box-shadow: 0 10px 30px -10px rgba(95, 212, 255, .6);
}
.btn-primary:hover { background: linear-gradient(135deg, #fff, #8BE2FF); }
.btn-ghost {
  color: var(--frost);
  border: 1px solid rgba(191, 227, 255, .35);
  background: rgba(191, 227, 255, .04);
}
.btn-ghost:hover { background: rgba(191, 227, 255, .12); }
.btn:focus-visible { outline: 2px solid var(--glint); outline-offset: 3px; }

/* Hero illustration + group shortcuts */
.hero-visual { position: relative; }
.hero-art { width: 100%; height: auto; display: block; overflow: visible; }
@media (prefers-reduced-motion: reduce) { .hx-pulse { display: none; } }

.hero-groups { list-style: none; margin: 1.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-groups a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .95rem; border-radius: 999px;
  font-size: .92rem; color: var(--ice); text-decoration: none;
  background: rgba(95, 212, 255, .08); border: 1px solid rgba(95, 212, 255, .22);
}
.hero-groups a:hover { background: rgba(95, 212, 255, .16); color: var(--frost); }

/* ---------- Sections ---------- */
.about, .solutions, .stack, .contact { padding-block: clamp(3.5rem, 8vw, 6rem); }
.about { border-top: 1px solid var(--line); }
.section-intro { margin-top: 1rem; max-width: 38rem; color: var(--muted); }

.split { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.principles li { display: flex; gap: 1.1rem; align-items: flex-start; }
.p-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  color: var(--glint);
  background: radial-gradient(circle at 30% 25%, rgba(95, 212, 255, .28), rgba(28, 79, 216, .22) 70%);
  border: 1px solid rgba(95, 212, 255, .3);
}
.p-icon .ic { width: 22px; height: 22px; }
.principles h3 { font-size: 1.12rem; font-weight: 500; }
.principles p { margin-top: .25rem; color: var(--muted); }

.sol-group {
  margin-top: clamp(2.5rem, 5vw, 3.75rem); scroll-margin-top: 5.5rem;
  display: grid; gap: 2rem 3rem; align-items: start;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
}
.group-aside { position: sticky; top: 6rem; display: grid; gap: .85rem; }
.group-art {
  width: 100%; height: auto; display: block; border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -35px rgba(0, 0, 0, .9);
}
.group-title { display: flex; align-items: center; gap: .75rem; margin-top: .6rem; }
.group-icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: #06173A; background: linear-gradient(135deg, var(--frost), var(--glint));
}
.group-icon .ic { width: 21px; height: 21px; stroke-width: 2; }
.group-aside h3 { font-size: clamp(1.3rem, 2.2vw, 1.55rem); font-weight: 500; }
.group-aside > p { color: var(--muted); }
.group-count {
  justify-self: start; font-size: .85rem; color: var(--glint);
  padding: .2rem .75rem; border-radius: 999px;
  background: rgba(95, 212, 255, .1); border: 1px solid rgba(95, 212, 255, .25);
}

.sol-list { list-style: none; margin: 0; padding: .4rem 1.75rem; border-radius: var(--r-lg); }
.sol-list > li { display: flex; gap: 1.25rem; align-items: flex-start; padding-block: 1.5rem; }
.sol-list > li + li { border-top: 1px solid var(--line); }
.tile {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  color: var(--glint);
  background: linear-gradient(145deg, rgba(95, 212, 255, .2), rgba(28, 79, 216, .25));
  border: 1px solid rgba(95, 212, 255, .28);
  box-shadow: inset 0 1px 0 rgba(234, 246, 255, .15);
}
.tile .ic { width: 25px; height: 25px; }
.sol-main { display: grid; gap: .45rem; min-width: 0; }
.sol-list h4 { margin: 0; font-family: var(--font-display); font-size: 1.12rem; font-weight: 500; color: var(--frost); line-height: 1.4; }
.sol-main p { color: var(--muted); max-width: 40rem; }
.sol-main .tags { margin-top: .3rem; }

#telecom .sol-list {
  background:
    radial-gradient(40rem 16rem at 100% 0%, rgba(95, 212, 255, .14), transparent 60%) padding-box,
    linear-gradient(180deg, rgba(22, 58, 140, .78), rgba(5, 14, 39, .9)) padding-box,
    linear-gradient(160deg, rgba(234, 246, 255, .5), rgba(191, 227, 255, .06) 40%, rgba(95, 212, 255, .32)) border-box;
}

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.tags li {
  font-size: .8rem; color: var(--ice);
  padding: .18rem .7rem;
  border-radius: 999px;
  background: rgba(191, 227, 255, .08);
  border: 1px solid var(--line);
}

.stack { border-block: 1px solid var(--line); background: rgba(10, 31, 77, .25); }
.stack-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 3rem; }
.stack h2 { font-size: 1.45rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem 1.05rem .45rem .85rem; font-size: .95rem; color: var(--frost);
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(191, 227, 255, .04);
}
.chips .ic { width: 18px; height: 18px; color: var(--glint); }

.contact-panel {
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  background:
    radial-gradient(36rem 20rem at 0% 100%, rgba(28, 79, 216, .45), transparent 65%) padding-box,
    linear-gradient(180deg, rgba(16, 40, 96, .8), rgba(4, 12, 34, .95)) padding-box,
    linear-gradient(160deg, rgba(234, 246, 255, .45), rgba(191, 227, 255, .06) 40%, rgba(95, 212, 255, .3)) border-box;
}
.contact-panel p { margin-top: .75rem; color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 1.25rem 3.5rem; margin-top: 2rem; }
.contact-links a { text-decoration: none; display: flex; align-items: center; gap: 1rem; border-radius: var(--r-sm); }
.c-icon {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  color: #06173A; background: linear-gradient(135deg, var(--frost), var(--glint));
  box-shadow: 0 10px 30px -10px rgba(95, 212, 255, .6);
}
.c-icon .ic { width: 24px; height: 24px; stroke-width: 2; }
.c-text { display: grid; gap: .1rem; }
.c-label { font-size: .88rem; color: var(--muted); }
.c-value { font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.65rem); color: var(--frost); word-break: break-word; }
.contact-links a:hover .c-value { color: var(--glint); }

/* Chat apps (QR) */
.chat { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.chat h3 { font-size: 1.3rem; font-weight: 500; }
.chat > p { margin-top: .35rem; color: var(--muted); }
.qr-grid {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(6, minmax(0, 1fr));
}
.qr-card {
  --brand: var(--glint);
  height: 100%; display: grid; justify-items: center; gap: .6rem;
  padding: .9rem .9rem 1rem; border-radius: var(--r-md);
  text-decoration: none; color: var(--frost);
  background: rgba(191, 227, 255, .05); border: 1px solid var(--line);
  transition: background-color .2s, border-color .2s, transform .2s;
}
.qr-card:hover { background: rgba(191, 227, 255, .1); border-color: color-mix(in srgb, var(--brand) 60%, transparent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .qr-card, .qr-card:hover { transition: none; transform: none; } }
.qr-img { display: block; width: 100%; max-width: 168px; aspect-ratio: 1; padding: 8px; border-radius: 16px; background: #fff; }
.qr-img img { display: block; width: 100%; height: 100%; border-radius: 8px; }
.qr-name { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; }
.qr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.qr-open { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); }
.qr-card:hover .qr-open { color: var(--glint); }
.ic-xs { width: 14px; height: 14px; }
.qr-line     { --brand: #06C755; }
.qr-zalo     { --brand: #0068FF; }
.qr-wechat   { --brand: #07C160; }
.qr-telegram { --brand: #26A5E4; }
.qr-viber    { --brand: #7360F2; }
.qr-whatsapp { --brand: #25D366; }

/* ---------- First-visit language chooser ---------- */
.lang-dialog {
  width: min(100% - 2rem, 34rem); padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid transparent; border-radius: var(--r-xl);
  color: var(--text);
  background:
    radial-gradient(30rem 16rem at 100% 0%, rgba(95, 212, 255, .16), transparent 60%) padding-box,
    linear-gradient(180deg, #102A66, #050E27) padding-box,
    linear-gradient(160deg, rgba(234, 246, 255, .55), rgba(191, 227, 255, .08) 40%, rgba(95, 212, 255, .35)) border-box;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
}
.lang-dialog::backdrop { background: rgba(2, 6, 18, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lang-dialog[open] { animation: ld-in .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes ld-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lang-dialog[open] { animation: none; } }

.ld-close {
  position: absolute; top: 1rem; right: 1rem; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  color: var(--muted); background: rgba(191, 227, 255, .06); border: 1px solid var(--line);
}
.ld-close:hover { color: var(--frost); background: rgba(191, 227, 255, .14); }
.ld-close .ic { width: 18px; height: 18px; }
.ld-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  color: #06173A; background: linear-gradient(135deg, var(--frost), var(--glint));
  box-shadow: 0 10px 30px -10px rgba(95, 212, 255, .6);
}
.ld-icon .ic { width: 26px; height: 26px; stroke-width: 2; }
.ld-title { margin-top: 1.1rem; font-size: clamp(1.5rem, 3.5vw, 1.9rem); font-weight: 500; }
.ld-others { margin-top: .3rem; color: var(--muted); font-size: .95rem; white-space: pre-wrap; }

.lang-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem .75rem; margin-top: 1.75rem; }
.lang-option {
  position: relative; display: flex; align-items: center; gap: .8rem;
  padding: 1rem 1.1rem; border-radius: var(--r-md); cursor: pointer; text-align: left;
  font: inherit; color: var(--frost);
  background: rgba(191, 227, 255, .05); border: 1px solid var(--line);
  transition: background-color .2s, border-color .2s;
}
.lang-option:hover, .lang-option:focus-visible { background: rgba(95, 212, 255, .12); border-color: rgba(95, 212, 255, .5); }
.lang-option:focus-visible { outline: 2px solid var(--glint); outline-offset: 2px; }
.lang-option.is-suggested { border-color: rgba(95, 212, 255, .45); background: rgba(95, 212, 255, .09); }
.lo-code {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--glint);
  background: rgba(95, 212, 255, .12); border: 1px solid rgba(95, 212, 255, .3);
}
.lo-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; }
.lo-badge {
  position: absolute; top: -.6rem; right: .9rem;
  padding: .05rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 500;
  color: #06173A; background: var(--glint); box-shadow: 0 4px 12px -4px rgba(95, 212, 255, .7);
}
.ld-hint { margin-top: 1.25rem; font-size: .88rem; color: var(--muted); }
@media (max-width: 480px) { .lang-options { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 1.75rem; font-size: .9rem; color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.foot-ver { display: flex; align-items: center; gap: .6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-light { width: 40rem; height: 34rem; inset: -15% -30% auto auto; }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .qr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-visual { max-width: 34rem; }
  .sol-group { grid-template-columns: 1fr; }
  .group-aside { position: static; grid-template-columns: minmax(0, 1fr); }
  .group-art { max-height: 15rem; object-fit: cover; }
}
@media (max-width: 720px) {
  .links { display: none; }
  .tools { margin-left: auto; }
  .sol-list { padding: .25rem 1.15rem; border-radius: var(--r-md); }
  .sol-list > li { gap: 1rem; padding-block: 1.35rem; }
  .tile { width: 44px; height: 44px; border-radius: 14px; }
  .qr-grid { grid-template-columns: 1fr; gap: .6rem; }
  .qr-card { grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; gap: .9rem; padding: .6rem .9rem .6rem .6rem; border-radius: var(--r-sm); }
  .qr-img { width: 64px; padding: 4px; border-radius: 10px; }
  .qr-img img { border-radius: 4px; }
  .qr-open { font-size: .85rem; color: var(--ice); }
  .tile .ic { width: 22px; height: 22px; }
}
@media (max-width: 420px) {
  .brand-th { display: none; }
  .tools { gap: .5rem; }
}
