/* ServerMe: light corporate theme with a navy hero and footer */
:root {
  color-scheme: light;
  --navy: #000a23;        /* hero + footer; equals the hero render's own background, so the picture has no visible edge */
  --ink: #0a1a35;         /* headings */
  --text: #36455d;        /* body copy */
  --muted: #5d6c84;       /* secondary copy */
  --line: #e0e6ef;
  --mist: #f4f7fb;        /* alternate band */
  --white: #fff;
  --blue: #0b5bea;
  --blue-dark: #0848be;
  --blue-soft: #e8f1ff;
  --cyan: #19c3ff;
  --mcsv: #00d090;
  --wrap: 1160px;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 26, 53, .06), 0 18px 40px -20px rgba(10, 26, 53, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "IBM Plex Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: 1.35; text-wrap: balance; }
p, dd, li { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--blue); text-underline-offset: .2em; }
.nw { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: .5rem 1rem; background: var(--ink); color: var(--white); border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .5rem 1.4rem;
  border: 1.5px solid transparent; border-radius: 10px;
  background: none;   /* a <button> would otherwise keep the browser's grey face */
  font: inherit; font-weight: 600; line-height: 1.4; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { color: var(--white); border-color: rgba(255, 255, 255, .42); }
.btn--ghost:hover { border-color: var(--white); background: rgba(255, 255, 255, .08); }
.btn--mcsv { background: var(--mcsv); color: #03261a; }
.btn--mcsv:hover { background: #2ee0a6; }

/* ---------- nav ---------- */
/* mostly opaque on purpose: a thin glass over the navy hero turns the white bar a muddy grey-blue */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: box-shadow .25s ease; }
.nav.is-stuck { box-shadow: 0 4px 20px rgba(10, 26, 53, .08); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 76px; }
.nav__logo { flex: none; }
.nav__logo img { height: 46px; width: auto; }
.nav__menu { display: flex; align-items: center; gap: 2rem; }
.nav__menu > a:not(.btn) { color: var(--ink); font-weight: 500; text-decoration: none; }
.nav__menu > a:not(.btn):hover { color: var(--blue); }
.nav__cta { min-height: 44px; padding-inline: 1.2rem; }
.nav__toggle { display: none; }
.lang { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; font-size: .9375rem; font-weight: 600; line-height: 1; }
.lang > * { padding: .45rem .65rem; border-radius: 6px; }
.lang b { background: var(--blue-soft); color: var(--blue-dark); }
.lang a { color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--ink); background: var(--mist); }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy); color: var(--white); }
/* the render is capped in width so very wide screens never crop the servers out of it; it hugs the right edge up to 1920px
   (its left side is the same navy as the hero, so nothing shows there) and past that it stays put and fades out */
.hero__art {
  position: absolute; top: 0; right: max(0px, calc((100vw - 1920px) / 2)); z-index: -2;
  width: min(100%, 1720px); height: 100%;
  object-fit: cover; object-position: 72% 54%;
}
@media (min-width: 1921px) {
  .hero__art { -webkit-mask-image: linear-gradient(90deg, #000 93%, transparent); mask-image: linear-gradient(90deg, #000 93%, transparent); }
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--navy) 0%, rgba(0, 10, 35, .88) 36%, rgba(0, 10, 35, 0) 64%);
}
.hero__in { padding-block: clamp(4.5rem, 9vw, 7rem) clamp(8rem, 13vw, 10.5rem); }
.hero__text { max-width: 35rem; }
.hero__kicker { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; font-size: 1.0625rem; font-weight: 500; line-height: 1.6; color: #8fd4ff; }
.hero__kicker::before { content: ""; width: 28px; height: 2px; background: var(--cyan); }
/* the company name is the headline; 8vw keeps the Thai name on one line down to a 360px phone */
.hero h1 { color: var(--white); font-size: clamp(1.75rem, 8vw, 3.25rem); line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero__pun { margin-top: .5rem; font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 500; line-height: 1.5; color: var(--white); }
/* the answer to the joke gets underlined once */
.mark { padding-bottom: .12em; background: linear-gradient(var(--cyan), var(--cyan)) left bottom / 100% .12em no-repeat; animation: draw .6s var(--ease) 1.1s both; }
@keyframes draw { from { background-size: 0 .12em; } }
.hero__lead { margin-top: 1.4rem; font-size: 1.125rem; color: rgba(255, 255, 255, .82); }
.hero__cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: .8rem; }
/* the hero text rises in once on load */
.hero__kicker, .hero h1, .hero__pun, .hero__lead, .hero__cta { animation: rise .8s var(--ease) both; }
.hero__pun { animation-delay: .1s; }
.hero__lead { animation-delay: .2s; }
.hero__cta { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- facts: the card that overlaps the bottom of the hero ---------- */
.facts { position: relative; z-index: 2; margin-top: calc(-1 * clamp(3.5rem, 6vw, 4.5rem)); }   /* sits on the grey of #main, so the services grey runs right up to the hero */
.facts__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  overflow: hidden;
  background: var(--line);          /* shows through the 1px gaps as dividers */
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.facts li { display: flex; gap: .9rem; padding: 1.5rem 1.4rem; background: var(--white); }
.facts .icon { width: 26px; height: 26px; margin-top: .1rem; color: var(--blue); }
.facts b { display: block; font-weight: 600; line-height: 1.45; color: var(--ink); }
.facts span { display: block; margin-top: .25rem; font-size: .9375rem; line-height: 1.6; color: var(--muted); }

/* ---------- sections ---------- */
#main { background: var(--mist); }
.section { padding-block: clamp(4rem, 9vw, 7rem); background: var(--white); }
.section--mist { background: var(--mist); }
.section h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
.head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 2.75rem); }
.head p { margin-top: .6rem; font-size: 1.125rem; color: var(--muted); }

/* ---------- services ---------- */
.svc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.svc > li { display: flex; }
.card {
  display: flex; flex-direction: column; gap: .7rem; flex: 1;
  padding: 1.75rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(10, 26, 53, .05), 0 8px 24px -18px rgba(10, 26, 53, .35);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s var(--ease);
}
.card:hover { border-color: #b7cbf2; box-shadow: var(--shadow); transform: translateY(-3px); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.card__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.card__icon .icon { width: 26px; height: 26px; }
.card h3 { font-size: 1.35rem; }
.card__link { display: inline-flex; align-items: center; gap: .4rem; align-self: flex-start; margin-top: auto; padding-top: .6rem; font-weight: 600; text-decoration: none; }
.card__link:hover { text-decoration: underline; }
.card__link .icon { transition: transform .25s var(--ease); }
.card__link:hover .icon { transform: translateX(3px); }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .15rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--mist); font-size: .875rem; font-weight: 500; line-height: 1.7; color: var(--muted); white-space: nowrap; }
.chip--live { border-color: #bfe9d5; background: #e8f8f0; color: #0a7049; }
.chip--live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #10b674; }

/* ---------- MCSV (uses MCSV's own colours so its logo sits naturally) ---------- */
.mcsv {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem 4rem; align-items: center;
  padding: clamp(1.75rem, 5vw, 3.75rem);
  background: #11181d; color: var(--white);
  border-radius: 24px;
}
.mcsv::before { content: ""; position: absolute; z-index: -1; right: -12%; top: -55%; width: 62%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(0, 208, 144, .2), transparent); }
.mcsv__by { font-size: 1rem; font-weight: 500; color: var(--mcsv); }
.mcsv h2 { margin-top: .9rem; }
.mcsv h2 img { width: min(100%, 300px); }
.mcsv__lead { margin-top: 1.3rem; font-size: 1.4rem; font-weight: 600; line-height: 1.5; color: var(--white); }
.mcsv__text > p:not([class]) { margin-top: .35rem; color: rgba(255, 255, 255, .78); }
.mcsv__cta { margin-top: 1.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.6rem; }
.mcsv__status { color: var(--white); font-weight: 500; text-decoration-color: rgba(255, 255, 255, .45); }
.mcsv__status:hover { text-decoration-color: var(--white); }
.mcsv__list { border-top: 1px solid rgba(255, 255, 255, .14); }
.mcsv__list li { display: flex; align-items: flex-start; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .92); }
.mcsv__list .icon { width: 22px; height: 22px; margin-top: .22rem; color: var(--mcsv); stroke-width: 2.25; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 4.5rem; align-items: start; }
.about__lead { margin-top: 1.1rem; font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 600; line-height: 1.5; color: var(--ink); }
.about__main p + p { margin-top: 1rem; }
.about__main p:not(.about__lead) { max-width: 32em; font-size: 1.125rem; }
.co-card { padding: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2.25rem); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.co-card h3 { font-size: 1.2rem; }
.co { margin-top: 1rem; border-top: 1px solid var(--line); }
.co > div { display: grid; grid-template-columns: 10.5rem 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.co > div:last-child { padding-bottom: 0; border-bottom: 0; }
.co dt { color: var(--muted); }
.co dd { font-weight: 500; color: var(--ink); }
.co a { font-weight: 500; }

/* ---------- contact: the one bright panel on the page ---------- */
.cta {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem 4rem; align-items: center;
  padding: clamp(1.75rem, 5vw, 4rem);
  background: linear-gradient(135deg, #0b5bea 0%, #0a43b8 100%); color: var(--white);
  border-radius: 24px;
}
.cta h2 { color: var(--white); line-height: 1.6; }
.cta__ans { display: inline-block; padding: 0 .5em; border-radius: 10px; background: var(--white); color: var(--blue-dark); }
.cta__main > p { margin-top: .9rem; max-width: 30em; color: rgba(255, 255, 255, .9); }
.cta__row { margin-top: 1.7rem; display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; }
.cta__mail { display: inline-flex; align-items: center; gap: .6rem; font-size: clamp(1.2rem, 2.4vw, 1.5rem); font-weight: 700; color: var(--white); text-decoration-color: rgba(255, 255, 255, .5); text-decoration-thickness: 2px; text-underline-offset: .3em; }
.cta__mail:hover { text-decoration-color: var(--white); }
.cta__mail .icon { width: 1.1em; height: 1.1em; }
.cta__copy { min-height: 42px; padding: .3rem 1rem; font-size: 1rem; }
.cta__copy:hover .icon { transform: none; }
html:not(.js) .cta__copy { display: none; }   /* copying needs the script */
.cta__main > .cta__note { margin-top: 1.5rem; font-size: 1rem; color: rgba(255, 255, 255, .9); }
.cta__note a { color: var(--white); font-weight: 600; }

.steps { display: grid; gap: .75rem; counter-reset: step; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.1rem 1.25rem; border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; background: rgba(3, 20, 74, .24); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--white); color: var(--blue-dark); font-weight: 700; line-height: 1; }
.steps b { display: block; font-weight: 600; line-height: 1.5; }
.steps span { display: block; margin-top: .15rem; font-size: 1rem; line-height: 1.6; color: rgba(255, 255, 255, .9); }

/* ---------- back to top ---------- */
.totop {
  position: fixed; z-index: 40;
  right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s var(--ease), visibility .25s, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.totop.is-shown { opacity: 1; visibility: visible; transform: none; }
.totop:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.totop .icon { width: 22px; height: 22px; stroke-width: 2; }

/* ---------- footer ---------- */
.foot { background: var(--navy); color: #a7b5cf; font-size: 1rem; }
.foot__top { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.1fr; gap: 2.5rem; padding-block: 3.5rem 2.75rem; }
.foot__brand img { height: 46px; width: auto; }
.foot__brand p { margin-top: 1.1rem; max-width: 22em; }
.foot__title { margin-bottom: .8rem; font-weight: 600; color: var(--white); }
.foot ul { display: grid; gap: .5rem; }
.foot a { color: #cbd6ea; text-decoration: none; }
.foot a:hover { color: var(--white); text-decoration: underline; }
.foot__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.3rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9375rem; }

/* ---------- 404 page ---------- */
.lost { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; background: var(--mist); }
.lost__in { display: grid; justify-items: center; gap: .6rem; padding-block: 3rem; text-align: center; }
.lost__in img { height: 52px; width: auto; margin-bottom: 1.5rem; }
.lost__code { font-size: clamp(4.5rem, 16vw, 8rem); font-weight: 700; line-height: 1; color: var(--blue); }
.lost h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.lost p:not(.lost__code) { max-width: 30em; color: var(--muted); }
.lost__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 1.5rem; }
.btn--line { color: var(--ink); border-color: #c5d0e0; background: var(--white); }
.btn--line:hover { border-color: var(--ink); }

/* ---------- reveal on scroll (only when the script is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .facts__grid { grid-template-columns: repeat(2, 1fr); }
  .foot__top { grid-template-columns: 1fr 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
@media (min-width: 1366px) {
  .hero h1 { font-size: 3.6rem; }   /* the largest size at which the Thai name still fits .hero__text on one line */
}
@media (min-width: 1000px) and (max-width: 1180px) {
  .hero__text { max-width: 29rem; }   /* keeps the copy clear of the servers */
  .hero h1 { font-size: 2.6rem; }
}
@media (max-width: 999px) {
  /* phone and tablet: the render moves under the text instead of sitting behind it, and is shown whole */
  .hero::before { display: none; }
  .hero__in { padding-block: clamp(3rem, 9vw, 4.5rem) 0; }
  .hero__text { max-width: 38rem; }
  .hero__art {
    position: relative; right: auto; z-index: 0;
    width: 100%; height: auto; aspect-ratio: 936 / 700;
    margin-top: -1rem;
    -webkit-mask-image: linear-gradient(transparent, #000 18%); mask-image: linear-gradient(transparent, #000 18%);
  }
  .facts { margin-top: -3.25rem; }   /* covers only the reflection under the servers */
}
@media (max-width: 900px) {
  .mcsv, .about, .cta { grid-template-columns: minmax(0, 1fr); }   /* minmax(0, …): a long unbreakable line must not widen the column */
  .nav__in { min-height: 64px; }
  .nav__logo img { height: 40px; }
  html { scroll-padding-top: 80px; }
  .nav__toggle {
    display: grid; place-content: center; gap: 6px;
    width: 46px; height: 46px; padding: 0;
    background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  }
  .nav__toggle span { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform .25s var(--ease); }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: .25rem 1.25rem 1.25rem;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -28px rgba(10, 26, 53, .5);
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu > a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .nav__menu .lang { align-self: flex-start; margin-top: 1rem; }
  .nav__menu .lang > * { padding: .6rem .9rem; }
  .nav__cta { margin-top: 1rem; min-height: 48px; }
}
@media (max-width: 720px) {
  .svc { grid-template-columns: 1fr; }
  .foot__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .facts { margin-top: -1.75rem; }   /* the picture is short here, so overlap less or the bottom server gets covered */
  .facts__grid { grid-template-columns: 1fr; }
  .facts li { padding: 1.15rem 1.2rem; }
  .hero__cta .btn { flex: 1 1 100%; }
  .card { padding: 1.4rem; }
  .card__top { flex-wrap: wrap; }
  .co > div { grid-template-columns: 1fr; gap: 0; }
  .cta__row { flex-direction: column; align-items: flex-start; }
  .cta__mail { overflow-wrap: anywhere; }
  .foot__top { grid-template-columns: 1fr; gap: 2rem; }
}

/* the contact question may wrap only where it is wider than the panel (the English one is longer) */
@media (max-width: 350px) { .cta h2 .nw:first-child { white-space: normal; } }
@media (max-width: 370px) { :lang(en) .cta h2 .nw:first-child { white-space: normal; } }

/* ---------- reduced motion: everything is simply in its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
