:root {
  --bg: #f3f1ee;
  --paper: #fffcf8;
  --ink: #1c1917;
  --muted: #6b625b;
  --line: #e4ddd4;
  --plum: #3c2140;
  --copper: #9a4e32;
  --max: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Khmer", "Leelawadee UI", "Khmer UI", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.85;
}
a { color: var(--copper); }
figure a { display: block; text-decoration: none; }
img { max-width: 100%; height: auto; }
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.45rem 0.75rem;
  z-index: 5;
}
.skip:focus { top: 0.6rem; }

.site-header { background: var(--plum); color: #f6f1ea; }
.site-header a { color: #f6f1ea; text-decoration: none; }
.header-inner, .wrap, .site-footer .inner {
  width: min(var(--max), calc(100% - 2.4rem));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.7rem 1.5rem;
  padding: 1rem 0 0.85rem;
}
.logo { display: flex; flex-direction: column; line-height: 1.1; }
.logo strong { font-size: 1.9rem; font-weight: 700; }
.logo span { margin-top: 0.25rem; font-size: 0.84rem; color: #e6d5c4; }
.nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.05rem; }
.nav a {
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
}
.nav a:hover { border-bottom-color: #e7b89a; }

.wrap { padding: 1.15rem 0 3rem; }
.crumbs { color: var(--muted); font-size: 0.86rem; margin: 0 0 1.1rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; }
.crumbs a { text-decoration: none; }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 0.35rem; }

.kicker {
  margin: 0 0 0.4rem;
  color: var(--copper);
  font-weight: 700;
  font-size: 0.84rem;
}
h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.32;
  margin: 0 0 0.7rem;
  max-width: 16ch;
}
.lead { font-size: 1.08rem; margin-top: 0; max-width: 44rem; }
.meta { color: var(--muted); font-size: 0.88rem; }

figure { margin: 0.4rem 0 1.15rem; }
figure img { display: block; width: 100%; }
figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.4rem; }
.hero-figure img { outline: 1px solid var(--line); }

h2 {
  font-size: 1.42rem;
  line-height: 1.4;
  margin: 2rem 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--copper);
}
h3 { font-size: 1.06rem; margin: 0.9rem 0 0.25rem; }
p { margin: 0 0 0.9rem; }

.ad {
  margin: 1.3rem 0 1.5rem;
  background: var(--paper);
  padding: 0.8rem 0.9rem 0.3rem;
}
.ad-label {
  margin: 0 0 0.5rem;
  color: var(--plum);
  font-size: 0.8rem;
  font-weight: 700;
}
.ad a { display: block; }
.ad-frame {
  display: block;
  width: 100%;
  height: min(70vh, 36rem);
  margin-top: 0.7rem;
  border: 0;
  background: #0e0e0e;
}
.ad-caption { font-size: 0.92rem; }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0;
  margin: 0.6rem 0 1rem;
}
.steps li {
  margin: 0;
  background: var(--paper);
  padding: 0.75rem 0.8rem 0.85rem;
  border-top: 3px solid var(--plum);
}
.steps strong { display: block; color: var(--copper); margin-bottom: 0.25rem; }

.glossary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 1.1rem;
  margin: 0.4rem 0 0.8rem;
}
.glossary div { min-width: 0; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0.2rem 0 1rem; background: var(--paper); }
caption { text-align: left; font-weight: 700; margin-bottom: 0.4rem; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.5rem;
  vertical-align: top;
  text-align: left;
}
th { color: var(--plum); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: start;
  margin: 0.5rem 0 1rem;
}
.split figure { margin: 0; }
.split.flip { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.split.flip figure { order: 2; }

.faq details { border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 0.4rem 0 0.15rem; }

.site-footer {
  background: var(--plum);
  color: #f6f1ea;
  padding: 1.2rem 0 1.6rem;
  font-size: 0.92rem;
}
.site-footer a { color: #f6f1ea; }
.site-footer p { margin: 0 0 0.4rem; }

@media (max-width: 900px) {
  .glossary { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  h1 { max-width: none; }
  .glossary, .steps, .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip figure { order: 0; }
}
.poster img { width: min(100%, 24rem); height: auto; }
