:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #5e574e;
  --line: #e4d8c8;
  --paper: #f3ecdf;
  --card: #fffaf3;
  --clay: #b84324;
  --clay-soft: #f3d2c6;
  --north: #3f4c8a;
  --isan: #a15c12;
  --central: #0f6e6a;
  --south: #1d6b4f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Thonburi, "Sukhumvit Set", "Noto Sans Thai", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #f7e2c8 0, transparent 28rem),
    var(--paper);
}

.top, .layout { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 0 1rem;
}

h1, h2, h3, p { margin: 0; }

h1 { font-size: 2.4rem; letter-spacing: -0.04em; }

.kicker {
  color: var(--clay);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lede, .section-head p, .status { color: var(--muted); line-height: 1.5; }

.lede { max-width: 38rem; margin-top: 0.6rem; }

.status {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
}

.regions {
  width: min(1120px, calc(100% - 2rem));
  margin: 0.5rem auto 1.2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}

.region, .card, button, input {
  font: inherit;
}

.region {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.region strong { display: block; font-size: 1.2rem; }
.region span { color: var(--muted); font-size: 0.92rem; }
.region.active { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--accent, var(--clay)); }

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-bottom: 3rem;
}

.section-head { margin-bottom: 0.8rem; }
.section-head.with-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}
.section-head h2 { font-size: 1.15rem; }
.section-head p { margin-top: 0.25rem; }
button:disabled { opacity: 0.55; cursor: wait; }

.stack { display: grid; gap: 0.7rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
}

.card h3 { font-size: 1.05rem; }
.meta { color: var(--muted); margin: 0.35rem 0 0.7rem; }
.score {
  display: inline-block;
  background: var(--clay-soft);
  color: var(--clay);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-weight: 700;
}

button.primary, button.ghost {
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

button.primary { background: var(--ink); color: white; border: 0; }
button.ghost { background: transparent; border: 1px solid var(--line); }

video {
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  background: #1c1915;
  border-radius: 0.8rem;
}

.script {
  white-space: pre-wrap;
  line-height: 1.65;
  background: #fff;
  border-radius: 0.8rem;
  padding: 0.8rem;
}

label { display: grid; gap: 0.3rem; margin: 0.8rem 0; color: var(--muted); }
input[type="url"] {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.55rem 0.7rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.examples { padding-left: 1.1rem; margin: 0.4rem 0 0; }
.examples a { color: var(--north); }
.glossary { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.glossary span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

@media (max-width: 800px) {
  .top, .layout, .regions { display: grid; grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}
