:root {
  --violet: #6514ff;
  --magenta: #bf00ff;
  --ink: #1c1726;
  --ink-d: #14101c;
  --paper: #f8f5ff;
  --card: #ffffff;
  --line: #ded2ff;
  --muted: #5b5270;
  --r: 4px;
  --pad: clamp(16px, 4vw, 40px);
  --font: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--violet);
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 16px;
}

.ticker {
  overflow: hidden;
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.ticker-track {
  display: flex;
  gap: 30px;
  width: max-content;
  padding: 7px 0;
  white-space: nowrap;
  animation: tickmove 30s linear infinite;
}

.ticker-track span {
  display: inline-flex;
  align-items: center;
}

.ticker-track span::after {
  content: "◆";
  margin-left: 30px;
  font-size: 8px;
  opacity: 0.65;
}

@keyframes tickmove {
  to {
    transform: translateX(-50%);
  }
}

.brandline {
  background: var(--ink);
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand .mark,
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
}

.brand:hover .brandname {
  color: #d9b8ff;
}

.menuline {
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0 var(--pad) 10px;
}

.mainnav ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.mainnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--r);
  color: #efe7ff;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.mainnav a i {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--magenta);
}

.mainnav a:hover,
.mainnav a:focus-visible {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.post {
  min-width: 0;
  padding: 0 var(--pad) 72px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 calc(-1 * var(--pad));
  padding: 96px var(--pad) 72px;
  background: var(--ink);
  color: #fff;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  top: -18%;
  right: -12%;
  width: min(540px, 74%);
  aspect-ratio: 1;
  background: conic-gradient(from 205deg, var(--violet), var(--magenta), #ff5ad0, var(--violet));
  border-radius: var(--r);
  transform: rotate(14deg);
  opacity: 0.72;
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 58px 58px;
  animation: gridpan 26s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes gridpan {
  to {
    background-position: 58px 58px, 58px 58px;
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.032em;
  max-width: 16ch;
  text-wrap: balance;
}

.lede {
  margin: 26px 0 0;
  max-width: 52ch;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 300;
  color: #d6cbf0;
  line-height: 1.7;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--r);
  color: #fff;
  font-size: 14px;
  transition: background 0.22s ease, border-color 0.22s ease;
}

.chip:hover,
.chip:focus-visible {
  background: var(--magenta);
  border-color: var(--magenta);
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow: auto;
  padding: 32px 24px 40px;
  border-left: 1px solid var(--line);
  background: var(--paper);
}

.railtitle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-bottom: 16px;
}

.railtitle span {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--magenta);
}

.railnav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.railnav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--ink);
  font-size: 15px;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.railnav a:hover,
.railnav a:focus-visible {
  background: #efe7ff;
  border-left-color: var(--violet);
  color: var(--violet);
}

.jump {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 22px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 14px;
  color: var(--muted);
}

.jump:hover,
.jump:focus-visible {
  border-color: var(--violet);
  color: var(--violet);
}

article > section {
  margin-top: 56px;
  padding: clamp(20px, 3vw, 36px);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  scroll-margin-top: 16px;
  animation: rise 0.45s ease both;
  transition: border-color 0.25s ease;
}

article > section:hover {
  border-color: #bda6ff;
}

article > section:nth-child(2) { animation-delay: 0.04s; }
article > section:nth-child(3) { animation-delay: 0.08s; }
article > section:nth-child(4) { animation-delay: 0.12s; }
article > section:nth-child(5) { animation-delay: 0.16s; }
article > section:nth-child(6) { animation-delay: 0.2s; }
article > section:nth-child(7) { animation-delay: 0.24s; }
article > section:nth-child(8) { animation-delay: 0.28s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

article h2 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3.2vw, 2.05rem);
  font-weight: 700;
}

article h2::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 0.42em;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
}

article h2 span {
  background: linear-gradient(transparent 64%, #e7dcff 64%);
}

article h3 {
  margin: 30px 0 10px;
  font-size: 1.2rem;
  color: var(--violet);
}

article h3 span {
  padding-bottom: 2px;
  border-bottom: 2px solid #ecdcff;
}

article a {
  color: var(--violet);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

article a:hover {
  color: var(--magenta);
}

article ul,
article ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

article li {
  margin: 0.35em 0;
}

article blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-left: 4px solid var(--magenta);
  border-radius: 0 var(--r) var(--r) 0;
  background: #f5efff;
}

article blockquote p:last-child {
  margin-bottom: 0;
}

article strong {
  font-weight: 700;
}

article img {
  margin: 14px 0;
  border-radius: var(--r);
}

article hr {
  margin: 28px 0;
  border: 0;
  border-top: 2px dashed var(--line);
}

article table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 15px;
}

article th,
article td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

article th {
  background: #f2ecff;
}

.foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px;
  padding: 60px var(--pad) 24px;
  background: var(--ink);
  color: #cfc6e3;
}

.foot h3 {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
}

.foot h3 span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--magenta);
}

.foot a {
  color: #d9cff2;
}

.foot a:hover,
.foot a:focus-visible {
  color: #fff;
}

.foot ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot li a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 15px;
}

.foot p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
}

.fname {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.subform {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subform input {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #3d3454;
  border-radius: var(--r);
  background: #241d33;
  color: #fff;
  font: inherit;
  font-size: 15px;
}

.subform input::placeholder {
  color: #9c92b5;
}

.subform button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.22s ease;
}

.subform button:hover {
  filter: brightness(1.15);
}

.footbase {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid #352c4a;
  text-align: center;
}

.footbase p {
  font-size: 14px;
  color: #9c92b5;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    order: 2;
    max-height: none;
    padding: 30px var(--pad);
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .hero {
    min-height: 84vh;
    padding: 64px var(--pad) 52px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .post {
    padding-bottom: 48px;
  }

  article > section {
    margin-top: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }

  article > section {
    opacity: 1;
    transform: none;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
