:root {
  --bg: #050b1a;
  --text: #e8f0ff;
  --muted: #93a8c9;
  --blue: #3b82f6;
  --royal: #2563eb;
  --cyan: #22d3ee;
  --indigo: #6366f1;
  --border: rgba(147, 197, 253, 0.18);
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 12, 40, 0.55);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Thai", "Noto Sans", sans-serif;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --mx: 50%;
  --my: 50%;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  position: relative;
  overflow-x: hidden;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ===== Aurora + starfield ===== */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(37, 99, 235, 0.38), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(34, 211, 238, 0.2), transparent 55%),
    radial-gradient(800px 500px at 50% 110%, rgba(99, 102, 241, 0.24), transparent 60%),
    var(--bg);
}
#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.72;
  will-change: transform;
  animation: drift 20s ease-in-out infinite;
  transform: translate3d(0,0,0);
}
.blob-a {
  width: min(58vw, 520px);
  height: min(58vw, 520px);
  top: -10%;
  left: -8%;
  background: radial-gradient(circle, #2563eb 0%, transparent 70%);
}
.blob-b {
  width: min(52vw, 440px);
  height: min(52vw, 440px);
  top: 32%;
  right: -12%;
  background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
  animation-delay: -7s;
  animation-duration: 26s;
}
.blob-c {
  width: min(62vw, 540px);
  height: min(62vw, 540px);
  bottom: -18%;
  left: 22%;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  animation-delay: -13s;
  animation-duration: 30s;
}
.mesh {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(37,99,235,0.08), rgba(34,211,238,0.06), rgba(99,102,241,0.1), rgba(37,99,235,0.08));
  animation: meshSpin 48s linear infinite;
  opacity: 0.55;
  mix-blend-mode: screen;
}
.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(147, 197, 253, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.5;
  animation: gridDrift 40s linear infinite;
}
.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(5%, 7%, 0) scale(1.08); }
  66% { transform: translate3d(-6%, -4%, 0) scale(0.94); }
}
@keyframes meshSpin {
  to { transform: rotate(360deg); }
}
@keyframes gridDrift {
  to { background-position: 56px 56px; }
}

/* ===== Layout ===== */
.shell {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.hero { text-align: center; perspective: 800px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b7d0ff;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.title {
  margin: 0;
  font-size: clamp(3.6rem, 14vw, 5.6rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  position: relative;
  display: inline-block;
  background: linear-gradient(115deg, #ffffff 8%, #93c5fd 32%, #22d3ee 55%, #3b82f6 78%, #6366f1 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 7s ease-in-out infinite;
  filter: drop-shadow(0 0 28px rgba(59, 130, 246, 0.4));
}
.title::after {
  content: "";
  position: absolute;
  inset: 10% -8%;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.55) 50%, transparent 65%);
  mix-blend-mode: overlay;
  transform: translateX(-120%);
  animation: titleShimmer 4.8s var(--ease-out) infinite;
  pointer-events: none;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(#000, #000);
  mask-image: linear-gradient(#000, #000);
}

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes titleShimmer {
  0%, 55% { transform: translateX(-130%); opacity: 0; }
  60% { opacity: 0.65; }
  75% { transform: translateX(130%); opacity: 0.35; }
  100% { transform: translateX(130%); opacity: 0; }
}

.tagline {
  margin: 1.25rem 0 0;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  font-weight: 560;
  color: var(--text);
  line-height: 1.55;
}
.tagline .en, .sub .en {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 450;
  font-size: 0.95em;
}
.sub {
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== Glass cards ===== */
.links {
  display: grid;
  gap: 0.95rem;
  perspective: 1000px;
}
.card {
  --rx: 0deg;
  --ry: 0deg;
  --ty: 0px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.2rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transform: translate3d(0, var(--ty), 0) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition:
    transform 0.45s var(--ease-spring),
    border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    background 0.35s var(--ease-out);
  overflow: hidden;
  will-change: transform;
  isolation: isolate;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mx) var(--my),
    rgba(59, 130, 246, 0.28),
    rgba(34, 211, 238, 0.08) 28%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 0;
}
.card:hover::before,
.card:focus-visible::before,
.card.is-active::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card:hover,
.card:focus-visible {
  --ty: -5px;
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow:
    0 28px 70px rgba(0, 16, 50, 0.55),
    0 0 0 1px rgba(59, 130, 246, 0.28),
    0 0 48px rgba(37, 99, 235, 0.28);
  background: linear-gradient(145deg, rgba(59,130,246,0.18), rgba(255,255,255,0.04));
}
.card:active { --ty: -1px; }

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #dbeafe;
  background: linear-gradient(145deg, rgba(37,99,235,0.55), rgba(34,211,238,0.22));
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.35);
  transition: transform 0.45s var(--ease-spring);
}
.card:hover .card-icon { transform: scale(1.06); }
.card-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.card-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.card-desc { color: var(--muted); font-size: 0.9rem; }
.card-arrow {
  color: #93c5fd;
  font-size: 1.25rem;
  transition: transform 0.4s var(--ease-spring), color 0.3s ease;
}
.card:hover .card-arrow { transform: translateX(6px); color: var(--cyan); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  align-items: center;
  color: #6f86ab;
  font-size: 0.85rem;
}
.foot a {
  color: #9ec0f0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.foot a:hover { color: var(--cyan); border-color: rgba(34, 211, 238, 0.5); }
.dot { opacity: 0.5; }

/* ===== Staggered entrance (spring) ===== */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.9s var(--ease-spring),
    transform 0.9s var(--ease-spring);
  will-change: transform, opacity;
}
.reveal.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.reveal[data-d="1"] { transition-delay: 0.06s; }
.reveal[data-d="2"] { transition-delay: 0.14s; }
.reveal[data-d="3"] { transition-delay: 0.22s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.42s; }
.reveal[data-d="6"] { transition-delay: 0.52s; }
.reveal[data-d="7"] { transition-delay: 0.62s; }
.reveal[data-d="8"] { transition-delay: 0.72s; }

.card.reveal {
  transition:
    opacity 0.9s var(--ease-spring),
    transform 0.9s var(--ease-spring),
    border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    background 0.35s var(--ease-out);
}
.card.reveal.is-in {
  transform: translate3d(0, var(--ty), 0) rotateX(var(--rx)) rotateY(var(--ry));
  transition:
    opacity 0.9s var(--ease-spring),
    transform 0.45s var(--ease-spring),
    border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    background 0.35s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .mesh, .grid, .title, .title::after { animation: none !important; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .card, .card-arrow, .card-icon { transition: none !important; }
  .card { --rx: 0deg !important; --ry: 0deg !important; --ty: 0px !important; }
  #stars { display: none; }
}

@media (max-width: 420px) {
  .card { padding: 0.95rem 1rem; gap: 0.8rem; }
  .card-icon { width: 42px; height: 42px; border-radius: 12px; }
}

@media (hover: none) {
  .card { --rx: 0deg; --ry: 0deg; }
}
