/* pikbaan.hellodatgame.com — the game's own look: Northern Thai (Lanna).
   Cloth: the page is dyed cloth (indigo, lac red, jackfruit gold, raw cotton), sections are joined by woven bands of
   lai nam lai (Nan's flowing-water pattern), pictures unroll like a hanging scroll.
   Lanterns: a string of khom across the hero, khom loi rising at the end of the page.
   Tung: every courtable person has a tung flag with their number and name.
   Each section names its colours (--sec-bg / --sec-fg, set in build.js); with JavaScript the sections turn see-through
   and the body fades between those colours (static/site.js). Headings: Trirong. Text: Noto Sans Thai. */
@font-face { font-family: "Noto Sans Thai"; src: url("/fonts/NotoSansThai.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Trirong"; src: url("/fonts/Trirong-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
	--fai: #F5EBD6;        /* raw cotton */
	--kram: #26335C;       /* indigo */
	--kram-deep: #171E3D;
	--krang: #A63A2E;      /* lac red */
	--kham: #D9A441;       /* gold leaf */
	--teak: #5A3A26;
	--ink: #241A16;
	--pad: clamp(18px, 5vw, 80px);
	--sec-bg: var(--fai);
	--sec-fg: var(--ink);
	--head: "Trirong", "Noto Sans Thai", serif;
	/* lai nam lai: three stepped waves, gold, cotton and lac red */
	--weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='64' viewBox='0 0 96 64'%3E%3Cg fill='none' stroke-width='4' stroke-linecap='square'%3E%3Cpath stroke='%23D9A441' d='M0 60h8v-6h8v-6h8v-6h8v-6h8v-6h8v-6h8v6h8v6h8v6h8v6h8v6h8v6'/%3E%3Cpath stroke='%23F5EBD6' d='M0 50h8v-6h8v-6h8v-6h8v-6h8v-6h8v-6h8v6h8v6h8v6h8v6h8v6h8v6'/%3E%3Cpath stroke='%23C9493A' d='M0 40h8v-6h8v-6h8v-6h8v-6h8v-6h8v-6h8v6h8v6h8v6h8v6h8v6h8v6'/%3E%3C/g%3E%3C/svg%3E");
	/* a small diamond row (lai ta), for underlines */
	--ta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12' viewBox='0 0 24 12'%3E%3Cpath fill='%23D9A441' d='M6 0l6 6-6 6-6-6zM18 3l3 3-3 3-3-3z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
	margin: 0; overflow-x: hidden;
	background: var(--kram-deep); color: var(--ink);
	font-family: "Noto Sans Thai", system-ui, sans-serif; font-size: 18px; line-height: 1.75;
	transition: background-color .8s ease;
}
/* the weave of the cloth, very faint, over the whole page */
body::before { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .04; mix-blend-mode: multiply;
	background-image: repeating-linear-gradient(0deg, #000 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 3px); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--kham); outline-offset: 4px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }
img.px { image-rendering: pixelated; max-width: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; }

[data-bg] { background: var(--sec-bg); color: var(--sec-fg); transition: color .5s; }
.js [data-bg] { background: transparent; }

/* ---------- top bar ---------- */
.top { position: absolute; inset: 0 0 auto 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 14px var(--pad); color: var(--fai); }
.top a { text-decoration: none; }
.brand { font-family: var(--head); font-size: 1.5rem; }
.top-links { display: flex; align-items: center; gap: 12px; }
.studio { font-weight: 700; font-size: .9rem; }
.lang { font-weight: 700; font-size: .9rem; padding: 2px 22px; background: rgba(23, 30, 61, .6); box-shadow: inset 0 0 0 1.5px var(--kham); clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); transition: background-color .2s, color .2s; }
.lang:hover { background: var(--kham); color: var(--ink); }
@media (max-width: 480px) { .studio-name { display: none; } }

/* ---------- opening curtain: two lengths of indigo cloth drawn apart ---------- */
.loader { display: none; }
.js .loader { display: block; position: fixed; inset: 0; z-index: 30; pointer-events: none; animation: bail 0s 4s forwards; }
.loader i { position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--kram-deep); transition: transform 1s cubic-bezier(.7, 0, .2, 1); }
.loader i::after { content: ""; position: absolute; top: 0; bottom: 0; width: 34px; background: var(--kram) var(--weave) 0 0 / 48px 32px; }
.loader i:nth-child(1) { left: 0; }
.loader i:nth-child(1)::after { right: 0; }
.loader i:nth-child(2) { right: 0; }
.loader i:nth-child(2)::after { left: 0; }
.loader span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-size: clamp(3rem, 13vw, 8rem); color: var(--kham); transition: opacity .4s; }
.js.ready .loader i:nth-child(1) { transform: translateX(-101%); }
.js.ready .loader i:nth-child(2) { transform: translateX(101%); }
.js.ready .loader span { opacity: 0; }
.js.skip .loader { display: none; }
@keyframes bail { to { visibility: hidden; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(150px, 24svh, 240px) var(--pad) 120px; overflow: hidden; color: var(--fai); }
.hero-art { position: absolute; inset: 0; }
.hero-art img { width: 100%; height: 112%; object-fit: cover; object-position: 50% 100%; transform: translate3d(0, calc(var(--scroll, 0) * -.08px), 0); will-change: transform; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(23, 30, 61, .94) 0%, rgba(23, 30, 61, .7) 34%, rgba(23, 30, 61, .12) 64%, rgba(23, 30, 61, 0) 100%); }
.hero-text { position: relative; }
.hero h1 { font-size: clamp(4.6rem, 17vw, 13rem); line-height: 1.25; color: var(--fai); text-shadow: 0 .03em 0 var(--krang), 0 0 .5em rgba(217, 164, 65, .45); }
.hero h1::after { content: ""; display: block; height: 14px; width: min(46%, 380px); margin: 2px auto 0; background: var(--ta) center / 28px 14px repeat-x; }
.hero-sub { font-size: clamp(1.15rem, 2.8vw, 2rem); font-weight: 700; margin-top: 12px; text-shadow: 0 2px 8px var(--kram-deep); }
.badges { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.badge { padding: 3px 24px; font-size: .95rem; font-weight: 800; background: var(--fai); color: var(--ink); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.badge-age { background: var(--krang); color: var(--fai); }
.cue { position: absolute; left: 50%; bottom: 58px; translate: -50% 0; display: inline-flex; flex-direction: column; align-items: center; font-size: .8rem; font-weight: 800; letter-spacing: .2em; text-decoration: none; text-shadow: 0 2px 6px var(--kram-deep); }
.cue-arrow { font-size: 1.5rem; line-height: 1; animation: drop 1.4s ease-in-out infinite; }
@keyframes drop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* a string of lanterns across the hero; each one sways from its knot */
.khom-line { position: absolute; top: 64px; left: -2vw; right: -2vw; height: 150px; display: flex; justify-content: space-around; align-items: flex-start; pointer-events: none; }
.khom-line::before { content: ""; position: absolute; left: 0; right: 0; top: -58px; height: 80px; border-bottom: 2px solid rgba(245, 235, 214, .55); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.khom-line span { display: block; width: clamp(26px, 3.6vw, 46px); color: var(--krang); transform-origin: 50% 0; animation: sway 4.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.55s); filter: drop-shadow(0 0 10px rgba(255, 200, 110, .55)); margin-top: calc((1 - (var(--i) - 4) * (var(--i) - 4) / 16) * 22px); }
.khom-line span:nth-child(3n + 2) { color: var(--kham); }
.khom-line span:nth-child(3n) { color: var(--fai); }
.khom { display: block; width: 100%; height: auto; }
@keyframes sway { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }

/* hero entrance, once the curtain opens */
.js .hero h1, .js .hero-sub, .js .badges, .js .hero .cue, .js .khom-line { opacity: 0; transition: opacity .9s ease, transform 1s cubic-bezier(.2, .8, .2, 1); }
.js .hero h1 { transform: translateY(36px); }
.js .hero-sub, .js .badges { transform: translateY(26px); }
.js .khom-line { transform: translateY(-60px); }
.js.ready .khom-line { opacity: 1; transform: none; transition-delay: .2s; }
.js.ready .hero h1 { opacity: 1; transform: none; transition-delay: .45s; }
.js.ready .hero-sub { opacity: 1; transform: none; transition-delay: .65s; }
.js.ready .badges { opacity: 1; transform: none; transition-delay: .8s; }
.js.ready .hero .cue { opacity: 1; transition-delay: 1.1s; }
/* a visit that skips the curtain (seen already in this tab) shows the hero at once, with no entrance to wait for */
.js.skip .hero h1, .js.skip .hero-sub, .js.skip .badges, .js.skip .hero .cue, .js.skip .khom-line { opacity: 1; transform: none; transition: none; }

/* ---------- a woven band, like the hem of a sin: flowing-water pattern above and below running words ---------- */
.band { position: relative; z-index: 2; padding: 30px 0; background: var(--kram-deep); color: var(--kham); overflow: hidden; }
.band::before, .band::after { content: ""; position: absolute; left: 0; right: 0; height: 26px; background: var(--weave) var(--flow, 0px) 50% / 39px 26px repeat-x; }
.band::before { top: 2px; }
.band::after { bottom: 2px; transform: scaleY(-1); }
.band-b { background: var(--kram-deep); color: var(--fai); }
.band-run { display: flex; gap: 1.1em; width: max-content; font-family: var(--head); font-size: clamp(1.05rem, 2.2vw, 1.7rem); white-space: nowrap; animation: run 60s linear infinite; }
.band-run span[aria-hidden] { font-size: .6em; align-self: center; color: var(--fai); }
.band-b .band-run { animation-direction: reverse; }
.band-b .band-run span[aria-hidden] { color: var(--kham); }
@keyframes run { to { translate: -50% 0; } }

/* ---------- plain parts of the page ---------- */
.block { position: relative; padding: clamp(84px, 12vw, 160px) var(--pad); overflow: hidden; }
h2 { font-size: clamp(2.4rem, 6.6vw, 5.6rem); line-height: 1.25; text-wrap: balance; max-width: 15em; }
h2::after { content: ""; display: block; width: min(220px, 50%); height: 12px; margin-top: 10px; background: var(--ta) left / 24px 12px repeat-x; }
.block-text { max-width: 36em; margin-top: 18px; font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 500; text-wrap: pretty; }
.kicker { font-size: .85rem; font-weight: 800; letter-spacing: .2em; }
.wip { font-size: .8rem; font-weight: 600; opacity: .75; margin-top: 18px; }
.wip::before { content: ""; display: inline-block; width: 9px; height: 9px; rotate: 45deg; background: var(--kham); margin-right: 9px; }
.tagline { margin-top: 48px; font-family: var(--head); font-size: clamp(1.5rem, 4vw, 3.2rem); line-height: 1.3; text-wrap: balance; color: var(--kham); }

.intro { text-align: center; }
.intro .kicker { color: var(--krang); }
.intro .lead { max-width: 25em; margin: 18px auto 30px; font-family: var(--head); font-size: clamp(1.3rem, 3vw, 2.3rem); line-height: 1.6; text-wrap: pretty; }
.intro .wip { margin-top: 28px; }

/* a button shaped like the side of a lantern */
.btn { display: inline-block; padding: 12px 40px; font-size: 1.1rem; font-weight: 800; text-decoration: none; color: var(--fai); background: var(--krang); clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%); transition: background-color .2s, color .2s, letter-spacing .25s; }
.btn:hover { background: var(--kham); color: var(--ink); letter-spacing: .04em; }
.btn span { display: inline-block; transition: transform .2s; }
.btn:hover span { transform: translateX(6px); }

/* a picture in a teak frame with a gold inner line; it unrolls from the top like a hanging scroll */
.shot img, .cast-kv img, .season img { width: 100%; border: clamp(5px, .7vw, 9px) solid var(--teak); outline: 2px solid var(--kham); outline-offset: calc(-1 * clamp(5px, .7vw, 9px) - 5px); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .6); background: var(--ink); }
.unroll { clip-path: inset(0 0 calc((1 - var(--p, 1)) * 86%) 0); translate: 0 calc((1 - var(--p, 1)) * 30px); }
.shot figcaption { margin-top: 14px; font-weight: 600; font-size: .95rem; }
.shot figcaption b { display: inline-block; margin-right: 10px; font-family: var(--head); font-size: 1.2em; color: var(--kham); }

/* town: a strip of pictures that scrolls sideways */
.strip { display: flex; gap: clamp(18px, 3vw, 44px); overflow-x: auto; scroll-snap-type: x mandatory; margin: 44px calc(-1 * var(--pad)) 0; padding: 6px var(--pad) 34px; scrollbar-color: var(--kham) transparent; }
.strip .shot { flex: 0 0 min(860px, 84vw); scroll-snap-align: center; }

/* seasons: radios choose the picture, the section takes the season's colour (rules written by build.js) */
#seasons { transition: background-color .8s ease, color .5s; }
.seasons { margin-top: 36px; max-width: 1180px; }
.seasons > input { position: absolute; opacity: 0; pointer-events: none; }
.season-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.season-tabs label { cursor: pointer; padding: 6px 30px; font-family: var(--head); font-size: clamp(1rem, 1.8vw, 1.35rem); background: color-mix(in srgb, currentColor 14%, transparent); clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); transition: background-color .2s, color .2s; }
.season-tabs label:hover { background: color-mix(in srgb, currentColor 30%, transparent); }
.season { display: none; animation: dye .6s ease; }
.season figcaption { margin-top: 18px; font-size: clamp(1.05rem, 1.8vw, 1.35rem); font-weight: 500; }
.season figcaption strong { font-family: var(--head); margin-right: 10px; }
@keyframes dye { from { opacity: 0; filter: saturate(0); } to { opacity: 1; filter: none; } }

/* clinic */
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 30px clamp(24px, 4vw, 60px); margin: 46px 0 58px; }
.points li { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; border-top: 2px solid var(--kham); }
.points b { font-family: var(--head); font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1; color: var(--kham); }
.points strong { font-family: var(--head); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.35; }
.points span { opacity: .92; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: clamp(24px, 4vw, 56px); }

/* a standing picture as a print on sa (mulberry) paper, held by a strip of woven tape. The pictures are painted on
   white: multiply lets the paper show through. */
.sticker { position: relative; background: #FBF4E4; border: 1px solid rgba(90, 58, 38, .35); padding: 8px 8px 0; box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .55); }
.sticker::before { content: ""; position: absolute; z-index: 1; left: 50%; top: -13px; width: 96px; height: 26px; translate: -50% 0; rotate: -3deg; background: var(--acc, var(--krang)) var(--weave) 0 50% / 30px 20px repeat-x; opacity: .92; }
.sticker img:not(.px) { width: 100%; mix-blend-mode: multiply; }

/* people of the town */
.persons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: clamp(34px, 4vw, 56px); margin-top: 56px; }
.person { display: grid; grid-template-columns: clamp(120px, 18vw, 200px) 1fr; gap: clamp(18px, 2.6vw, 34px); align-items: center; }
.person .sticker { rotate: -2.5deg; }
.person:nth-child(even) .sticker { rotate: 2.5deg; }
.person h3 { font-size: clamp(1.8rem, 3.6vw, 3rem); }
.role { font-weight: 700; color: var(--krang); margin-bottom: 6px; }
.player { display: flex; flex-wrap: wrap; gap: 34px clamp(30px, 5vw, 70px); align-items: center; margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(46px, 5vw, 64px); background: var(--ta) left top / 24px 12px repeat-x; }
.player-text { flex: 1 1 300px; }
.player-text h3 { font-size: clamp(1.8rem, 4.2vw, 3.4rem); line-height: 1.3; text-wrap: balance; }
.player-text p { margin-top: 12px; max-width: 28em; font-weight: 500; }
.player-pics { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; }
.player-pics .sticker { background: #fff; padding: 0 0 10px; text-align: center; }
.player-pics .sticker:first-child { rotate: -2deg; }
.player-pics .sticker:last-child { rotate: 2deg; }
.player-pics img { margin: 0 auto; }
.player-pics figcaption { padding: 0 10px; max-width: 288px; font-size: .85rem; font-weight: 600; color: var(--ink); }

/* the eight: names to jump to */
.cast-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.cast-nav a { padding: 5px 30px; background: var(--fai); color: var(--ink); font-family: var(--head); font-size: clamp(1rem, 1.8vw, 1.3rem); text-decoration: none; clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); transition: background-color .2s, translate .2s; }
.cast-nav a:hover { background: var(--kham); translate: 0 -3px; }

/* ---------- one section per person ---------- */
.cast { position: relative; display: grid; grid-template-columns: minmax(200px, 300px) 1fr; grid-template-areas: "kv kv" "fig head" "fig stats" "fig about"; gap: 0 clamp(28px, 5vw, 80px); align-items: start; padding: clamp(100px, 12vw, 160px) var(--pad) clamp(90px, 11vw, 150px); overflow: hidden; scroll-margin-top: -40px; }
.cast.flip { grid-template-columns: 1fr minmax(200px, 300px); grid-template-areas: "kv kv" "head fig" "stats fig" "about fig"; }
.cast > * { position: relative; }
/* where one person's cloth meets the next: a row of the flowing-water pattern */
.cast::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px; background: var(--weave) var(--flow, 0px) 50% / 39px 26px repeat-x; opacity: .9; }
.cast-kv { grid-area: kv; max-width: 1240px; width: 100%; justify-self: center; }
.cast-fig { grid-area: fig; margin-top: clamp(-190px, -13vw, -70px); z-index: 2; }
.cast-fig .sticker { rotate: -3deg; transition: rotate .4s cubic-bezier(.3, 1.4, .5, 1); }
.cast.flip .cast-fig .sticker { rotate: 3deg; }
.cast-fig .sticker:hover { rotate: 0deg; }
.cast-head { grid-area: head; margin-top: clamp(26px, 4vw, 54px); padding-right: clamp(70px, 9vw, 130px); min-height: clamp(200px, 22vw, 300px); }
.cast-head .kicker { color: var(--acc); }
.cast h3 { font-size: clamp(4rem, 11.5vw, 9.6rem); line-height: 1.3; }
.cast h3::after { content: ""; display: block; width: min(260px, 60%); height: 14px; margin-top: -4px; background: var(--ta) left / 28px 14px repeat-x; }
.cast-full { margin-top: 10px; font-size: clamp(1.05rem, 1.8vw, 1.4rem); font-weight: 700; opacity: .85; }
.cast-job { margin-top: 8px; font-size: clamp(1.1rem, 1.9vw, 1.5rem); font-weight: 700; line-height: 1.5; max-width: 26em; text-wrap: pretty; }
.cast-quote { display: inline-block; margin-top: 20px; padding: 8px 26px; font-family: var(--head); font-size: clamp(1.1rem, 2vw, 1.5rem); background: var(--acc); color: var(--sec-bg); border-radius: 2px 22px 22px 22px; }

/* tung: a long flag that hangs from the top of the person's text, with their number and name */
.tung { position: absolute; right: 0; top: -6px; width: clamp(52px, 6vw, 84px); padding: 0 0 46px; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--acc); color: var(--sec-bg); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 30px), 0 100%); transform-origin: 50% 0; animation: sway 6s ease-in-out infinite; }
.tung::before, .tung::after { content: ""; width: 100%; height: 20px; background: var(--weave) 0 50% / 30px 20px repeat-x; }
.tung::after { transform: scaleY(-1); }
.tung b { font-family: var(--head); font-size: clamp(1.3rem, 2.2vw, 2rem); line-height: 1; }
.tung span { writing-mode: vertical-rl; font-family: var(--head); font-size: clamp(1.1rem, 1.9vw, 1.7rem); letter-spacing: .14em; line-height: 1; }
.cast:nth-of-type(even) .tung { animation-delay: -3s; }

.stats { grid-area: stats; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 30px; max-width: 760px; }
.stat { padding: 12px 16px; background: color-mix(in srgb, currentColor 9%, transparent); border-top: 3px solid var(--acc); }
.stat-wide { grid-column: span 2; }
.stat dt { font-size: .8rem; font-weight: 800; letter-spacing: .1em; color: var(--acc); }
.stat dd { font-family: var(--head); font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.3; white-space: nowrap; }
.stat dd small { font-family: "Noto Sans Thai", sans-serif; font-size: .5em; font-weight: 700; opacity: .8; }
.cast-about { grid-area: about; margin-top: 28px; max-width: 760px; }
.cast-about > p { font-size: clamp(1.05rem, 1.5vw, 1.25rem); font-weight: 500; text-wrap: pretty; }
.facts { margin-top: 24px; padding-top: 16px; background: var(--ta) left top / 24px 12px repeat-x; }
.facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.facts dt { font-family: var(--head); color: var(--acc); }
.facts dd { font-weight: 500; }

/* text that rises as it comes into view */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform 1s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.done { opacity: 1; transform: none; transition: none; }
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }
.reveal:nth-child(5) { transition-delay: .32s; }
.reveal:nth-child(6) { transition-delay: .4s; }

/* status */
.status { display: grid; gap: 14px; margin-top: 42px; max-width: 980px; }
.status li { position: relative; display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; padding: 16px 22px 16px 34px; background: #FBF4E4; border: 1px solid rgba(90, 58, 38, .3); font-weight: 600; box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .45); }
.status li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--kram); }
.status strong { font-family: var(--head); font-size: 1.15rem; color: var(--kram); }
.status li.status-0::before { background: #4F6B4A; }
.status-0 strong { color: #3C5638; }
.status li.status-1::before { background: var(--kham); }
.status-1 strong { color: #9A6B12; }

/* ---------- the end: follow and contact, under rising lanterns ---------- */
.end { position: relative; display: flex; flex-direction: column; padding: clamp(100px, 13vw, 160px) var(--pad) 0; overflow: hidden; }
.end > * { position: relative; }
.end .kicker { margin-bottom: 14px; color: var(--kham); font-family: var(--head); font-size: clamp(1.6rem, 4vw, 3rem); letter-spacing: 0; }
.end-text { margin-bottom: 30px; font-weight: 500; opacity: .85; }
.links { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 60px); margin-bottom: 90px; }
.links a { display: flex; flex-direction: column; align-items: center; gap: 4px; width: clamp(96px, 14vw, 170px); font-family: var(--head); font-size: clamp(1.1rem, 2.2vw, 1.8rem); text-decoration: none; color: var(--kham); }
.links li:nth-child(2) a { color: var(--fai); }
.links li:nth-child(3) a { color: #E0766A; }
.links .khom { width: 62%; filter: drop-shadow(0 0 14px rgba(255, 200, 110, .5)); transform-origin: 50% 0; transition: filter .25s; }
.links a:hover .khom, .links a:focus-visible .khom { animation: sway 1.6s ease-in-out infinite; filter: drop-shadow(0 0 26px rgba(255, 210, 130, .95)); }
.links a span { color: var(--fai); }
.mail a { font-family: var(--head); font-size: clamp(1.3rem, 4.2vw, 2.8rem); text-decoration-color: var(--kham); text-decoration-thickness: .08em; text-underline-offset: .2em; overflow-wrap: anywhere; }
.mail a:hover { color: var(--kham); }
.end-word { order: 9; margin: 40px 0 0 calc(var(--pad) * -1); padding-bottom: 46px; width: 100vw; text-align: center; font-family: var(--head); font-size: clamp(4rem, 20vw, 22rem); line-height: 1.3; white-space: nowrap; color: var(--kham); pointer-events: none; user-select: none; background: var(--weave) var(--flow, 0px) 100% / 39px 26px repeat-x; }
.copy { margin-top: 70px; font-size: .85rem; opacity: .75; }
/* khom loi: lanterns released on Yi Peng night */
.loi { position: absolute !important; inset: 0; pointer-events: none; }
.loi i { position: absolute; bottom: -60px; left: calc(4% + var(--i) * 8.1%); width: 16px; aspect-ratio: 3 / 4; border-radius: 45% 45% 30% 30%; background: radial-gradient(ellipse at 50% 75%, #FFF1C2 0%, #FFC25E 45%, #E0762E 100%); box-shadow: 0 0 18px 4px rgba(255, 180, 80, .45); opacity: 0; animation: loi calc(13s + var(--i) * 1.3s) linear infinite; animation-delay: calc(var(--i) * -2.3s); }
.loi i:nth-child(3n) { width: 11px; }
.loi i:nth-child(3n + 1) { width: 22px; }
@keyframes loi { 0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: .9; } 70% { opacity: .7; } 100% { transform: translate(60px, -115vh); opacity: 0; } }
.lost { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
	body { font-size: 16px; }
	.khom-line { top: 58px; }
	.khom-line span:nth-child(n + 8) { display: none; }
	.cast, .cast.flip { grid-template-columns: 40% 1fr; grid-template-areas: "kv kv" "head head" "fig stats" "about about"; gap: 0 16px; padding-left: 0; padding-right: 0; padding-top: 26px; }
	.cast > :not(.cast-kv) { margin-left: var(--pad); margin-right: var(--pad); }
	.cast-kv img { border-inline: 0; }
	.cast-fig { margin: 36px 0 0 var(--pad) !important; }
	.cast-head { margin-top: 28px; min-height: 190px; }
	.stats { grid-template-columns: 1fr 1fr; gap: 8px; margin: 30px var(--pad) 0 0 !important; align-content: start; }
	.stat { padding: 8px 10px; }
	.stat dd { font-size: 1.3rem; }
	.stat-wide { grid-column: 1 / -1; }
	.facts div { grid-template-columns: 5.5em 1fr; }
	.person { grid-template-columns: 110px 1fr; }
	.status li { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.js .reveal, .js .hero h1, .js .hero-sub, .js .badges, .js .hero .cue, .js .khom-line { opacity: 1; transform: none; }
	.unroll { clip-path: none; translate: none; }
	.hero-art img { transform: none; }
	.loi i { opacity: .7; bottom: calc(20% + var(--i) * 5%); }
}
