@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/kanit-500-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/kanit-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/kanit-700-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/kanit-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/sarabun-400-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/sarabun-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/sarabun-700-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/sarabun-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   thaijavrank.com v2 - entertainment/dark theme. Zero JS site.
   Thai typography (do not "fix"):
   - body line-height 1.75 (Sarabun collision floor is 1.53)
   - NO letter-spacing on Thai; word-break normal; text-align start
   ============================================================ */
:root {
  --bg: #131317;
  --surface: #1c1c23;
  --surface-2: #24242e;
  --line: #32323e;
  --ink: #eceae5;
  --muted: #a5a2ad;
  --accent: #ff5a76;
  --accent-soft: #ff8ba0;
  --gold: #e8c15a;
  --maxw: 900px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;
  font-size: 17px; line-height: 1.75;
  color: var(--ink); background: var(--bg);
  word-break: normal; text-align: start; letter-spacing: normal;
}
h1, h2, h3 { font-family: 'Kanit', 'Sarabun', sans-serif; line-height: 1.45; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 2.4rem 0 .9rem; }
h3 { font-size: 1.05rem; font-weight: 500; margin: 1.2rem 0 .4rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

/* header */
.sitehead { background: rgba(19,19,23,.97); border-bottom: 1px solid var(--line); }
.sitehead .inner { max-width: var(--maxw); margin: 0 auto; padding: .85rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.6rem; }
.brand { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--ink); }
.brand em { color: var(--accent); font-style: normal; }
.nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .95rem; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }

main { max-width: var(--maxw); margin: 0 auto; padding: 1.6rem 1rem 3rem; }
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }

/* home hero */
.hero-head { padding: .6rem 0 .4rem; }
.hero-head .stamp { color: var(--gold); font-family: 'Kanit', sans-serif; font-size: .9rem; font-weight: 500; }
.hero-head h1 { margin: .25rem 0 .8rem; }
.hero-head h1 span { color: var(--accent-soft); }
.toc { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.1rem 0 .4rem; }
.toc a { background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
  padding: .28rem .85rem; font-size: .86rem; color: var(--muted); }
.toc a:hover { border-color: var(--accent); color: var(--ink); }

/* ranking cards */
.cards { list-style: none; display: grid; gap: 1.1rem; margin: 1.2rem 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; }
.card .pic { flex: 0 0 200px; position: relative; background: var(--surface-2); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card .pic .ph { width: 100%; height: 100%; min-height: 230px; display: flex; align-items: center;
  justify-content: center; font-family: 'Kanit', sans-serif; font-size: 3rem; font-weight: 700;
  color: var(--line); background: linear-gradient(150deg, var(--surface-2), var(--surface)); }
.rankbadge { position: absolute; top: .6rem; left: .6rem; background: var(--accent); color: #fff;
  font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 1.05rem;
  border-radius: 10px; padding: .05rem .6rem; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.card .body { padding: 1rem 1.15rem 1.05rem; flex: 1 1 auto; display: flex; flex-direction: column; }
.card .body h3 { margin: 0 0 .1rem; font-size: 1.16rem; font-weight: 600; }
.card .body h3 a { color: var(--ink); }
.card .body h3 a:hover { color: var(--accent-soft); }
.card .jp { color: var(--muted); font-size: .84rem; margin-bottom: .5rem; }
.card .stats { display: flex; flex-wrap: wrap; gap: .3rem .95rem; font-size: .82rem;
  color: var(--muted); margin-bottom: .6rem; }
.card .stats b { color: var(--ink); font-weight: 600; }
.card .blurb { font-size: .95rem; margin-bottom: .8rem; }
.card .cta { margin-top: auto; align-self: flex-start; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink); border-radius: 9px;
  padding: .4rem 1rem; font-size: .88rem; font-family: 'Kanit', sans-serif; font-weight: 500; }
.card .cta:hover { border-color: var(--accent); color: var(--accent-soft); }

/* generic band + faq */
.band { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.3rem; margin: 1.6rem 0; }
.band h2 { margin-top: 0; }
.faq dt { font-family: 'Kanit', sans-serif; font-weight: 500; margin: 1.05rem 0 .25rem; color: var(--ink); }
.faq dd { margin: 0 0 .4rem; color: var(--muted); }

/* directory grid */
.dir { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .9rem; margin: 1.2rem 0; }
.dir li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dir img { aspect-ratio: 3/4; object-fit: cover; object-position: top center; width: 100%; }
.dir .ph { aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center;
  font-family: 'Kanit', sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--line);
  background: linear-gradient(150deg, var(--surface-2), var(--surface)); }
.dir .nm { padding: .5rem .7rem .65rem; font-size: .92rem; line-height: 1.5; }
.dir .nm a { color: var(--ink); font-weight: 600; }
.dir .nm span { display: block; color: var(--muted); font-size: .78rem; }

/* profile page */
.p-hero { display: flex; gap: 1.4rem; margin: .6rem 0 1.6rem; }
.p-hero .pic { flex: 0 0 300px; position: relative; }
.p-hero .pic img { border-radius: 14px; border: 1px solid var(--line); }
.p-hero .pic .ph { width: 300px; aspect-ratio: 3/4; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-family: 'Kanit', sans-serif;
  font-size: 4rem; font-weight: 700; color: var(--line);
  background: linear-gradient(150deg, var(--surface-2), var(--surface)); }
.p-hero .pic figcaption { font-size: .7rem; color: var(--muted); margin-top: .35rem; line-height: 1.5; }
.p-hero .info { flex: 1 1 auto; }
.p-hero .info h1 { margin-bottom: .1rem; }
.p-hero .jp { color: var(--muted); font-size: .95rem; margin-bottom: .2rem; }
.p-hero .variants { color: var(--muted); font-size: .82rem; margin-bottom: .9rem; }
.kicker { display: inline-block; background: var(--accent); color: #fff; border-radius: 8px;
  font-family: 'Kanit', sans-serif; font-weight: 600; font-size: .85rem;
  padding: .1rem .65rem; margin-bottom: .55rem; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: .9rem 1.05rem; }
.facts dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .92rem; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.facts a { overflow-wrap: anywhere; } /* latin handles only */

/* works table */
.tablewrap { overflow-x: auto; margin: .6rem 0 1.2rem; border: 1px solid var(--line); border-radius: 12px; }
table.works { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 430px; }
.works th, .works td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); text-align: start; }
.works th { background: var(--surface-2); font-family: 'Kanit', sans-serif; font-weight: 500; }
.works tr:last-child td { border-bottom: 0; }
.works .code { font-family: 'Kanit', sans-serif; font-weight: 600; color: var(--gold); white-space: nowrap; }

footer.sitefoot { border-top: 1px solid var(--line); margin-top: 2.5rem; }
footer.sitefoot .inner { max-width: var(--maxw); margin: 0 auto; padding: 1.2rem 1rem 1.7rem;
  font-size: .84rem; color: var(--muted); }
footer.sitefoot nav { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-bottom: .55rem; }
footer.sitefoot a { color: var(--muted); }

@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .card { flex-direction: column; }
  .card .pic { flex-basis: auto; }
  .card .pic img { max-height: 340px; }
  .p-hero { flex-direction: column; }
  .p-hero .pic, .p-hero .pic .ph { flex-basis: auto; width: min(100%, 300px); }
  .facts dl { grid-template-columns: 1fr; gap: 0; }
  .facts dt { margin-top: .55rem; }
}

/* ---- blog ---- */
.bloglist { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.bloglist li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.bloglist img { aspect-ratio: 16/10; object-fit: cover; object-position: center 22%; width: 100%; }
.bloglist .bd { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.bloglist time { color: var(--gold); font-family: 'Kanit', sans-serif; font-size: .78rem; }
.bloglist h3 { margin: .15rem 0 .35rem; font-size: 1.02rem; font-weight: 600; line-height: 1.5; }
.bloglist h3 a { color: var(--ink); }
.bloglist h3 a:hover { color: var(--accent-soft); }
.bloglist p { font-size: .87rem; color: var(--muted); margin: 0; }
.post-cover { border-radius: 14px; border: 1px solid var(--line); margin: .8rem 0 1.2rem; }
.post-meta { color: var(--muted); font-size: .86rem; margin-bottom: 1rem; }
.post-meta time { color: var(--gold); font-family: 'Kanit', sans-serif; }
figure.inline { margin: 1.2rem 0; }
figure.inline img { border-radius: 12px; border: 1px solid var(--line); }
figure.inline figcaption { font-size: .78rem; color: var(--muted); margin-top: .4rem; }
.rel { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.4rem 0 0; }
.rel a { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .28rem .9rem; font-size: .86rem; }

/* localised spec bullets on profile pages */
.facts ul.spec { list-style: none; display: grid; gap: .3rem; font-size: .93rem; }
.facts ul.spec li { padding-inline-start: 1rem; position: relative; }
.facts ul.spec li::before { content: "▸"; position: absolute; inset-inline-start: 0; color: var(--accent); }

/* works table: keep code + release date on one line, give details the slack */
.works th:nth-child(1), .works td:nth-child(1) { white-space: nowrap; width: 1%; }
.works th:nth-child(2), .works td:nth-child(2) { white-space: nowrap; width: 1%; }
.works th:nth-child(3), .works td:nth-child(3) { white-space: nowrap; width: 1%; }
table.works { min-width: 560px; }
