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

:root {
  --ink: #133439;
  --ink-deep: #08272b;
  --paper: #f5f7f3;
  --white: #ffffff;
  --mist: #dce8e3;
  --line: rgba(19, 52, 57, 0.17);
  --lime: #d8ff68;
  --aqua: #a8e1db;
  --amber: #ffbf69;
  --muted: #65787a;
  --body: 'IBM Plex Sans Thai', sans-serif;
  --display: 'Manrope', 'IBM Plex Sans Thai', sans-serif;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 14px;
  background: var(--lime);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  background: rgba(245, 247, 243, 0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(calc(100% - 40px), var(--max));
  height: 78px;
  margin: auto;
  display: grid;
  grid-template-columns: 250px 1fr auto;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
}
.brand-mark {
  width: 33px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  display: grid;
  place-items: center;
  color: var(--lime);
  font-size: 13px;
}
.primary-nav { display: flex; justify-content: center; gap: 24px; }
.primary-nav a[aria-current="page"]::after { right: 0; }
.primary-nav a {
  position: relative;
  font-size: 15px;
  font-weight: 500;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 2px;
  background: var(--ink);
  transition: right .25s ease;
}
.primary-nav a:hover::after, .primary-nav a:focus-visible::after { right: 0; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-button, .menu-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.menu-button { display: none; }

.search-panel {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgba(8, 39, 43, .97);
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: .25s ease;
}
.search-panel.is-open { opacity: 1; visibility: visible; }
.search-panel-inner {
  width: min(calc(100% - 40px), 940px);
  margin: 0 auto;
  padding-top: clamp(90px, 16vh, 170px);
}
.search-panel-top { display: flex; justify-content: space-between; align-items: center; }
.search-panel .eyebrow { color: var(--aqua); }
.search-close { color: var(--white); border-color: rgba(255,255,255,.25); }
.search-large {
  display: grid;
  grid-template-columns: 1fr auto;
  border-bottom: 2px solid var(--white);
  margin-top: 38px;
}
.search-large input {
  min-width: 0;
  padding: 20px 0;
  color: var(--white);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: clamp(27px, 5vw, 58px);
  font-weight: 300;
}
.search-large input::placeholder { color: rgba(255,255,255,.45); }
.search-large button { border: 0; background: transparent; color: var(--lime); cursor: pointer; }
.search-hints { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 10px; }
.search-hints a { border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 13px; font-size: 14px; }

.mobile-drawer {
  position: fixed;
  z-index: 25;
  inset: 78px 0 0;
  padding: 38px 24px;
  background: var(--paper);
  transform: translateX(100%);
  transition: transform .3s ease;
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer nav { display: grid; }
.mobile-drawer a { padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 24px; }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.eyebrow {
  margin: 0 0 15px;
  font-family: var(--display);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow::before { content: ''; display: inline-block; width: 24px; height: 2px; margin: 0 9px 3px 0; background: currentColor; }
.display-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(48px, 7vw, 105px);
  line-height: 1.12;
  letter-spacing: -.04em;
  font-weight: 500;
}

.hero {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border-bottom: 1px solid var(--line);
}
.hero-copy {
  padding: clamp(65px, 9vw, 125px) max(20px, calc((100vw - var(--max))/2)) 60px max(20px, calc((100vw - var(--max))/2));
  padding-right: clamp(35px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-copy .display-title > span { display: block; color: #2d6567; }
.hero-lead { max-width: 590px; margin: 30px 0; font-size: clamp(18px, 2vw, 23px); line-height: 1.65; color: #34585b; }
.home-search {
  max-width: 630px;
  display: grid;
  grid-template-columns: 1fr auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 7px 7px 24px;
  box-shadow: 0 18px 60px rgba(13, 49, 53, .08);
}
.home-search input { min-width: 0; border: 0; outline: 0; background: transparent; }
.home-search button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--lime); cursor: pointer; }
.hero-meta { display: flex; gap: 28px; margin-top: 45px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; }
.hero-meta strong { display: block; font-family: var(--display); font-size: 23px; }
.hero-image { position: relative; min-height: 620px; overflow: hidden; background: #dfe9e5; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.image-note {
  position: absolute;
  right: 24px;
  bottom: 24px;
  max-width: 230px;
  padding: 15px 18px;
  background: rgba(8, 39, 43, .9);
  color: var(--white);
  font-size: 13px;
  line-height: 1.55;
}

.section { padding: clamp(78px, 10vw, 145px) 0; }
.section-head { display: grid; grid-template-columns: .72fr 1.28fr; gap: 50px; margin-bottom: 62px; }
.section-title { margin: 0; font-family: var(--display); font-size: clamp(34px, 4vw, 58px); line-height: 1.25; letter-spacing: -.035em; font-weight: 500; }
.section-intro { margin: 8px 0 0; max-width: 640px; font-size: 20px; color: var(--muted); }

.category-list { border-top: 1px solid var(--line); }
.category-row {
  display: grid;
  grid-template-columns: 75px 1fr 1fr 45px;
  gap: 30px;
  align-items: center;
  min-height: 155px;
  border-bottom: 1px solid var(--line);
  transition: padding .25s ease, background .25s ease;
}
.category-row:hover { padding-inline: 20px; background: var(--white); }
.category-num { font-family: var(--display); font-size: 13px; color: var(--muted); }
.category-name { font-family: var(--display); font-size: clamp(26px, 3vw, 42px); line-height: 1.1; letter-spacing: -.025em; }
.category-desc { color: var(--muted); }
.category-arrow { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }

.start-section { background: var(--ink); color: var(--white); }
.start-section .section-intro, .start-section .category-num { color: #b8ccca; }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.2); }
.path-card { min-height: 390px; padding: 34px; background: var(--ink); display: flex; flex-direction: column; justify-content: space-between; transition: background .25s; }
.path-card:hover { background: #19484c; }
.path-card .tag { width: fit-content; padding: 5px 11px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 12px; font-family: var(--display); font-weight: 700; }
.path-card h3 { margin: auto 0 18px; font-family: var(--display); font-size: 29px; line-height: 1.25; font-weight: 500; }
.path-card p { margin: 0; color: #c8d7d5; }

.manifesto { padding: clamp(80px, 12vw, 180px) 0; background: var(--aqua); }
.manifesto p { max-width: 1040px; margin: 0; font-family: var(--display); font-size: clamp(34px, 5.5vw, 72px); line-height: 1.25; letter-spacing: -.045em; }
.manifesto p span { background: var(--lime); padding: 0 .1em; }

.site-footer { background: var(--ink-deep); color: var(--white); }
.footer-main { padding: 80px 0 60px; }
.footer-statement { max-width: 900px; margin: 0 0 78px; font-family: var(--display); font-size: clamp(32px, 4.6vw, 62px); line-height: 1.22; letter-spacing: -.04em; color: #d9ebe8; }
.footer-statement span { color: var(--lime); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 50px; }
.footer-about { max-width: 370px; color: #abc3c1; }
.footer-col h3 { margin: 0 0 17px; font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .13em; color: var(--aqua); }
.footer-col a { display: block; width: fit-content; margin: 9px 0; color: #e3eceb; font-size: 15px; }
.footer-bottom { padding: 22px 0; border-top: 1px solid rgba(255,255,255,.15); display: flex; justify-content: space-between; gap: 20px; color: #91aaa8; font-size: 13px; }

/* Article */
.reading-progress { position: fixed; z-index: 60; top: 0; left: 0; width: 0; height: 3px; background: var(--lime); }
.breadcrumb { padding: 25px 0; font-size: 14px; color: var(--muted); }
.breadcrumb span { margin-inline: 8px; }
.article-header { padding: clamp(50px, 8vw, 100px) 0 52px; }
.article-narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }
.article-label { width: fit-content; padding: 6px 12px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.article-title { margin: 0; font-family: var(--display); font-size: clamp(38px, 5.6vw, 68px); line-height: 1.22; letter-spacing: -.025em; font-weight: 500; }
.article-dek { margin: 28px 0; font-size: clamp(19px, 2vw, 24px); line-height: 1.65; color: #49696b; }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.byline strong { color: var(--ink); }
.article-lead-image { width: min(calc(100% - 40px), 1120px); aspect-ratio: 16 / 8.7; margin: 0 auto clamp(55px, 8vw, 100px); overflow: hidden; }
.article-lead-image img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { width: min(calc(100% - 40px), 760px); margin: 0 auto; padding-bottom: 100px; }
.article-layout p { margin: 0 0 1.5em; }
.article-layout h2 { margin: 2.4em 0 .65em; font-family: var(--display); font-size: clamp(30px, 4vw, 44px); line-height: 1.2; letter-spacing: -.03em; font-weight: 500; }
.article-layout h3 { margin: 2em 0 .6em; font-family: var(--display); font-size: 24px; line-height: 1.35; }
.article-layout a { text-decoration: underline; text-decoration-color: #5ea49d; text-underline-offset: 4px; }
.article-layout ul { padding-left: 1.3em; margin-bottom: 1.8em; }
.article-layout li { margin: .45em 0; }
.quick-answer { margin: 0 0 60px; padding: 30px 32px; border-left: 5px solid var(--lime); background: var(--ink); color: var(--white); }
.quick-answer h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: 0; color: var(--lime); }
.quick-answer p { margin: 0; font-size: 19px; }
.contents-box { margin-bottom: 60px; padding: 25px 28px; border: 1px solid var(--line); }
.contents-box summary { cursor: pointer; font-weight: 600; }
.contents-box ol { margin-bottom: 0; columns: 2; }
.tip-box { margin: 50px -50px; padding: 35px 50px; background: var(--aqua); }
.tip-box .eyebrow { margin-bottom: 10px; }
.tip-box p:last-child { margin-bottom: 0; font-size: 20px; }
.evidence-note { margin: 50px 0; padding: 25px 0; border-block: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; gap: 25px; }
.evidence-grade { font-family: var(--display); font-size: 46px; line-height: 1; color: #2b7775; }
.references { margin-top: 75px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.references ol { padding-left: 1.2em; }
.review-card { margin-top: 65px; padding: 28px; background: var(--white); border: 1px solid var(--line); }
.review-card strong { display: block; margin-bottom: 4px; }
.related { padding: 90px 0; background: #e4ece7; }
.related-list { border-top: 1px solid var(--line); }
.related a { display: grid; grid-template-columns: 150px 1fr auto; gap: 25px; align-items: center; padding: 25px 0; border-bottom: 1px solid var(--line); }
.related small { color: var(--muted); }
.related strong { font-family: var(--display); font-size: 24px; font-weight: 500; }

/* ULTASMOOTH additions */
.brand-mark { font-size: 15px; }

/* Article cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px 30px; }
.article-card { display: flex; flex-direction: column; gap: 14px; }
.article-card .card-image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--mist); }
.article-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.article-card:hover .card-image img { transform: scale(1.035); }
.article-card small { font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.article-card h3 { margin: 0; font-family: var(--display); font-size: 23px; line-height: 1.35; font-weight: 500; }
.article-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card:hover h3 { text-decoration: underline; text-decoration-color: #5ea49d; text-underline-offset: 5px; }
.section-more { margin-top: 50px; }
.button-link { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border: 1px solid var(--ink); border-radius: 999px; font-weight: 500; transition: background .2s, color .2s; }
.button-link:hover { background: var(--ink); color: var(--white); }
.category-count { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); font-family: var(--body); letter-spacing: 0; }

/* Category page */
.page-hero { padding: clamp(40px, 7vw, 90px) 0 clamp(40px, 6vw, 70px); border-bottom: 1px solid var(--line); }
.page-hero .display-title { font-size: clamp(44px, 6.5vw, 92px); }
.page-hero .display-title span { display: block; color: #2d6567; font-size: .5em; letter-spacing: -.02em; margin-top: 10px; }
.page-hero .hero-lead { margin-bottom: 0; }
.page-hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: end; }
.page-hero-image { aspect-ratio: 16 / 10; overflow: hidden; }
.page-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.cat-tabs a { padding: 6px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.cat-tabs a[aria-current="page"] { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.cat-tabs a:hover { border-color: var(--ink); }

/* A–Z */
.az-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 50px; }
.az-jump a { min-width: 40px; height: 40px; padding: 0 10px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 15px; }
.az-jump a:hover { background: var(--lime); border-color: var(--lime); }
.az-group { display: grid; grid-template-columns: 110px 1fr; gap: 30px; padding: 30px 0; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.az-letter { font-family: var(--display); font-size: 46px; line-height: 1; font-weight: 500; color: #2d6567; }
.az-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 30px; margin: 0; padding: 0; list-style: none; }
.az-list a { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.az-list a:hover { color: #2d6567; }
.az-list small { flex: none; color: var(--muted); font-size: 13px; }

/* Search results (inside dark panel) */
.search-results { margin-top: 30px; max-height: calc(100vh - 380px); overflow-y: auto; border-top: 1px solid rgba(255,255,255,.15); }
.search-results:empty { display: none; }
.search-results a { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 16px 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
.search-results a:hover, .search-results a:focus-visible { background: rgba(255,255,255,.06); outline: 0; }
.search-results strong { font-family: var(--display); font-size: 21px; font-weight: 500; }
.search-results small { color: var(--aqua); font-size: 13px; align-self: center; }
.search-results span { grid-column: 1 / -1; color: #a9bfbd; font-size: 14px; line-height: 1.6; }
.search-results mark { background: var(--lime); color: var(--ink); padding: 0 2px; }
.search-empty { padding: 20px 4px; color: #a9bfbd; }

/* Static prose pages */
.prose { width: min(calc(100% - 40px), 760px); margin: 0 auto; padding: 60px 0 110px; }
.prose h2 { margin: 2em 0 .6em; font-family: var(--display); font-size: clamp(26px, 3vw, 34px); line-height: 1.3; font-weight: 500; }
.prose p, .prose li { color: #24474b; }
.prose a { text-decoration: underline; text-decoration-color: #5ea49d; text-underline-offset: 4px; }

/* Article extras */
.article-layout blockquote { margin: 2em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--aqua); color: #34585b; }
.article-layout h2 { scroll-margin-top: 100px; }
.references li { margin: .4em 0; }
.references a { color: #2b6f6a; word-break: break-word; }
.article-lead-image { background: var(--mist); }
.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 20px; }

@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .page-hero-grid { grid-template-columns: 1fr; }
  .az-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .az-group { grid-template-columns: 1fr; gap: 12px; }
  .search-results { max-height: calc(100vh - 300px); }
}

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .primary-nav { display: none; }
  .menu-button { display: grid; }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-copy { min-height: 650px; padding-inline: 28px; }
  .hero-image { min-height: 520px; }
  .section-head { grid-template-columns: 1fr; gap: 10px; }
  .category-row { grid-template-columns: 50px 1fr 45px; }
  .category-desc { grid-column: 2; }
  .path-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 300px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { width: min(calc(100% - 28px), var(--max)); height: 68px; }
  .brand { font-size: 13px; }
  .mobile-drawer { inset-block-start: 68px; }
  .hero-copy { min-height: 600px; padding: 60px 20px 38px; }
  .hero-image { min-height: 420px; }
  .hero-meta { gap: 15px; }
  .hero-meta strong { font-size: 19px; }
  .section { padding-block: 72px; }
  .category-row { min-height: 170px; gap: 12px; }
  .category-name { font-size: 26px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-about { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
  .article-title { font-size: 36px; }
  .article-lead-image { width: 100%; aspect-ratio: 4/3; }
  .contents-box ol { columns: 1; }
  .tip-box { margin-inline: -20px; padding-inline: 20px; }
  .evidence-note { grid-template-columns: 1fr; }
  .related a { grid-template-columns: 1fr auto; }
  .related small { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* fixes */
.references h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: 0; color: var(--ink); }
.nw { white-space: nowrap; }
