:root {
  color-scheme: light;
  --paper: #f6f0e5;
  --ink: #152720;
  --muted: #52625a;
  --line: #c4c2ad;
  --green: #19382e;
  --lime: #e4bb79;
  --orange: #963c28;
  --night: #111a1f;
  --header: 4.35rem;
  --gutter: clamp(1.25rem, 5.3vw, 6rem);
  --font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --display: "Noto Serif KR", "Batang", "AppleMyungjo", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-padding-block-start: var(--header);
}
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); }
[hidden] { display: none !important; }
figure, p, h1, h2, h3, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; }
button, summary { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
:focus-visible { outline: 3px solid #c4582d; outline-offset: 5px; }
.scene h1[tabindex="-1"]:focus-visible, .scene h2[tabindex="-1"]:focus-visible { outline: none; }

.masthead {
  position: sticky;
  z-index: 4;
  top: 0;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.wordmark, .masthead nav { display: flex; align-items: center; gap: .85rem; }
.wordmark { font-family: var(--display); font-size: 1.03rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.wordmark span[lang="th"] { margin-left: .65em; color: var(--muted); font-family: var(--font); font-size: .77em; font-weight: 650; }
.wordmark-mark {
  width: .68rem;
  aspect-ratio: 1;
  background: var(--orange);
  transform: rotate(45deg);
}
.masthead nav { gap: clamp(.75rem, 2.7vw, 2.4rem); white-space: nowrap; }
.masthead nav a { text-decoration: none; font-size: .91rem; font-weight: 750; }
.masthead button, .step-buttons button {
  color: var(--ink);
  background: transparent;
  padding: .43rem .8rem;
  min-height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: .875rem;
  font-weight: 800;
}
.masthead button:hover, .step-buttons button:hover:not(:disabled) { border-color: var(--ink); }
#mode-toggle { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#mode-toggle[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

.scene {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.scene-frame { display: grid; align-items: start; padding: clamp(3.5rem, 8.5vw, 7rem) var(--gutter); }
.scene-inner { width: min(100%, 95rem); margin-inline: auto; }
.eyebrow {
  margin-bottom: 1.05rem;
  color: var(--orange);
  font-size: clamp(.88rem, 1.1vw, 1.08rem);
  font-weight: 850;
  letter-spacing: .075em;
}
h1, h2, h3 { text-wrap: balance; }
h1, h2 { font-weight: 900; letter-spacing: -.075em; }
h2 { font-family: var(--display); font-size: clamp(2.45rem, 4.18vw, 4.65rem); font-weight: 760; letter-spacing: -.065em; line-height: 1.14; }
h3 { font-size: clamp(1.3rem, 2.3vw, 2.15rem); }
.deck { margin-top: 1.4rem; font-size: clamp(1.06rem, 1.8vw, 1.48rem); line-height: 1.6; }
.deck small { color: var(--muted); font-size: .78em; }
.dark { background: var(--green); color: var(--paper); --line: #5b7863; }
.dark .eyebrow { color: var(--lime); }
.saffron { background: #e4ecbd; }
.peach { background: #f2d7c7; }
.split { display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: clamp(31.5rem, 77svh, 55rem);
  align-items: end;
  padding: clamp(2rem, 6.7vh, 5.5rem) var(--gutter);
  background: var(--night);
  color: var(--paper);
}
.hero-copy { min-width: 0; padding-block: clamp(1rem, 5vh, 3.2rem); }
.hero-country {
  color: var(--lime);
  letter-spacing: .2em;
  font-weight: 780;
  font-size: clamp(.8rem, 1.12vw, .98rem);
  margin-bottom: 1.1rem;
}
.hero h1 { font-family: var(--display); font-size: clamp(3.8rem, 8.1vw, 8.9rem); font-weight: 760; line-height: 1.02; letter-spacing: -.085em; }
.hero-subtitle { color: #f1e9da; font-size: clamp(1.02rem, 1.66vw, 1.55rem); margin-top: 1.3rem; line-height: 1.5; }
.action {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  margin-top: clamp(1.25rem, 3.6vh, 2.75rem);
  padding-inline: 1.4rem;
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.action:hover { background: #f3cd93; }
.hero-media {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
}
.hero-media img {
  position: absolute;
  inset: 0 0 0 auto;
  width: 80%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 49%;
  mask-image: linear-gradient(90deg, transparent, #000 29%);
}
.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, var(--night) 4%, rgb(17 26 31 / 95%) 21%, rgb(17 26 31 / 58%) 46%, transparent 72%),
    linear-gradient(0deg, rgb(13 22 18 / 70%), transparent 42%);
}
.hero-media figcaption {
  position: absolute;
  z-index: 1;
  bottom: clamp(1.25rem, 4vh, 3rem);
  right: var(--gutter);
  color: var(--paper);
  padding: .55rem 0 0;
  border-top: 1px solid rgb(246 240 229 / 65%);
  min-width: 9.7rem;
  font-size: .86rem;
  font-weight: 700;
}
.hero-media figcaption strong { display: block; font-family: var(--display); font-size: 1.25rem; }
.hero-media figcaption span { display: block; margin-top: .25rem; }

#contents.scene-frame { padding-top: clamp(2.6rem, 5vw, 4.6rem); }
.contents-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: start; gap: clamp(2rem, 7vw, 7rem); }
.contents-grid h2 { font-size: clamp(2.75rem, 5.45vw, 5.7rem); }
.contents-grid .deck { max-width: 29em; color: var(--muted); }
.chapter-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.chapter-list a {
  display: grid;
  grid-template-columns: 2.3rem 1fr;
  align-items: center;
  min-height: clamp(2.35rem, 5vh, 3.55rem);
  padding: .46rem 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1rem, 1.42vw, 1.42rem);
  font-weight: 790;
  text-decoration: none;
}
.chapter-list a:hover { color: var(--orange); padding-left: .4rem; }
.chapter-list span { color: var(--orange); font-size: .75em; }
#country { background: #eeeadd; }
#history, #industry { padding-block: clamp(2.5rem, 6vw, 5.5rem); }
#history { border-top: 1px solid #cbcebb; background: #eeeadd; }

.facts { margin-top: 1.8rem; border-top: 1px solid var(--line); font-size: clamp(1.03rem, 1.73vw, 1.63rem); }
.facts div { display: grid; grid-template-columns: minmax(4.3rem, .34fr) 1fr; gap: .5rem; padding: .94rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-weight: 750; }
.facts dd { font-weight: 850; }
.facts small { display: inline-block; margin-left: .4em; color: var(--muted); font-size: .65em; font-weight: 700; }
.image-block { min-width: 0; }
.image-block img {
  width: 100%;
  aspect-ratio: 1.6;
  object-fit: cover;
  background: #809382;
}
.image-block figcaption { margin-top: .65rem; color: inherit; font-size: clamp(.9rem, 1.25vw, 1.18rem); line-height: 1.42; }
.image-block figcaption strong { font-size: clamp(1.25rem, 2vw, 1.9rem); font-weight: 900; letter-spacing: -.04em; }
.image-block figcaption span { display: block; margin-top: .18rem; }
.map img { aspect-ratio: 1.19; object-fit: contain; background: #e4ecbd; }
.timeline, .travel-list, .conclusion {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 3.25rem);
  padding: 0;
  margin: clamp(2rem, 7vh, 5rem) 0 0;
  list-style: none;
}
.timeline li, .travel-list > div, .conclusion > div { border-top: 2px solid currentColor; padding-top: 1.12rem; }
.timeline strong { color: #6b2f20; font-size: clamp(1.65rem, 3.9vw, 3.7rem); letter-spacing: -.065em; }
.timeline h3 { margin-top: .42rem; }
.timeline p { margin-top: .65rem; font-size: clamp(1rem, 1.45vw, 1.32rem); line-height: 1.5; }

.industry-grid { margin-top: clamp(1.7rem, 4.6vh, 3rem); display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(1.3rem, 4vw, 4rem); align-items: stretch; }
.chart { min-width: 0; }
.chart figcaption { font-size: clamp(1.05rem, 1.7vw, 1.48rem); font-weight: 850; }
.bar-list { display: grid; gap: .85rem; margin: .9rem 0 .55rem; padding: 0; list-style: none; }
.bar-caption { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; font-size: clamp(.96rem, 1.6vw, 1.37rem); font-variant-numeric: tabular-nums; }
.bar-caption span { font-weight: 850; }
.bar-track { height: clamp(.65rem, 1.7vh, 1.15rem); background: #e1e4d7; }
.bar-track span { display: block; width: var(--bar); height: 100%; background: #6a8b72; transform-origin: left; }
.bar-list li:first-child .bar-track span { background: var(--orange); }
.bar-list p, .chart-axis { color: var(--muted); font-size: clamp(.875rem, 1.2vw, 1.02rem); }
.bar-list p { margin-top: .22rem; }
.chart-axis { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .35rem; }
.stat-panel { display: grid; align-content: center; justify-items: start; gap: .65rem; padding: clamp(1.25rem, 3vw, 3.25rem); background: var(--green); color: var(--paper); }
.stat-panel p { font-size: clamp(1rem, 1.55vw, 1.35rem); line-height: 1.5; }
.stat-panel strong { color: var(--lime); font-size: clamp(3.3rem, 7vw, 7.75rem); line-height: 1; letter-spacing: -.08em; white-space: nowrap; }
.stat-panel a { font-size: .875rem; }
.source-line { margin-top: 1.4rem; color: var(--muted); font-size: .875rem; line-height: 1.6; }

.split-photo .image-block img { aspect-ratio: 1.1; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.05rem, 3vw, 2.8rem); margin-top: clamp(1.35rem, 4vh, 2.55rem); }
.photo-pair .image-block img { height: clamp(11rem, 32vh, 24rem); aspect-ratio: auto; }
.quiz-support img { object-position: center 39%; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.atlas-scene { background: #eae9d8; }
.atlas-scene h2, .trend-scene h2, .history-gallery h2 { font-size: clamp(2.55rem, 4.8vw, 5rem); }
.atlas-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}
.atlas-count { display: flex; align-items: center; gap: .75rem; line-height: 1.28; white-space: nowrap; }
.atlas-count strong { font-family: var(--display); color: var(--orange); font-size: clamp(3.25rem, 5.6vw, 6rem); line-height: .86; }
.atlas-count span { font-size: clamp(.85rem, 1.3vw, 1.08rem); font-weight: 800; }
.atlas {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.22fr);
  align-items: start;
  gap: clamp(1.4rem, 4vw, 4rem);
  margin-top: clamp(1.2rem, 3.2vw, 2.65rem);
}
.atlas-figure { position: sticky; top: calc(var(--header) + 1rem); justify-self: center; width: min(100%, 54vh, 31rem); }
.atlas-map { position: relative; isolation: isolate; overflow: hidden; }
.atlas-map img { width: 100%; height: auto; }
.atlas-figure figcaption { padding-top: .4rem; font-size: .85rem; color: var(--muted); }
.atlas-pin {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}
.atlas-pin::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #be4329;
}
.atlas-pin.natural::before { background: #172f49; }
.atlas-pin[aria-pressed="true"] { z-index: 1; }
.atlas-pin[aria-pressed="true"]::before { width: 18px; height: 18px; box-shadow: 0 0 0 3px #f3f4ce; }
.atlas-pin:hover::before { box-shadow: 0 0 0 3px #f3f4ce; }
.atlas-index {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: .65rem clamp(.8rem, 2vw, 2.2rem);
}
.atlas-preview {
  position: relative;
  grid-column: 1 / -1;
  margin-bottom: .5rem;
  isolation: isolate;
  overflow: hidden;
  background: var(--night);
  color: var(--paper);
}
.atlas-preview img { width: 100%; height: clamp(10.5rem, 25vw, 19rem); object-fit: cover; object-position: center 43%; }
.atlas-preview img[src$="atlas-ban-chiang.webp"] { object-fit: contain; background: #d9cebd; }
.atlas-preview::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(0deg, rgb(17 26 31 / 95%), rgb(17 26 31 / 35%) 40%, transparent 70%);
}
.atlas-preview figcaption { position: absolute; z-index: 1; inset: auto 1rem 1rem; display: flex; justify-content: space-between; align-items: end; gap: .6rem; }
.atlas-preview figcaption small { display: block; margin-bottom: .16rem; color: var(--lime); font-size: .85rem; font-weight: 850; }
.atlas-preview figcaption strong { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.8rem); }
.atlas-preview figcaption a { font-size: .85rem; font-weight: 750; white-space: nowrap; }
.atlas-group h3 { font-size: clamp(1.22rem, 2vw, 1.75rem); margin-bottom: .65rem; }
.atlas-group h3 span { display: inline-block; margin: 0 .4rem .08em 0; width: .7rem; height: .7rem; border-radius: 50%; background: #be4329; }
.atlas-group.natural h3 span { background: #172f49; }
.atlas-group details { border-top: 1px solid #aebda3; }
.atlas-group details:last-child { border-bottom: 1px solid #aebda3; }
.atlas-group summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem;
  min-height: 2.5rem;
  padding: .54rem .4rem;
  cursor: pointer;
  list-style: none;
  font-size: clamp(.89rem, 1.2vw, 1.13rem);
  font-weight: 850;
}
.atlas-group summary::-webkit-details-marker { display: none; }
.atlas-group summary time { font-variant-numeric: tabular-nums; font-size: .83em; }
.atlas-group details[open] summary { background: var(--green); color: var(--paper); }
.atlas-group details p { margin: 0; padding: .55rem .42rem .65rem; font-size: .91rem; line-height: 1.5; }
.atlas-group details a { white-space: nowrap; }
.atlas-source { grid-column: 1 / -1; justify-self: start; font-size: .875rem; }

.place-picker { min-inline-size: 0; padding: 0; border: 0; margin: clamp(.9rem, 2.5vh, 1.55rem) 0 0; }
.place-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin-bottom: .7rem; }
.place-options label {
  display: grid;
  min-height: 2.8rem;
  place-items: center;
  padding: .45rem .3rem;
  border: 1px solid var(--line);
  color: #e8ebdc;
  cursor: pointer;
  font-size: clamp(.91rem, 1.24vw, 1.1rem);
  font-weight: 800;
}
.place-options label:hover { border-color: currentColor; }
#destination-palace:checked ~ .place-options label[for="destination-palace"],
#destination-ayutthaya:checked ~ .place-options label[for="destination-ayutthaya"],
#destination-sukhothai:checked ~ .place-options label[for="destination-sukhothai"],
#destination-nakhon:checked ~ .place-options label[for="destination-nakhon"] {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
}
#destination-palace:focus-visible ~ .place-options label[for="destination-palace"],
#destination-ayutthaya:focus-visible ~ .place-options label[for="destination-ayutthaya"],
#destination-sukhothai:focus-visible ~ .place-options label[for="destination-sukhothai"],
#destination-nakhon:focus-visible ~ .place-options label[for="destination-nakhon"] {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
.place-panel {
  position: relative;
  display: none;
  isolation: isolate;
  align-items: center;
  min-height: clamp(17rem, 46vh, 31rem);
  padding: clamp(1.3rem, 4vw, 4.1rem);
  overflow: hidden;
  background: #101d19;
}
#destination-palace:checked ~ #destination-palace-info,
#destination-ayutthaya:checked ~ #destination-ayutthaya-info,
#destination-sukhothai:checked ~ #destination-sukhothai-info,
#destination-nakhon:checked ~ #destination-nakhon-info { display: grid; }
.place-photo {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 auto;
  width: 75%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(90deg, transparent, #000 28%);
}
.palace-photo { object-position: 50% 40%; }
.ayutthaya-photo { object-position: 67% 48%; }
.nakhon-photo { object-position: 65% 39%; }
.place-panel::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #101d19 13%, rgb(16 29 25 / 95%) 27%, rgb(16 29 25 / 50%) 58%, transparent 90%);
}
.place-copy h3 { font-size: clamp(1.65rem, 3.2vw, 3.3rem); letter-spacing: -.055em; line-height: 1.12; }
.place-copy > p:not(.eyebrow, .place-number) { font-size: clamp(1rem, 1.5vw, 1.35rem); line-height: 1.48; }
.place-copy .place-number {
  margin-block: .42rem .35rem;
  color: var(--lime);
  font-size: clamp(2rem, 4.5vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -.075em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.place-copy a { display: inline-block; margin-top: .65rem; font-size: .9rem; }
.history-gallery { padding-block: clamp(3.7rem, 7vw, 6.9rem); }
.history-gallery .place-options label { color: var(--ink); }
.history-gallery .place-options label:hover { color: var(--orange); }
.history-gallery .place-panel { color: var(--paper); }
.history-gallery .place-copy .eyebrow { color: var(--lime); }
body:not(.presentation-mode) .history-gallery input,
body:not(.presentation-mode) .history-gallery .place-options { display: none; }
body:not(.presentation-mode) .history-gallery .place-picker {
  display: grid;
  gap: clamp(2.3rem, 7vw, 6.5rem);
  margin-top: clamp(2rem, 5vw, 4.2rem);
}
body:not(.presentation-mode) .history-gallery .place-panel {
  display: grid;
  grid-template-columns: 1.49fr .87fr;
  gap: clamp(1.25rem, 5vw, 5rem);
  min-height: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
}
body:not(.presentation-mode) .history-gallery .place-panel::after { display: none; }
body:not(.presentation-mode) .history-gallery .place-photo {
  position: relative;
  z-index: auto;
  inset: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1.6;
  mask-image: none;
}
body:not(.presentation-mode) .history-gallery .place-copy .eyebrow,
body:not(.presentation-mode) .history-gallery .place-copy .place-number { color: var(--orange); }
body:not(.presentation-mode) #destination-ayutthaya-info { grid-template-columns: .87fr 1.49fr; }
body:not(.presentation-mode) #destination-ayutthaya-info .place-photo { grid-column: 2; grid-row: 1; }
body:not(.presentation-mode) #destination-ayutthaya-info .place-copy { grid-column: 1; grid-row: 1; }
body:not(.presentation-mode) #destination-nakhon-info {
  grid-template-columns: 1fr;
  min-height: clamp(24rem, 54vw, 41rem);
  align-items: end;
  padding: clamp(1.4rem, 5vw, 4rem);
  background: var(--night);
  color: var(--paper);
}
body:not(.presentation-mode) #destination-nakhon-info .place-photo { position: absolute; inset: 0; height: 100%; z-index: -2; }
body:not(.presentation-mode) #destination-nakhon-info::after {
  display: block;
  background: linear-gradient(0deg, rgb(17 26 31 / 96%), rgb(17 26 31 / 62%) 31%, transparent 72%);
}
body:not(.presentation-mode) #destination-nakhon-info .eyebrow,
body:not(.presentation-mode) #destination-nakhon-info .place-number { color: var(--lime); }
body:not(.presentation-mode) #destination-palace-info {
  grid-template-columns: minmax(0, .96fr) minmax(0, 1fr);
  width: min(100%, 65rem);
  margin-inline: auto;
}
.tour-extra { margin-top: .75rem; border-top: 1px solid var(--line); padding: .55rem 0 0; }
.tour-extra summary { min-height: 2.05rem; cursor: pointer; font-size: .94rem; font-weight: 800; }
.tour-extra ul { display: grid; grid-template-columns: 1fr 1fr; margin: .6rem 0 0; padding: 0; gap: .6rem 1.6rem; list-style: none; font-size: .91rem; line-height: 1.55; }
.tour-extra strong { display: block; }
.trend-scene { background: #ede2d1; }
.trend-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: clamp(1rem, 3.2vw, 3.1rem);
  margin-block: clamp(1.45rem, 4vw, 3.15rem) 1.4rem;
}
.trend-card { border-top: 1px solid var(--line); padding-top: .7rem; }
.trend-card:first-child { grid-row: span 2; display: flex; flex-direction: column; }
.trend-card:not(:first-child) { display: grid; grid-template-columns: .85fr 1fr; align-items: start; gap: 1rem; }
.trend-card img { width: 100%; aspect-ratio: 1.35; object-fit: cover; }
.trend-card:not(:first-child) img { aspect-ratio: 1.05; }
.trend-card:first-child > div { order: -1; padding-bottom: 1rem; }
.trend-card h3 { font-size: clamp(1.25rem, 2.3vw, 2.35rem); line-height: 1.2; letter-spacing: -.06em; }
.trend-signal { margin-bottom: .35rem; color: #77331c; font-size: clamp(.85rem, 1.2vw, 1.14rem); font-weight: 850; }
.trend-card h3 + p { margin-top: .45rem; line-height: 1.5; font-size: clamp(.92rem, 1.35vw, 1.19rem); }
.trend-card a { display: inline-block; margin-top: .45rem; font-size: .875rem; }

.festival-scene { background: var(--night); color: var(--paper); --line: #7b7b72; }
.festival-scene .eyebrow { color: var(--lime); }
.festival-pair { grid-template-columns: 1.55fr 1fr; align-items: end; }
.festival-pair .image-block:first-child img { height: clamp(13.5rem, 35vw, 30rem); object-position: center 62%; }
.festival-pair .image-block:nth-child(2) img { height: clamp(11rem, 23vw, 21rem); object-position: center 45%; }
.festival-pair figcaption small { display: block; color: #dfd4c1; margin-top: .25rem; font-size: .875rem; }
.festival-program { margin-top: clamp(1.1rem, 3vw, 2.25rem); border-top: 1px solid var(--line); padding-top: .85rem; }
.festival-program h3 { font-size: clamp(.88rem, 1.2vw, 1.1rem); }
.festival-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.05rem, 3vw, 2.8rem);
  margin-top: .4rem;
}
.festival-dates > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem .7rem;
}
.festival-dates dt { font-weight: 800; }
.festival-dates dd { color: var(--lime); font-size: clamp(1.16rem, 2vw, 1.78rem); font-weight: 900; letter-spacing: -.04em; }
.festival-dates .festival-note { width: 100%; color: var(--paper); font-size: .87rem; font-weight: 650; letter-spacing: normal; }
.festival-question { margin-top: 1rem; font-size: .95rem; }
.festival-question a { color: var(--lime); }
.quiz-grid { grid-template-columns: 1.15fr .85fr; }
.quiz-copy h2 { font-size: clamp(2.42rem, 4.5vw, 5rem); }
.quiz-support { display: grid; gap: 1.1rem; }
.context-list { margin: 0; padding-left: 1.25em; font-size: clamp(.97rem, 1.45vw, 1.24rem); line-height: 1.65; }
.street-reveal { margin-top: .8rem; }
.street-reveal summary { font-size: .95rem; }
.question { margin-top: 1.1rem; font-size: clamp(1.15rem, 2.08vw, 1.85rem); font-weight: 850; line-height: 1.45; }
.reveal { margin-top: 1.3rem; }
.reveal summary {
  display: inline-flex;
  align-items: center;
  gap: .58rem;
  min-height: 2.9rem;
  padding: .56rem .75rem;
  cursor: pointer;
  list-style: none;
  border: 1px solid currentColor;
  font-weight: 850;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before { content: "+"; font-size: 1.2em; line-height: 1; }
.reveal[open] summary::before { content: "−"; }
.reveal[open] summary { background: var(--green); color: var(--paper); border-color: var(--green); }
.dark .reveal[open] summary { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.answer { margin-top: .8rem; padding: .92rem 1rem; background: var(--green); color: var(--paper); font-size: clamp(.96rem, 1.36vw, 1.24rem); line-height: 1.55; }
.dark .answer { background: var(--lime); color: var(--ink); }
.answer a { display: inline-block; margin-top: .35rem; font-size: .875rem; }
.travel-list dt, .conclusion dt { font-size: clamp(1.04rem, 1.4vw, 1.35rem); font-weight: 850; }
.travel-list strong { display: block; margin-block: .3rem; color: var(--orange); font-size: clamp(2rem, 4vw, 4rem); line-height: 1.1; letter-spacing: -.08em; }
.travel-list span, .travel-list a { display: block; margin-top: .48rem; line-height: 1.48; }
.travel-list a { font-size: .875rem; }
.conclusion dt { color: var(--lime); }
.conclusion dd { margin-top: .65rem; font-size: clamp(1.14rem, 2.3vw, 2.15rem); line-height: 1.35; font-weight: 850; }
.references-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; margin-top: 1.8rem; }
.references-grid details, .credits { border-top: 1px solid var(--line); padding: .8rem 0; }
.references-grid summary, .credits summary { cursor: pointer; font-weight: 850; }
.references-grid ul, .credits ul { margin: .55rem 0 0; padding-left: 1.15rem; line-height: 1.65; }
.credits { margin-top: 1.25rem; }

.controls {
  position: fixed;
  z-index: 4;
  inset: auto clamp(.75rem, 2.8vw, 2.75rem) clamp(.75rem, 2vh, 1.5rem) auto;
  color: var(--ink);
}
.controls summary {
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  min-height: 2.5rem;
  margin-left: auto;
  padding: .45rem .8rem;
  list-style: none;
  color: var(--paper);
  background: var(--ink);
  font-size: .88rem;
  font-weight: 850;
  cursor: pointer;
}
.controls summary::-webkit-details-marker { display: none; }
.controls summary::after { content: "+"; margin-left: .55rem; }
.controls[open] summary::after { content: "−"; }
.control-body {
  position: absolute;
  bottom: calc(100% + .35rem);
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .52rem .85rem;
  width: min(21rem, calc(100vw - 1.5rem));
  padding: .85rem;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 .5rem 1.5rem rgb(16 26 21 / 21%);
}
.progress { position: absolute; inset: 0 0 auto; height: 3px; background: #d8dccc; }
.progress span { display: block; width: 0; height: 100%; background: var(--orange); transition: width .2s ease-out; }
.current-scene { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 800; }
.slide-count { white-space: nowrap; font-size: .875rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.step-buttons { display: flex; grid-column: 1 / -1; gap: .4rem; white-space: nowrap; }

.presentation-mode .scene-frame { padding-block: clamp(1.75rem, 4.5vh, 3.5rem); }
.presentation-mode #references { padding-bottom: 5.2rem; }
.presentation-mode .atlas-figure { position: relative; top: auto; width: min(100%, 46vh, 29rem); }
.presentation-mode .atlas-heading { padding-bottom: .6rem; }
.presentation-mode .atlas { margin-top: .75rem; }
.presentation-mode .atlas-preview { margin-bottom: 0; }
.presentation-mode .atlas-preview img { height: clamp(7rem, 18vh, 11rem); }
.presentation-mode .atlas-group summary { min-height: 2.15rem; padding-block: .4rem; }
.presentation-mode .festival-pair .image-block img { height: clamp(8rem, 25vh, 15.5rem); }
.presentation-mode .trend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block: .95rem; gap: 1rem; }
.presentation-mode .trend-card, .presentation-mode .trend-card:first-child { display: block; grid-row: auto; }
.presentation-mode .trend-card img { height: clamp(8.7rem, 24vh, 12.5rem); aspect-ratio: unset; }
.presentation-mode .trend-card > div { padding-top: .7rem; padding-bottom: 0; }

@media screen and (prefers-reduced-motion: no-preference) {
  .hero.has-entered .hero-media img { animation: settle-picture 1050ms cubic-bezier(.2, .65, .25, 1) both; }
  .hero.has-entered .hero-copy { animation: arrive 580ms ease-out 100ms both; }
  .has-entered .bar-track span { animation: grow-bar 640ms cubic-bezier(.22, .64, .25, 1) both; }
  .has-entered .bar-list li:nth-child(2) .bar-track span { animation-delay: 115ms; }
  .has-entered .bar-list li:nth-child(3) .bar-track span { animation-delay: 230ms; }
  .has-entered .atlas-pin::before { animation: atlas-dot 390ms ease-out 150ms both; }
  .has-entered .atlas-pin[aria-pressed="true"]::before { animation-delay: 0ms; }
  .has-entered .trend-card { animation: arrive 460ms ease-out both; }
  .has-entered .trend-card:nth-child(2) { animation-delay: 105ms; }
  .has-entered .trend-card:nth-child(3) { animation-delay: 210ms; }
  .presentation-mode .place-panel .place-photo { animation: show-picture 320ms ease-out both; }
  .presentation-mode .place-panel .place-copy { animation: arrive 290ms ease-out 45ms both; }
  .atlas-preview.is-changing img { animation: show-picture 290ms ease-out both; }
  #destination-nakhon-info.has-entered .place-copy { animation: arrive 490ms ease-out 100ms both; }
  .has-entered .festival-dates > div { animation: arrive 400ms ease-out 150ms both; }
  .has-entered .festival-dates > div:nth-child(2) { animation-delay: 280ms; }
  .has-entered .festival-dates > div:nth-child(3) { animation-delay: 390ms; }
  .reveal[open] .answer { animation: arrive 270ms ease-out both; }
}
@keyframes settle-picture {
  from { transform: scale(1.065); }
  to { transform: scale(1); }
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(.65rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes grow-bar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes show-picture {
  from { opacity: .4; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes atlas-dot {
  from { opacity: 0; transform: scale(.4); }
  to { opacity: 1; transform: scale(1); }
}

@media (min-width: 761px) and (max-height: 790px) {
  .presentation-mode .scene-frame { padding-block: clamp(1.4rem, 3.6vh, 1.9rem); }
  .presentation-mode #contents.scene-frame { padding-top: 1.8rem; }
  .presentation-mode .split-photo .image-block img { aspect-ratio: 1.3; }
  .presentation-mode h2 { font-size: clamp(2.35rem, 4.2vw, 4rem); }
  .presentation-mode .history-gallery .place-panel { min-height: clamp(16rem, 41vh, 31rem); padding-block: clamp(1.35rem, 3vh, 2.3rem); }
  .presentation-mode .atlas-preview img { height: clamp(6.5rem, 16vh, 9rem); }
  .presentation-mode .atlas-group summary { min-height: 1.95rem; padding-block: .32rem; }
  .presentation-mode .atlas-group details p { font-size: .85rem; line-height: 1.43; }
  .presentation-mode .atlas-group h3 { margin-bottom: .4rem; }
}
@media (max-width: 760px) {
  :root { --header: 3.65rem; }
  .wordmark span[lang="th"] { display: none; }
  .hero { min-height: clamp(31rem, 78svh, 49rem); padding-block: 2.5rem 5.4rem; }
  .hero-copy { padding: 0; }
  .hero-media img { width: 100%; object-position: 58% 36%; mask-image: none; }
  .hero-media::after { background: linear-gradient(0deg, var(--night) 4%, rgb(17 26 31 / 91%) 28%, rgb(17 26 31 / 59%) 59%, transparent 100%); }
  .hero-media figcaption { right: auto; left: var(--gutter); bottom: 1.05rem; padding-top: .35rem; line-height: 1.3; }
  .hero-media figcaption strong { font-size: 1rem; }
  .hero h1 { font-size: clamp(3.25rem, 12vw, 5.8rem); }
  .scene-frame { padding-block: 3.3rem; }
  .scene h2 { font-size: clamp(2.28rem, 7.85vw, 3.4rem); }
  .split, .quiz-grid, .industry-grid, .contents-grid { grid-template-columns: 1fr; gap: 1.55rem; }
  .split-photo figure { order: 1; }
  .photo-pair, .timeline, .travel-list, .conclusion { gap: 1.35rem; }
  .timeline, .travel-list, .conclusion { grid-template-columns: 1fr; }
  .photo-pair .image-block img { height: clamp(7rem, 27vw, 12.5rem); }
  .place-panel { align-items: end; min-height: 23rem; }
  .place-photo { width: 100%; mask-image: none; }
  .place-panel::after { background: linear-gradient(0deg, #101d19 4%, rgb(16 29 25 / 90%) 34%, rgb(16 29 25 / 28%) 76%, transparent 100%); }
  .atlas, .atlas-index, .trend-grid, .tour-extra ul,
  .presentation-mode .trend-grid { grid-template-columns: 1fr; }
  .atlas-heading h2 { font-size: clamp(1.95rem, 7vw, 3.4rem); }
  .atlas-count { align-items: start; gap: .35rem; }
  .atlas-count strong { font-size: 2.35rem; }
  .atlas-count span { font-size: .75rem; }
  .atlas-figure { position: relative; top: auto; width: min(100%, 21rem); }
  .atlas-source { grid-column: auto; }
  body:not(.presentation-mode) .history-gallery .place-panel { grid-template-columns: 1fr; }
  body:not(.presentation-mode) #destination-ayutthaya-info .place-copy,
  body:not(.presentation-mode) #destination-ayutthaya-info .place-photo { grid-column: auto; grid-row: auto; }
  body:not(.presentation-mode) #destination-nakhon-info { min-height: 25rem; }
  .trend-card:first-child { grid-row: auto; }
  .trend-card:not(:first-child) { gap: .75rem; }
  .festival-pair { grid-template-columns: 1fr; }
  .festival-pair .image-block:first-child img { height: clamp(13.5rem, 56vw, 22rem); }
  .festival-pair .image-block:nth-child(2) { width: 86%; justify-self: end; }
  .festival-pair .image-block:nth-child(2) img { height: clamp(9.5rem, 42vw, 17rem); }
  .festival-dates { gap: 1.35rem; }
  .stat-panel { min-height: 11rem; }
  .references-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .masthead .tour-nav { display: none; }
}
@media (max-width: 365px) {
  .place-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .festival-dates { grid-template-columns: 1fr; gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .masthead, .controls, .action { display: none !important; }
  .scene { min-height: 0; }
  .atlas-figure { position: static; }
  .scene-frame, .hero { padding: 1cm; }
  .hero { min-height: 12cm; }
  .place-options { display: none; }
  .place-panel { display: grid; min-height: 0; padding: .6cm; }
  .place-photo, .place-panel::after { display: none; }
  body { print-color-adjust: exact; }
}
