
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ad079e0ecc.ttf) format('truetype');
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/4abf90ac0a.ttf) format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
  font-display: swap;
  src: url(fonts/0131672594.ttf) format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 500;
  font-stretch: normal;
  font-display: swap;
  src: url(fonts/1c0326c6b2.ttf) format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 600;
  font-stretch: normal;
  font-display: swap;
  src: url(fonts/fcdf60528a.ttf) format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 700;
  font-stretch: normal;
  font-display: swap;
  src: url(fonts/4bef22dc5f.ttf) format('truetype');
}
:root {
  --ink: #171619;
  --muted: #56525a;
  --paper: #f7f6f5;
  --line: #e5dfe1;
  --red: #bd102a;
  --red-dark: #960e23;
  --gutter: clamp(18px, 5vw, 72px);
  --max: 1280px;
  --section: clamp(42px, 6vw, 88px);
  --thai: "Noto Sans Thai", Tahoma, sans-serif;
  --heading: "Kanit", var(--thai);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body { margin: 0; color: var(--ink); background: white; font: 1rem/1.7 var(--thai); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .times, .placeholder { font-family: var(--heading); font-weight: 500; line-height: 1.22; }
h2 { font-size: clamp(1.8rem, 3.45vw, 3.1rem); }
h3 { font-size: clamp(1.18rem, 1.6vw, 1.42rem); }
p + p { margin-top: .8em; }
img { display: block; max-width: 100%; }
a { color: var(--red-dark); text-underline-offset: 4px; }
small, .eyebrow { font-size: .875rem; }
.muted { color: var(--muted); }
.eyebrow { color: var(--red-dark); font-weight: 700; letter-spacing: .095em; margin-bottom: .55rem; }
:focus-visible { outline: 3px solid #ee4761; outline-offset: 4px; }
summary, button, .btn { cursor: pointer; }
button, .btn, input, select, textarea { font: inherit; }
button, .btn {
  display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
  padding: .61rem .95rem; border: 1px solid transparent; border-radius: 6px;
  background: var(--red); color: white; font-weight: 700; line-height: 1.4;
  text-decoration: none; text-align: center;
}
button:hover, .btn:hover { background: var(--red-dark); }
.secondary { background: transparent; color: inherit; border-color: currentColor; }
.secondary:hover { background: #bd102a12; }
button:disabled { background: #eceaec; color: #555158; cursor: default; }
.shell { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; background: white; padding: .7rem; }
.skip-link:not(:focus) { transform: translateY(-160%); }
header { position: sticky; top: 0; z-index: 10; background: #121114; color: white; border-bottom: 1px solid #ffffff26; }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: white; font-weight: 700; letter-spacing: .06em; text-decoration: none; white-space: nowrap; font-size: .94rem; }
.brand b { display: inline-block; margin-right: .33rem; background: var(--red); padding: 2px 5px; border-radius: 3px; }
nav { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 24px); }
nav details { position: relative; }
nav a, nav summary { display: block; padding: .72rem .14rem; color: white; font-size: .875rem; text-decoration: none; }
nav a:hover, nav summary:hover { color: #ffadb9; }
nav summary { list-style: none; }
nav summary::-webkit-details-marker { display: none; }
nav summary::after { content: ""; display: inline-block; height: .38rem; width: .38rem; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); margin: 0 0 .2rem .55rem; }
.nav-sub { position: absolute; right: 0; min-width: 205px; padding: .45rem; background: #222024; border: 1px solid #50454a; border-radius: 6px; }
.nav-sub a { padding-inline: .65rem; }
.menu-toggle { display: none; }
.classroom { white-space: nowrap; font-size: .875rem; }

.hero { color: white; background: radial-gradient(ellipse at 85% 45%, #431820, transparent 49%), #151416; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 78px); padding-block: clamp(36px, 5vw, 72px); }
.hero .eyebrow, #templates .eyebrow { color: #ffabb8; }
.hero h1 { font-size: clamp(2.55rem, 5.1vw, 5rem); letter-spacing: -.025em; }
.hero h1 span { display: block; font-size: .59em; letter-spacing: 0; margin-top: .28em; }
.hero p { color: #e5dfe3; max-width: 47ch; margin-block: 1.3rem; }
.hero-actions, .tabs { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.hero-portrait { background: #241719; border: 1px solid #ffffff35; border-bottom: 4px solid var(--red); border-radius: 10px; overflow: hidden; }
.hero-photo { width: 100%; height: auto; aspect-ratio: 1.18; object-fit: cover; object-position: center top; }

section, .section-group { padding-block: var(--section); }
.section-heading { margin-bottom: clamp(18px, 2.6vw, 34px); }
.section-content > p:first-child { margin-bottom: 1.3rem; max-width: 75ch; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.65vw, 24px); }
.panel { padding: clamp(16px, 2vw, 28px); background: white; border: 1px solid var(--line); border-radius: 8px; }
.panel h3 + p { margin-top: .55rem; }
.section-group > .shell { display: grid; gap: clamp(22px, 4vw, 56px); }
.section-group > .shell > section { padding-block: 0; min-width: 0; }

#courses .section-heading { margin-bottom: .5rem; }
#courses .section-content > p { color: var(--muted); margin-bottom: 1.65rem; }
#courses article { min-width: 0; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
#courses article:target { outline: 3px solid var(--red); outline-offset: 3px; }
#courses article > img, #courses .placeholder { width: 100%; aspect-ratio: 16/9; height: auto; object-fit: contain; background: #161416; }
#courses .placeholder { padding: 1rem; display: grid; place-items: center; color: #fff; text-align: center; font-size: clamp(1.65rem, 2.6vw, 2.7rem); background: linear-gradient(145deg, #201b1e 38%, #460e18 76%, #8a0e25); }
#courses .info { flex: 1; display: flex; flex-direction: column; gap: .78rem; padding: clamp(16px, 1.8vw, 24px); }
#courses .course-fit { border-left: 3px solid var(--red); padding: .6rem .75rem; color: #3f3a41; background: var(--paper); font-size: .9rem; }
#courses details { border-top: 1px solid var(--line); margin-top: auto; }
#courses summary, #partner summary { padding-block: .7rem; color: var(--red-dark); font-weight: 700; }
#courses details p { padding-block: .25rem; }
.course-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.course-actions > * { flex: 1 0 auto; font-size: .875rem; }
#roadmap { background: var(--paper); }
#roadmap .grid { padding: 0; list-style: none; margin: 0; }
#roadmap .panel { border-top: 3px solid var(--red); }
#roadmap .panel h3 { color: var(--red-dark); }
.route-variants { display: inline-block; }
.intro > .shell { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
#about .grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
#about .panel { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding-inline: 0; }
#coach .panel { overflow: hidden; padding: 0; }
.coach-photo { width: 100%; height: auto; aspect-ratio: 1.48; object-fit: cover; object-position: center top; }
.coach-copy { padding: 1rem 1.25rem; }
#templates { color: white; background: radial-gradient(ellipse at 90% 5%, #421620, transparent 58%), #171619; }
#templates .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#templates .panel { color: white; background: #ffffff0c; border-color: #ffffff33; display: flex; flex-direction: column; gap: .75rem; }
#templates .panel .btn { margin-top: auto; align-self: start; }

.activities { background: var(--paper); }
.activities > .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#live { grid-column: 1 / -1; }
.live-schedule { background: #19171b; color: white; border-top: 4px solid var(--red); border-radius: 8px; padding: clamp(14px, 3vw, 36px); }
.live-schedule .grid { gap: 0; margin-block: 1rem; border-block: 1px solid #ffffff35; }
.live-schedule .panel { padding: .8rem .15rem; border: 0; background: none; text-align: center; border-radius: 0; }
.live-schedule .panel + .panel { border-left: 1px solid #ffffff35; }
.times { font-size: clamp(1.7rem, 5vw, 4rem); }
.live-schedule .muted { color: #e5dfe3; }
.tabs { margin-bottom: 1rem; }
.tabs button[aria-pressed="false"] { color: var(--ink); background: white; border-color: #827b82; }
#events .panel .btn { margin-top: .8rem; }
.resources > .shell { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
#knowledge .grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
#knowledge .panel { padding-inline: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
#knowledge .panel p { max-width: 65ch; }
#store { background: #fff1f3; border-top: 3px solid var(--red); padding: clamp(18px, 3vw, 34px); border-radius: 8px; }
#store .btn { margin: 0 .3rem .6rem 0; }
.community-block { padding-top: 0; }
.community-block > .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.community-block > .shell > section { padding: clamp(18px, 3vw, 34px); border-top: 2px solid var(--red); background: var(--paper); }

#partner { background: var(--paper); }
.broker-warning { background: #fff1f3; border-left: 4px solid var(--red); margin-bottom: 1rem; }
#partner .grid { margin-top: 1.2rem; }
#partner article { display: flex; flex-direction: column; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.broker-logo { width: 100%; height: 84px; object-fit: contain; padding: 12px; border-bottom: 1px solid var(--line); }
.broker-name { font-weight: 700; font-size: 1.12rem; padding: 1rem 1rem 0; }
#partner .info { flex: 1; padding: .45rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
#partner .info small { color: var(--red-dark); }
#partner .info h3 { margin-top: .7rem; font-size: 1.15rem; }
#partner .info .broker-account { min-block-size: 3.4em; }
#partner .info .broker-disabled { margin-top: auto; }
#partner .info .muted { margin-block: .25rem; }
#partner .panel:last-child h3:not(:first-child) { margin-top: 1.2rem; }

#contact .shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: clamp(20px, 5vw, 64px); }
#contact .section-content > .panel { background: var(--paper); }
.selection-notice, .kpnotice { background: #fff1f3; border-left: 4px solid var(--red); padding: .8rem 1rem; margin-top: 0; }
form { margin-block: 1.1rem; display: grid; gap: .75rem; }
form label, .kp label { display: block; font-weight: 500; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-height: 44px; margin-top: .35rem; padding: .55rem .7rem; color: var(--ink); border: 1px solid #8a8289; border-radius: 5px; background: white; }
textarea { min-height: 100px; resize: vertical; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #3b3339 50%), linear-gradient(135deg, #3b3339 50%, transparent 50%); background-position: calc(100% - 17px) 53%, calc(100% - 12px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--red); }
form button { justify-self: start; }
.portals { background: #eeebed; }
.portals > .shell { gap: 1.3rem; }
.portals > .shell > section { padding: clamp(16px, 3vw, 38px); border-radius: 8px; background: white; border-top: 3px solid var(--red); }
.portals .section-heading small { color: var(--red-dark); font-weight: 700; letter-spacing: .08em; }
.kp .panel { padding: clamp(12px, 2vw, 22px); }
.kp .panel > button, .kp .panel > label { margin-top: .65rem; }
.student-dashboard > *, #kpadminbody > *, #kpcheckout { margin-top: 1rem; }
.student-stats .panel { background: var(--paper); }
.student-stats h2 { color: var(--red-dark); }
.kpvideo { margin-block: 1rem; min-height: 122px; display: grid; place-items: center; background: #19171b; color: white; border-radius: 6px; padding: 1rem; text-align: center; }
.kp .kpless { display: flex; gap: .6rem; min-height: 44px; align-items: center; padding-block: .3rem; }
#kppermissions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
footer { padding-block: clamp(24px, 4vw, 52px); background: #121114; color: white; }
footer p { max-width: 85ch; color: #e1dce1; margin-top: .55rem; }

@media (max-width: 1080px) {
  .header-inner { justify-content: start; gap: 8px; }
  .brand { margin-right: auto; }
  .menu-toggle { display: inline-flex; background: transparent; border-color: #a29aa0; font-size: .875rem; }
  nav { display: none; position: absolute; inset: 100% 0 auto; max-height: calc(100dvh - 73px); overflow-y: auto; padding: .5rem var(--gutter) 1rem; background: #1c191d; }
  nav.is-open { display: block; }
  nav a, nav summary { min-height: 44px; }
  .nav-sub { position: static; }
  #courses .grid, #partner .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 74px; }
  .header-inner { min-height: 62px; }
  .brand { font-size: clamp(.64rem, 3vw, .92rem); letter-spacing: .015em; }
  .classroom, .menu-toggle { padding-inline: .52rem; }
  nav { max-height: calc(100dvh - 63px); }
  .hero-inner { grid-template-columns: 1fr; gap: 22px; }
  .hero-photo { aspect-ratio: 1.46; }
  .hero .eyebrow { font-size: .75rem; }
  .hero p { margin-block: 1rem; }
  .grid, #courses .grid, #partner .grid, #contact .shell,
  .section-group > .shell, #kppermissions { grid-template-columns: 1fr; }
  #templates .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-schedule .grid, .student-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .student-stats { grid-template-columns: 1fr; }
  #partner .info .broker-account { min-block-size: 0; }
  #contact .section-heading { margin-bottom: 0; }
}
@media (max-width: 380px) {
  #templates .grid { grid-template-columns: 1fr; }
}

/* Keep natural Thai breaks and improve short final lines. */
h1, h2, h3, .placeholder, .course-fit, .selection-notice { text-wrap: balance; }
p, li, #camp .panel, #community .panel, #charity .panel, #past { text-wrap: pretty; }
.hero p { max-width: 52ch; text-wrap: balance; }
.broker-warning p, #partner .section-content > .panel:last-child p { max-width: 78ch; }
#partner article { overflow-wrap: normal; }
#partner .info .muted { overflow-wrap: anywhere; }
#courses .course-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
  aspect-ratio: 16/9;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #161417 34%, #620e1d);
}
.course-cover-title {
  align-self: center;
  margin-inline: clamp(12px, 2vw, 26px);
  padding-top: .6rem;
  border-top: 3px solid #ed4058;
  font: 500 clamp(1.18rem, 2.4vw, 2.05rem)/1.2 var(--heading);
  text-wrap: balance;
}
.course-cover img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center top;
  background: white;
}
#templates .tools-catalog { margin: 0; padding: 0; list-style: none; }
#templates .tool-card { min-width: 0; min-height: 134px; justify-content: center; border-top: 3px solid #d4203b; }
#templates .tool-card h3 { font-size: clamp(1.3rem, 2vw, 1.75rem); }
#templates .tool-card p { margin: 0; color: #eee7ea; }
#templates .tool-preview { width: 100%; aspect-ratio: 16/9; object-fit: contain; border-radius: 5px; background: #141215; }
@media (max-width: 860px) {
  #templates .tools-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  #templates .tools-catalog { grid-template-columns: minmax(0, 1fr); }
  #templates .tool-card { min-height: 104px; }
}
