/* FMS WORKWIL — main stylesheet */
@font-face {
  font-family: "Anuphan";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/anuphan/Anuphan-Variable-Thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Anuphan";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/anuphan/Anuphan-Variable-Latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #17132f;
  --muted: #696580;
  --violet: #6a4cff;
  --orange: #ff8059;
  --mint: #42c69c;
  --yellow: #ffc857;
  --page: #f8f7fc;
  --line: rgba(44, 35, 86, .11);
  --shadow: 0 25px 70px rgba(42, 31, 90, .13);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 12%, rgba(106, 76, 255, .13), transparent 27rem),
    radial-gradient(circle at 95% 31%, rgba(255, 128, 89, .12), transparent 25rem),
    var(--page);
  font-family: "Anuphan", "Leelawadee UI", Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(rgba(72, 61, 124, .22) .7px, transparent .7px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
a { color: inherit; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 10001;
  padding: 10px 16px; border-radius: 10px; color: #fff; background: var(--ink);
  transform: translateY(-160%); transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Modern loading screen */
.preloader {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  color: #fff; background: var(--ink);
  transition: opacity .65s cubic-bezier(.7, 0, .2, 1), visibility .65s;
}
.preloader::before, .preloader::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px);
}
.preloader::before { width: 360px; height: 360px; top: -190px; right: -70px; background: rgba(106,76,255,.3); }
.preloader::after { width: 300px; height: 300px; bottom: -175px; left: -70px; background: rgba(255,128,89,.2); }
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { position: relative; display: grid; justify-items: center; gap: 23px; }
.loader-mark { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.loader-mark::before, .loader-mark::after {
  content: ""; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.2);
  border-radius: 34px; animation: loader-turn 2.2s cubic-bezier(.6,0,.4,1) infinite;
}
.loader-mark::after {
  inset: 10px; border-color: rgba(255,200,87,.55); border-radius: 26px;
  animation-direction: reverse; animation-duration: 1.65s;
}
.loader-letter {
  z-index: 1; display: grid; width: 58px; height: 58px; place-items: center;
  border-radius: 18px; color: var(--ink); background: #fff; font-size: 27px;
  font-weight: 700; letter-spacing: -.08em; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.loader-copy { text-align: center; }
.loader-copy strong { display: block; font-size: 13px; letter-spacing: .22em; }
.loader-copy span { display: block; min-width: 190px; margin-top: 9px; color: rgba(255,255,255,.58); font-size: 11px; letter-spacing: .07em; }
.loader-line { width: 168px; height: 2px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.loader-line::after {
  content: ""; display: block; width: 50%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--yellow)); animation: loader-slide 1.1s ease-in-out infinite;
}
@keyframes loader-turn { 50% { transform: rotate(135deg) scale(.92); } 100% { transform: rotate(270deg); } }
@keyframes loader-slide { from { transform: translateX(-110%); } to { transform: translateX(220%); } }

.site-shell { opacity: 0; transform: translateY(12px); transition: opacity .55s ease .18s, transform .55s ease .18s; }
body.is-ready .site-shell { opacity: 1; transform: none; }

.navbar { display: flex; align-items: center; justify-content: space-between; min-height: 90px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px;
  color: #fff; background: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.08em;
  box-shadow: 0 9px 24px rgba(23,19,47,.2);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy strong { font-size: 15px; letter-spacing: .07em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.nav-meta { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(66,198,156,.13); }

.hero {
  display: grid; grid-template-columns: minmax(0,1.08fr) minmax(380px,.92fr);
  align-items: center; min-height: 570px; gap: 56px; padding: 62px 0 78px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px;
  padding: 7px 12px 7px 9px; border: 1px solid rgba(106,76,255,.16); border-radius: 99px;
  color: #4f35da; background: rgba(255,255,255,.65); font-size: 12px; font-weight: 700;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 4px rgba(106,76,255,.12); }
h1 { max-width: 720px; margin: 0; font-size: clamp(48px,6.2vw,86px); font-weight: 700; line-height: 1.08; letter-spacing: -.055em; }
.typewriter-line {
  --type-duration: 1.25s;
  --type-delay: .18s;
  --type-steps: 12;
  --caret-color: var(--violet);
  position: relative;
  display: table;
  white-space: nowrap;
}
.typewriter-line--two {
  --type-duration: 1.55s;
  --type-delay: 1.55s;
  --type-steps: 17;
  --caret-color: var(--orange);
}
.typewriter-text {
  display: block;
  /* Negative vertical inset preserves Thai vowels and tone marks outside the line box. */
  clip-path: inset(-.22em 100% -.28em 0);
  will-change: clip-path;
}
.typewriter-gradient {
  color: transparent;
  background: linear-gradient(105deg,var(--violet) 8%,#8060ff 44%,var(--orange) 95%);
  background-clip: text;
  -webkit-background-clip: text;
}
.typewriter-line::after {
  content: "";
  position: absolute;
  top: .08em;
  bottom: .06em;
  left: 0;
  width: .045em;
  min-width: 2px;
  border-radius: 99px;
  opacity: 0;
  background: var(--caret-color);
  box-shadow: 0 0 12px color-mix(in srgb,var(--caret-color) 45%,transparent);
  will-change: left, opacity;
}
body.typewriter-active .typewriter-text {
  animation: typewriter-reveal var(--type-duration) steps(var(--type-steps), end) var(--type-delay) forwards;
}
body.typewriter-active .typewriter-line::after {
  animation:
    typewriter-caret-move var(--type-duration) steps(var(--type-steps), end) var(--type-delay) forwards,
    typewriter-caret-blink .54s step-end var(--type-delay) infinite;
}
body.typewriter-active .typewriter-line--one::after {
  animation:
    typewriter-caret-move var(--type-duration) steps(var(--type-steps), end) var(--type-delay) forwards,
    typewriter-caret-blink .54s step-end var(--type-delay) 2,
    typewriter-caret-hide .01s linear 1.46s forwards;
}
@keyframes typewriter-reveal {
  to { clip-path: inset(-.22em -.1em -.28em 0); }
}
@keyframes typewriter-caret-move {
  from { left: 0; }
  to { left: calc(100% + .04em); }
}
@keyframes typewriter-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes typewriter-caret-hide {
  to { opacity: 0; }
}
.hero-copy > p { max-width: 600px; margin: 28px 0 32px; color: var(--muted); font-size: clamp(16px,1.7vw,19px); line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.primary-button {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 22px;
  border-radius: 16px; color: #fff; background: var(--ink); font-size: 14px; font-weight: 700;
  text-decoration: none; box-shadow: 0 14px 30px rgba(23,19,47,.18); transition: .25s ease;
}
.primary-button:hover { transform: translateY(-3px); background: #4f35da; box-shadow: 0 18px 36px rgba(79,53,218,.24); }
.primary-button svg { width: 18px; transition: transform .25s ease; }
.primary-button:hover svg { transform: translateY(3px); }
.hero-note { color: var(--muted); font-size: 12px; }

.hero-visual { position: relative; min-height: 410px; }
.orbit { position: absolute; inset: 24px 20px 24px 10px; border: 1px dashed rgba(106,76,255,.25); border-radius: 50%; animation: orbit-drift 18s linear infinite; }
.orbit::before, .orbit::after { content: ""; position: absolute; border-radius: 50%; }
.orbit::before { width: 17px; height: 17px; top: 12%; left: 6%; background: var(--orange); box-shadow: 0 0 0 9px rgba(255,128,89,.13); }
.orbit::after { width: 13px; height: 13px; right: 8%; bottom: 12%; background: var(--mint); box-shadow: 0 0 0 8px rgba(66,198,156,.13); }
@keyframes orbit-drift { to { transform: rotate(360deg); } }
.visual-card {
  position: absolute; top: 50%; left: 50%; width: min(370px,85%); padding: 24px;
  border: 1px solid rgba(255,255,255,.8); border-radius: 30px; background: rgba(255,255,255,.72);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); transform: translate(-50%,-50%) rotate(2.5deg);
}
.visual-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.visual-top span:first-child { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.visual-chip { padding: 6px 10px; border-radius: 99px; color: #178265; background: rgba(66,198,156,.13); font-size: 10px; font-weight: 700; }
.visual-svg { display: block; width: 100%; height: auto; }
.floating-tag {
  position: absolute; right: -7px; bottom: 50px; display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border: 1px solid rgba(255,255,255,.8); border-radius: 15px;
  background: rgba(255,255,255,.9); box-shadow: 0 15px 35px rgba(43,34,88,.13);
  font-size: 12px; font-weight: 700; animation: tag-float 3.6s ease-in-out infinite;
}
.floating-tag svg { width: 18px; color: var(--violet); }
@keyframes tag-float { 50% { transform: translateY(-8px); } }

.portal-section { padding: 26px 0 90px; scroll-margin-top: 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.section-kicker { margin: 0 0 8px; color: var(--violet); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h2 { margin: 0; font-size: clamp(30px,4vw,46px); letter-spacing: -.045em; }
.section-description { max-width: 400px; margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.portal-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.portal-card {
  --accent: var(--violet); position: relative; overflow: hidden; display: flex; flex-direction: column;
  min-height: 480px; border: 1px solid var(--line); border-radius: 26px; color: var(--ink);
  background: rgba(255,255,255,.78); box-shadow: 0 8px 30px rgba(43,34,88,.06);
  text-decoration: none; backdrop-filter: blur(14px);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.portal-card:nth-child(2) { --accent: var(--orange); }
.portal-card:nth-child(3) { --accent: #1eaa82; }
.portal-card:hover, .portal-card:focus-visible {
  z-index: 2; border-color: color-mix(in srgb,var(--accent) 34%,transparent); outline: none;
  transform: translateY(-10px); box-shadow: 0 28px 62px rgba(43,34,88,.14);
}
.card-art { position: relative; display: grid; height: 218px; place-items: center; overflow: hidden; background: color-mix(in srgb,var(--accent) 8%,white); }
.card-art::before { content: ""; position: absolute; width: 250px; height: 250px; border: 1px solid color-mix(in srgb,var(--accent) 20%,transparent); border-radius: 50%; transition: transform .5s ease; }
.portal-card:hover .card-art::before { transform: scale(1.18) rotate(20deg); }
.card-illustration { position: relative; z-index: 1; width: 82%; max-width: 260px; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.portal-card:hover .card-illustration { transform: translateY(-5px) scale(1.025); }
.card-content { display: flex; flex: 1; flex-direction: column; padding: 24px 24px 22px; }
.card-number { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .11em; }
.card-number svg { width: 20px; height: 20px; transition: transform .3s ease; }
.portal-card:hover .card-number svg { transform: translate(3px,-3px); }
.portal-card h3 { margin: 0; font-size: 24px; line-height: 1.4; letter-spacing: -.02em; }
.portal-card .subtitle { margin: 7px 0 21px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.contact-list { display: grid; gap: 12px; margin-top: auto; padding-top: 19px; border-top: 1px solid var(--line); }
.contact-row { display: grid; grid-template-columns: 23px minmax(0,1fr); gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.contact-row svg { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.contact-row span { overflow-wrap: anywhere; }

footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; min-height: 100px; gap: 24px; color: var(--muted); font-size: 12px; }
.footer-wordmark { color: var(--ink); font-weight: 700; letter-spacing: .08em; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 12px; padding-top: 55px; }
  .hero-copy { text-align: center; }
  .typewriter-line { margin-inline: auto; }
  .hero-copy > p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { min-height: 390px; margin: 0 auto; width: min(500px,100%); }
  .portal-grid { grid-template-columns: 1fr 1fr; }
  .portal-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .container { width: min(calc(100% - 28px),1180px); }
  .navbar { min-height: 78px; }
  .nav-meta { font-size: 0; }
  h1 { font-size: clamp(36px,11.8vw,56px); }
  .hero { min-height: auto; padding: 42px 0 48px; }
  .hero-visual { min-height: 345px; }
  .floating-tag { right: 2px; bottom: 38px; }
  .section-head { display: block; }
  .section-description { margin-top: 12px; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-card:last-child { grid-column: auto; }
  .portal-card { min-height: 455px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .loader-mark::before,
  .loader-mark::after,
  .loader-line::after,
  .orbit,
  .floating-tag {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* No-JavaScript fallback */
.no-js .preloader { display: none; }
.no-js .site-shell { opacity: 1; transform: none; }
.no-js .typewriter-text { clip-path: none; }
.no-js .typewriter-line::after { display: none; }

