/* The End of Priority — Pimp Exclusive Club, Bangkok
   Editorial manifesto. Type-only by design: no decoration, no imagery.
   Author: Perplexity Computer */

:root {
  --paper:      #faf8f3;
  --paper-2:    #f4f1e9;
  --paper-3:    #efebe0;
  --ink:        #191713;
  --ink-2:      #4c473e;
  --ink-3:      #8b8578;
  --rule:       #dcd6c8;
  --rule-soft:  #e8e3d7;
  --accent:     #01696f;
  --accent-2:   #0c4e54;
  --accent-tint:#eaf2f2;

  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-thai: 'IBM Plex Sans Thai', 'Sarabun', 'Leelawadee UI', Tahoma, sans-serif;

  --measure: 34rem;
  --wide: 60rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- reading progress ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  transition: width 0.08s linear;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule-soft); }

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand svg { display: block; color: var(--accent); }
.brand-text {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink-3); }
.site-nav a[lang="th"] { position: relative; top: 2px; }

@media (max-width: 40rem) {
  .brand-text { display: none; }
  .header-inner { padding: 0.75rem 1.1rem; gap: 0.75rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.75rem; }
}

/* ---------- layout primitives ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: var(--measure); }
.prose-wide { max-width: 44rem; }

section { position: relative; }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(2.5rem, 5vw, 4rem);
}
.accent-bar {
  width: 3.25rem;
  height: 3px;
  background: var(--accent);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
h1.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 7.25rem);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  max-width: 22ch;
}
.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.2vw, 2rem);
  line-height: 1.25;
  color: var(--ink-2);
  font-weight: 400;
  margin: 0 0 2rem;
  max-width: 30ch;
}
.byline {
  font-size: 0.8125rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin: 0;
}
.byline strong { color: var(--ink-2); font-weight: 600; }

/* ---------- section headings ---------- */
.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.section-mark {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 4.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  max-width: 24ch;
}
h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin: 2.25rem 0 0.5rem;
}

/* ---------- prose ---------- */
p { margin: 0 0 1.15rem; }
.prose > p:last-child, .prose-wide > p:last-child { margin-bottom: 0; }

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 1.75rem;
}
.emph { font-weight: 700; }
em { font-style: italic; }
a.inline { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a.inline:hover { color: var(--accent-2); }

.standout {
  font-weight: 700;
  font-size: 1.125rem;
  margin: 1.75rem 0;
}

/* ---------- pull quote ---------- */
.pullquote {
  margin: clamp(2.5rem, 6vw, 4rem) 0;
  padding: 0;
  border: 0;
  max-width: 46rem;
}
.pullquote p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--accent);
  margin: 0;
}
.pullquote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* framed callout */
.callout {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1.4rem;
  margin: 2rem 0;
  color: var(--ink-2);
}
.callout strong { color: var(--ink); }

/* ---------- the card (three questions) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2.5rem;
}
.q-card {
  background: var(--paper);
  padding: 1.75rem 1.5rem 1.85rem;
  display: flex;
  flex-direction: column;
}
.q-num {
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--accent);
  margin: 0 0 0.85rem;
}
.q-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  margin: 0 0 0.55rem;
}
.q-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 1.1rem;
}
.q-th {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-thai);
  font-size: 0.9375rem;
  line-height: 1.72;
  color: var(--ink-2);
}
.q-th strong { color: var(--ink); font-weight: 600; }

@media (max-width: 46rem) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- exclusion list ---------- */
.excl { margin-top: 2.25rem; max-width: 44rem; }
.excl-item {
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule-soft);
}
.excl-item:last-child { border-bottom: 1px solid var(--rule-soft); }
.excl-word {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.1;
  margin: 0 0 0.4rem;
}
.excl-word s { color: var(--ink-3); text-decoration-thickness: 1px; }
.excl-body { font-size: 0.9375rem; color: var(--ink-2); margin: 0; }

/* ---------- document cards ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.doc-card {
  display: block;
  padding: 1.85rem 1.75rem 1.9rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.doc-card:hover, .doc-card:focus-visible {
  background: var(--paper-3);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.doc-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}
.doc-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.1;
  margin: 0 0 0.6rem;
}
.doc-desc { font-size: 0.9375rem; color: var(--ink-2); margin: 0 0 1.1rem; }
.doc-go {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
@media (max-width: 46rem) { .doc-grid { grid-template-columns: 1fr; } }

/* ---------- language toggle ---------- */
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}
.lang-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.lang-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lang-btns { display: inline-flex; border: 1px solid var(--rule); }
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.lang-btn + .lang-btn { border-left: 1px solid var(--rule); }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.lang-btn:hover:not([aria-pressed="true"]) { background: var(--paper-3); color: var(--ink); }
.lang-btn.th { font-family: var(--font-thai); }

/* language panes */
[data-lang-pane] { display: none; }
[data-lang-pane].is-active { display: block; }

/* Thai typography inside the Thai pane */
.th-pane { font-family: var(--font-thai); line-height: 1.85; }
.th-pane h1.hero-title,
.th-pane h2,
.th-pane .lede,
.th-pane .hero-sub,
.th-pane .pullquote p,
.th-pane .excl-word,
.th-pane .q-num,
.th-pane .doc-title {
  font-family: var(--font-thai);
  font-weight: 600;
  letter-spacing: 0;
}
.th-pane h1.hero-title { font-size: clamp(2rem, 6.5vw, 3.75rem); line-height: 1.22; }
.th-pane h2 { font-size: clamp(1.4rem, 3.6vw, 2.1rem); line-height: 1.34; }
.th-pane .lede { font-size: clamp(1.125rem, 2.4vw, 1.375rem); line-height: 1.7; }
.th-pane .pullquote p { font-size: clamp(1.25rem, 3.2vw, 1.85rem); line-height: 1.5; }
.th-pane .standout { font-size: 1.0625rem; }
.th-pane h3 { font-family: var(--font-thai); font-size: 1.0625rem; }
.th-pane .excl-word { font-size: 1.25rem; line-height: 1.5; }

/* ---------- signature ---------- */
.signature {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.sig-name { font-weight: 700; margin: 0 0 0.2rem; }
.sig-meta { font-size: 0.8125rem; color: var(--ink-3); margin: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3.5rem;
  margin-top: clamp(3rem, 7vw, 5rem);
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.footer-inner a { color: var(--ink-2); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }
.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- next-doc strip ---------- */
.next-strip {
  border-top: 1px solid var(--rule);
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding-top: 2rem;
}

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

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

/* ---------- print ---------- */
@media print {
  .site-header, .progress, .site-footer, .lang-bar, .doc-grid, .next-strip { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .reveal { opacity: 1 !important; transform: none !important; }
  [data-lang-pane] { display: block !important; }
}

/* ---------- scoreline (the final) ---------- */
.scoreline {
  margin: clamp(2rem, 5vw, 3rem) 0;
  max-width: 46rem;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.score-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 1fr;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.score-label {
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.score-a, .score-b {
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 2.4vw, 1.375rem);
  line-height: 1.2;
}
.score-a { color: var(--accent); }
.score-b { color: var(--ink-3); }
.score-a em, .score-b em {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-style: normal;
  letter-spacing: 0.01em;
}
.score-src {
  margin: 0;
  padding: 0.85rem 0 0.95rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-3);
}
@media (max-width: 40rem) {
  .score-row { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.85rem 0; }
  .score-b::before { content: "vs "; color: var(--rule); }
}

/* ---------- the direction test ---------- */
.test-block {
  margin: clamp(2.25rem, 5vw, 3.25rem) 0;
  max-width: 46rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.test-q {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3.4vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 1.4rem;
}
.test-rows p {
  margin: 0;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-2);
}
.test-rows span {
  display: inline-block;
  min-width: 3.1rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.test-yes span { color: var(--accent); }
.test-no span  { color: var(--ink-3); }
.test-th {
  font-family: var(--font-thai);
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 1.3rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}
.test-th strong { color: var(--ink); font-weight: 600; }

/* ---------- language picker (added v3, multilingual release) ---------- */
.lang-pick { position: relative; font-family: var(--font-body); }
.lang-pick > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center;
  gap: 0.42rem; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--ink-2); padding: 0.3rem 0.55rem; border: 1px solid var(--rule);
  border-radius: 2px; background: transparent; transition: color .2s, border-color .2s;
}
.lang-pick > summary::-webkit-details-marker { display: none; }
.lang-pick > summary:hover { color: var(--accent); border-color: var(--accent); }
.lang-pick[open] > summary { color: var(--accent); border-color: var(--accent); }
.lang-pick ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 60;
  margin: 0; padding: 0.35rem 0; list-style: none; min-width: 9.5rem;
  background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 10px 30px rgba(25,23,19,0.11);
}
.lang-pick li { margin: 0; }
.lang-pick li a, .lang-pick li span {
  display: block; padding: 0.44rem 0.9rem; font-size: 0.85rem;
  color: var(--ink-2); text-decoration: none; border: 0;
}
.lang-pick li a:hover { background: var(--paper-3); color: var(--accent); }
.lang-pick li span[aria-current] { color: var(--ink-3); }
.lang-pick li span[aria-current]::after { content: " ✓"; color: var(--accent); }
.en-tag {
  font-size: 0.6rem; letter-spacing: 0.09em; color: var(--ink-3);
  border: 1px solid var(--rule); padding: 0.05em 0.28em; vertical-align: 0.12em;
}
@media (max-width: 46rem) {
  .lang-pick > summary span { display: none; }
  .lang-pick > summary { padding: 0.32rem 0.4rem; }
}

/* mobile header: documents live in the footer + section 09, so the header keeps
   only the wordmark and the language picker (prevents horizontal overflow in
   languages whose nav labels are long) */
@media (max-width: 52rem) {
  .site-nav > a { display: none; }
  .site-nav { gap: 0.6rem; }
  .lang-pick { margin-left: auto; }
}

/* body-copy citation links (section 08 prior-art credits) */
.prose a:not(.inline):not(.btn),
.prose-wide a:not(.inline):not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.prose a:not(.inline):not(.btn):hover,
.prose-wide a:not(.inline):not(.btn):hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}
