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

:root {
  --paper: #fafaf8;
  --mid: #4a4a4a;
  --ink: #1a1a1a;
  --card: #fffdfb;
  --line: #e2ded7;
  --tape: rgba(74, 74, 74, 0.14);
}

* { box-sizing: border-box; }

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

body {
  margin: 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.78;
  font-weight: 400;
  overflow-x: clip;
  letter-spacing: 0.01em;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.22'/></svg>");
}

body.locked { overflow: hidden; }

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

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

a:hover { text-decoration-style: dashed; }

.skip {
  position: absolute;
  left: 10px;
  top: -80px;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 16px;
}

.skip:focus { top: 10px; }

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(250, 250, 248, 0.94);
  border-bottom: 1.5px dashed rgba(26, 26, 26, 0.28);
  backdrop-filter: blur(2px);
}

.top-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.top-right { justify-content: flex-end; }
.top-side nav { display: none; }

.tight {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
}

.tight a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  text-decoration: none;
  color: var(--mid);
  border-bottom: 1.5px solid transparent;
}

.tight a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 8px 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transform: rotate(-1deg);
  white-space: nowrap;
}

.burger,
.veil-close {
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
  transform: rotate(0.6deg);
}

.burger:hover,
.veil-close:hover { background: var(--ink); color: var(--paper); }

/* hero */
.hero {
  position: relative;
  min-height: calc(100svh - 62px);
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  padding: 40px 16px 62px;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
  background-image: radial-gradient(rgba(26, 26, 26, 0.17) 1.2px, transparent 1.2px);
  background-size: 17px 17px;
  background-position: 0 0;
}

.hero-img {
  position: absolute;
  inset: -8% 0 -8%;
  width: 100%;
  height: 116%;
  object-fit: cover;
  filter: grayscale(0.35) contrast(1.06);
  opacity: 0.55;
  z-index: 0;
  will-change: transform;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(90deg, rgba(26, 26, 26, 0.08) 1px, transparent 1px);
  background-size: 42px 100%;
  pointer-events: none;
}

.hero-text {
  position: relative;
  z-index: 1;
  margin-left: auto;
  max-width: 660px;
  text-align: right;
  background: rgba(250, 250, 248, 0.88);
  border: 1.5px dashed rgba(26, 26, 26, 0.35);
  border-radius: 10px;
  padding: 18px 20px;
  transform: rotate(-0.4deg);
  box-shadow: 0 14px 26px -20px rgba(26, 26, 26, 0.7);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 8.4vw, 4.4rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: break-word;
}

/* layout */
.wrap {
  padding: 30px 16px 10px;
  display: block;
}

.sheet { min-width: 0; }

.sheet > section,
.sheet section {
  scroll-margin-top: 96px;
}

article > section {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 18px;
  margin: 0 0 24px;
  box-shadow: 0 12px 24px -20px rgba(26, 26, 26, 0.65);
  transform: rotate(0.22deg);
}

article > section:nth-of-type(even) { transform: rotate(-0.26deg); }

article > section:not(.lede)::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 22px;
  width: 62px;
  height: 15px;
  background: var(--tape);
  border-radius: 2px;
  transform: rotate(-3deg);
}

.lede {
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
  padding: 0 4px 6px;
  margin-bottom: 18px;
}

.lede h2 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 5vw, 2rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.3rem, 4.4vw, 1.8rem);
  line-height: 1.35;
  margin: 0.2em 0 0.5em;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.1rem, 3.6vw, 1.32rem);
  line-height: 1.4;
  margin: 1.4em 0 0.4em;
}

p { margin: 0 0 1em; }

p.subtitle {
  margin: -0.2em 0 1em;
  color: var(--mid);
  font-size: 16px;
  border-left: 2px dashed rgba(26, 26, 26, 0.35);
  padding-left: 10px;
}

.lede p.subtitle {
  border-left: 0;
  padding-left: 0;
  font-size: 16px;
  line-height: 1.7;
}

.sheet ul,
.sheet ol { padding-left: 1.2em; margin: 0 0 1em; }

.sheet li { margin: 0 0 0.4em; }

.sheet a { text-decoration: underline; }

.sheet img,
.sheet figure { border-radius: 10px; margin: 1em 0; }

.sheet blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 3px solid var(--ink);
  background: rgba(74, 74, 74, 0.06);
  border-radius: 0 10px 10px 0;
  transform: rotate(-0.2deg);
}

.sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 1em 0;
}

.sheet th,
.sheet td {
  border-bottom: 1px dashed var(--line);
  padding: 10px 8px;
  text-align: left;
}

time,
.sheet time { font-size: 15px; color: var(--mid); letter-spacing: 0.02em; }

/* rail */
.rail {
  margin: 6px 0 30px;
  padding: 16px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  transform: rotate(0.3deg);
}

.rail-h {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.rail p.subtitle {
  border-left: 0;
  padding-left: 0;
  font-size: 15px;
  margin-bottom: 12px;
}

.rail nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rail nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 12px;
  font-size: 16px;
  text-decoration: none;
  border: 1px dashed rgba(26, 26, 26, 0.3);
  border-radius: 10px;
  background: var(--card);
}

.rail nav a:hover { border-style: solid; border-color: var(--ink); }

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 14px;
  font-size: 16px;
  color: var(--mid);
}

/* footer */
.foot {
  margin-top: 14px;
  padding: 28px 16px 22px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.foot-cols {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

.foot dl { margin: 0; }

.foot dt {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  border-bottom: 1.5px dashed var(--line);
  padding-bottom: 4px;
}

.foot dd {
  margin: 0;
  color: var(--mid);
  font-size: 16px;
}

.foot dd a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--mid);
  text-decoration: none;
}

.foot dd a:hover { color: var(--ink); text-decoration: underline; }

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--line);
  font-size: 15px;
  color: var(--mid);
}

.foot-bar p { margin: 0; }

.foot-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--mid);
}

/* veil */
.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 14px;
  overflow-y: auto;
  background: var(--paper);
  background-image: radial-gradient(rgba(26, 26, 26, 0.16) 1.2px, transparent 1.2px);
  background-size: 15px 15px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.veil.open { visibility: visible; opacity: 1; }

.veil-inner {
  width: 100%;
  max-width: 620px;
  padding: 8px 0 40px;
}

.veil-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 14px;
  border-bottom: 1.5px dashed rgba(26, 26, 26, 0.3);
}

.veil-brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.06em;
  transform: rotate(-1deg);
}

.find { margin: 16px 0 6px; }

.find input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  min-height: 48px;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px dashed rgba(26, 26, 26, 0.4);
  border-radius: 10px;
}

.find input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-style: solid;
}

.veil-menu nav ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.veil-menu nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 6px 2px;
  font-size: 20px;
  text-decoration: none;
  border-bottom: 1.5px dashed rgba(26, 26, 26, 0.22);
}

.veil-menu nav li:nth-child(odd) a { transform: rotate(-0.3deg); }
.veil-menu nav li:nth-child(even) a { transform: rotate(0.3deg); }

.veil-menu nav a:hover { padding-left: 8px; }

.veil-menu li.hide { display: none; }

/* reveal */
.rv { opacity: 0; transform: translateY(16px); }
.rv.in { opacity: 1; transform: none; transition: opacity 0.4s ease-out, transform 0.4s ease-out; }

@media (min-width: 760px) {
  .top { padding: 8px 22px; }
  .top-side nav { display: block; }
  .wrap { padding: 40px 26px 10px; }
  div > section { padding: 30px 28px; }
  .hero { padding: 40px 26px 78px; }
  .foot { padding: 34px 26px 24px; }
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}

@media (min-width: 1000px) {
  .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: start;
    gap: 40px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 48px 30px 26px;
  }
  .rail {
    position: sticky;
    top: 92px;
    margin: 0;
  }
  .rail nav ul { display: block; }
  .rail nav a {
    display: flex;
    min-height: 42px;
    border: 0;
    border-bottom: 1px dashed rgba(26, 26, 26, 0.25);
    border-radius: 0;
    background: transparent;
    padding: 4px 0;
  }
  .rail nav a:hover { padding-left: 6px; border-bottom-color: var(--ink); }
  .hero-text { padding: 26px 30px; }
  .foot {
    max-width: 1160px;
    margin: 30px auto 0;
    padding: 34px 30px 24px;
  }
}

@media (min-width: 1280px) {
  .hero-grid { background-size: 56px 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
  .rv.in { transition: none; }
  .hero-img { transform: none !important; }
  * { transition-duration: 0.01ms !important; }
}

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