@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;700&display=swap');

:root {
  --paper: #ffffff;
  --wash: #f5f5f5;
  --ink: #1f1f1f;
  --mute: #6f6f6f;
  --line: rgba(31, 31, 31, 0.1);
  --e1: 0 1px 2px rgba(31, 31, 31, 0.07), 0 2px 5px rgba(31, 31, 31, 0.05);
  --e2: 0 3px 8px rgba(31, 31, 31, 0.08), 0 10px 22px rgba(31, 31, 31, 0.06);
  --e3: 0 8px 18px rgba(31, 31, 31, 0.1), 0 20px 40px rgba(31, 31, 31, 0.08);
  --e4: 0 16px 36px rgba(31, 31, 31, 0.14), 0 34px 70px rgba(31, 31, 31, 0.1);
  --r: 4px;
  --max: 1080px;
}

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans Thai", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: 0.012em;
  overflow-x: hidden;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--e1);
  padding: 0 clamp(14px, 4vw, 22px);
}

.masthead__row {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.masthead__row--brand {
  min-height: 56px;
  justify-content: space-between;
}

.masthead__row--tools {
  min-height: 56px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--e2);
  font-size: 0.92rem;
  line-height: 1;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  display: block;
  box-shadow: var(--e2);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
}

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--wash);
  border: 0;
  border-radius: var(--r);
  box-shadow: inset 0 1px 2px rgba(31, 31, 31, 0.09);
}

.search__input::placeholder {
  color: var(--mute);
}

.search__go {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 46px;
  border: 0;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 15px;
  box-shadow: var(--e2);
  cursor: pointer;
}

.search__go:hover {
  transform: translateY(-1px);
}

.burger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 15px;
  box-shadow: var(--e2);
  cursor: pointer;
}

.burger__bars {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--paper);
  box-shadow: 0 -5px 0 var(--paper), 0 5px 0 var(--paper);
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 26px);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px);
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.menu__brand {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.menu__close {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r);
  background: var(--wash);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  box-shadow: var(--e1);
  cursor: pointer;
}

.nav {
  width: 100%;
  max-width: 660px;
  margin: auto;
  padding: 12px 0;
}

.nav__list {
  counter-reset: navn;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.nav__list li {
  counter-increment: navn;
}

.nav__list a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 8px 8px;
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.08rem, 3.4vw, 1.42rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--line);
}

.nav__list a::before {
  content: counter(navn, decimal-leading-zero);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--mute);
  font-weight: 400;
}

.nav__list a:hover {
  background: var(--wash);
  box-shadow: var(--e1);
}

.main {
  padding-bottom: 56px;
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 45vh;
  padding: clamp(34px, 8vw, 72px) clamp(16px, 5vw, 40px) clamp(26px, 5vw, 48px);
}

.hero__ghost {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: clamp(6px, 3vw, 40px);
  margin: 0;
  transform: translateY(-50%);
  font-size: clamp(7rem, 28vw, 19rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.06em;
  color: rgba(31, 31, 31, 0.055);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
}

.hero__title {
  margin: 0 0 14px;
  max-width: 22ch;
  font-size: clamp(2rem, 6.4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: left;
  text-shadow: 0 1px 0 var(--paper), 0 10px 26px rgba(255, 255, 255, 0.9);
}

.hero__lead {
  margin: 0;
  max-width: 54ch;
  color: var(--mute);
  font-size: 1rem;
}

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 22px);
}

.prose {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 4px 12px 4px 0;
  min-width: 0;
}

.prose > article {
  position: relative;
  z-index: 2;
  transform: translateZ(0);
  background: var(--paper);
  border-radius: var(--r);
  box-shadow: var(--e2);
  padding: clamp(20px, 3vw, 34px);
  scroll-margin-top: 128px;
}

.prose > article::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12px -9px -12px 12px;
  border-radius: var(--r);
  background: var(--wash);
  box-shadow: var(--e1);
}

.prose > article:nth-child(3n + 1) { z-index: 4; }
.prose > article:nth-child(3n + 2) { z-index: 3; }
.prose > article:nth-child(3n) { z-index: 2; }

.prose > article:hover {
  box-shadow: var(--e3);
}

.prose h2 {
  margin: 0 0 0.5em;
  font-size: clamp(1.24rem, 2.6vw, 1.66rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 1.5em 0 0.4em;
  font-size: 1.1rem;
  line-height: 1.4;
}

.prose p {
  margin: 0 0 1em;
}

.prose p:last-child,
.prose ul:last-child,
.prose ol:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.prose li {
  margin: 0.35em 0;
}

.prose small {
  display: block;
  margin-bottom: 0.4em;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--mute);
}

.prose figure {
  position: relative;
  z-index: 1;
  margin: 1.2em 0;
}

.prose figure img {
  display: block;
  width: 100%;
  border-radius: var(--r);
  box-shadow: var(--e2);
}

.prose figcaption {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--mute);
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  background: var(--wash);
  border-radius: var(--r);
  box-shadow: var(--e1);
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  box-shadow: var(--e1);
  border-radius: var(--r);
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--wash);
  font-weight: 700;
}

.rail {
  position: sticky;
  top: 124px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
  align-self: start;
}

.rail__card {
  background: var(--paper);
  border-radius: var(--r);
  box-shadow: var(--e3);
  padding: 18px;
}

.rail__card--ink {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--e4);
}

.eyebrow {
  display: block;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--mute);
}

.rail__title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

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

.rail__list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  transition: transform 0.18s ease, background 0.18s ease;
}

.rail__list a:hover {
  background: var(--wash);
  transform: translateX(3px);
}

.rail__card--ink .eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.rail__brand {
  margin: 0 0 10px;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rail__top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.34);
}

.foot {
  position: relative;
  z-index: 4;
  margin-top: 66px;
  padding-bottom: 28px;
  background: var(--ink);
  color: var(--paper);
}

.foot__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 22px);
}

.foot__cta {
  position: relative;
  z-index: 2;
  transform: translateY(-46px);
  padding: clamp(22px, 4vw, 38px);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--e4);
}

.foot__head {
  margin: 0 0 4px;
  font-size: clamp(1.55rem, 4.4vw, 2.3rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.foot__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 26px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
  box-shadow: var(--e3);
}

.foot__btn:hover {
  transform: translateY(-1px);
}

.foot__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: -26px;
}

.foot__col {
  min-width: 0;
}

.foot dt {
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}

.foot dd {
  margin: 0;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.95rem;
}

.foot dd a:hover {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.brand--sm {
  color: var(--paper);
  font-size: 1rem;
}

.foot__key {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.9rem;
}

.foot__copy {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.will-rise {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.will-rise.is-in {
  opacity: 1;
  transform: none;
}

@media (min-width: 900px) {
  .prose > article:nth-child(even) {
    margin-left: clamp(10px, 2.6vw, 30px);
  }
  .prose > article:nth-child(odd) {
    margin-right: clamp(6px, 1.6vw, 18px);
  }
}

@media (max-width: 899px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .prose {
    padding-right: 0;
  }
  .prose > article::before {
    inset: 10px -6px -10px 10px;
  }
  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding-top: 0;
  }
  .rail__card {
    flex: 1 1 220px;
  }
}

@media (max-width: 759px) {
  .foot__cols {
    grid-template-columns: 1fr 1fr;
  }
  .hero {
    min-height: 44vh;
  }
}

@media (max-width: 459px) {
  .foot__cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .masthead__row--tools {
    gap: 8px;
  }
  .search {
    max-width: none;
  }
  .burger {
    padding: 0 12px;
  }
  .hero {
    padding-top: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .will-rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav__list a:hover,
  .rail__list a:hover,
  .foot__btn:hover,
  .search__go:hover {
    transform: none;
  }
}

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