/*!
 * IFMSA-Thailand — official website
 * Built and maintained by Victor (Wachirawit Angkatavanich), VPAO 2026/27
 *
 * BRAND
 * The identity is "กนกนาครา" (Kanoknagara) — from กนก (kanok, gold) and
 * นาคา (naga, serpent). The mark adapts IFMSA's Rod-of-Asclepius serpent
 * and gives it Thai identity: the naga wears gold ornaments, framed by
 * kanok patterning and a gold half-circle for unity.
 *
 * Its two official colours, per the organisation's own logo concept
 * document: BLUE — IFMSA's colour, the parent federation — and GOLD,
 * for prosperity and light, "richness in people and knowledge that
 * benefits society."
 *
 * --navy #203b69 is sampled directly from the official logo file, so it
 * is exact. --gold has no published hex in the brand materials; the value
 * below is chosen to match traditional Thai kanok gold and should be
 * confirmed with VPPR.
 */

/* ---------- tokens ---------- */
:root {
  --navy:        #203b69;  /* exact, sampled from the official logo */
  --navy-deep:   #16294a;
  --navy-bright: #35619f;
  --gold:        #c8a44d;  /* provisional — confirm with VPPR */
  --gold-soft:   #e6d3a3;
  --ink:         #101828;
  --ink-soft:    #4a5568;
  --ink-faint:   #8a94a6;
  --paper:       #ffffff;
  --paper-tint:  #f7f8fb;
  --line:        #e3e7ef;
  --radius:      14px;
  --wrap:        1180px;
  --ease:        cubic-bezier(.22,.75,.24,1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy:        #7ba5e0;
    --navy-deep:   #0a1220;
    --navy-bright: #9dc0ef;
    --gold:        #d9bd6f;
    --gold-soft:   #4a3d1c;
    --ink:         #e9edf5;
    --ink-soft:    #a8b3c7;
    --ink-faint:   #6b7689;
    --paper:       #0a111d;
    --paper-tint:  #111a29;
    --line:        #1e2940;
  }
}
:root[data-theme="dark"] {
  --navy:        #7ba5e0;
  --navy-deep:   #0a1220;
  --navy-bright: #9dc0ef;
  --gold:        #d9bd6f;
  --gold-soft:   #4a3d1c;
  --ink:         #e9edf5;
  --ink-soft:    #a8b3c7;
  --ink-faint:   #6b7689;
  --paper:       #0a111d;
  --paper-tint:  #111a29;
  --line:        #1e2940;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Public Sans', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', sans-serif;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .88em;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--navy-bright); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 18px;
}
.eyebrow-light { color: rgba(255,255,255,.75); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 15px;
  padding: 14px 26px; border-radius: 100px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .25s var(--ease), background .2s, border-color .2s, box-shadow .25s;
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 18px -6px rgba(26,67,123,.55); }
.btn-primary:hover { background: var(--navy-deep); transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(26,67,123,.6); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; background: var(--navy); color: #fff; }
.btn-sm:hover { background: var(--navy-deep); }
.btn-full { width: 100%; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 72px; }

.brand { display: flex; align-items: center; gap: 11px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; flex: none; object-fit: contain; }
:root[data-theme="dark"] .brand-mark,
.brand-mark.on-dark { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-mark { filter: brightness(0) invert(1); }
}
.brand-dash { color: var(--gold); margin: 0 1px; }

.nav-links { display: flex; gap: 30px; margin-left: auto; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.nav-links a { position: relative; padding: 4px 0; transition: color .2s; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--navy); transition: right .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
.nav-toggle span + span { margin-top: 5px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-inner .btn-sm { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 108px 0 96px; overflow: hidden; }
.hero-glow {
  position: absolute; top: -280px; right: -180px; width: 780px; height: 780px; z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--navy) 16%, transparent) 0%, transparent 68%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }

.hero-title { font-size: clamp(40px, 6.6vw, 78px); font-weight: 800; max-width: 17ch; }
.hero-title .l { display: block; }
.hero-lede { font-size: clamp(17px, 1.9vw, 20px); color: var(--ink-soft); max-width: 60ch; margin-top: 28px; }
.hero-actions { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }

/* ---------- stats ---------- */
.stats { padding: 8px 0 76px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
@media (max-width: 460px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-num {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: clamp(34px, 4vw, 50px); color: var(--navy);
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1;
}
.stat-label { font-size: 14.5px; color: var(--ink-soft); margin-top: 10px; max-width: 22ch; }

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--paper-tint); }
.section-head { max-width: 62ch; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(30px, 3.9vw, 46px); font-weight: 800; }
.section-lede { color: var(--ink-soft); margin-top: 20px; font-size: 17px; }

/* ---------- committees ---------- */
.committee-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
@media (max-width: 1000px) { .committee-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .committee-grid { grid-template-columns: 1fr; } }

.committee {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 30px 24px 26px; min-height: 210px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.committee::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--navy-bright));
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.committee:hover { transform: translateY(-5px); box-shadow: 0 18px 40px -20px rgba(16,24,40,.28); border-color: transparent; }
.committee:hover::before { transform: scaleX(1); }
.committee h3 { font-size: 25px; font-weight: 800; color: var(--navy); }
.committee p { font-size: 14.5px; color: var(--ink-soft); flex: 1; }
.committee-go { font-size: 14px; font-weight: 600; color: var(--navy); }
.committee-go::after { content: ' →'; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .committee:hover { transform: none; } }

/* ---------- exchange ---------- */
.exchange-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .exchange-grid { grid-template-columns: 1fr; } }
.exchange-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 38px 34px; display: flex; flex-direction: column; gap: 18px;
}
.exchange-card h3 { font-size: 34px; font-weight: 800; color: var(--navy); }
.exchange-full { font-size: 13.5px; color: var(--ink-faint); font-weight: 500; margin-top: 4px; }
.exchange-card > p { color: var(--ink-soft); font-size: 15.5px; }
.lc-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.lc-chips span {
  font-size: 12.5px; font-weight: 600; color: var(--navy);
  background: color-mix(in srgb, var(--navy) 7%, transparent);
  border-radius: 100px; padding: 5px 12px;
}

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: s; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 2px solid var(--line); transition: border-color .3s; }
.step:hover { border-top-color: var(--navy); }
.step-n { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 800; color: var(--navy); letter-spacing: .08em; }
.step h3 { font-size: 19px; font-weight: 700; }
.step p { font-size: 14.5px; color: var(--ink-soft); }
.inline-link { font-size: 14.5px; font-weight: 600; color: var(--navy); border-bottom: 1.5px solid color-mix(in srgb, var(--navy) 35%, transparent); align-self: flex-start; transition: border-color .2s; }
.inline-link:hover { border-bottom-color: var(--navy); }

/* ---------- verify ---------- */
.verify { padding: 96px 0; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; }
.verify-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
@media (max-width: 880px) { .verify-inner { grid-template-columns: 1fr; gap: 40px; } }
.verify h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; }
.verify-copy p { color: rgba(255,255,255,.8); margin-top: 18px; max-width: 46ch; }
.verify-form { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); padding: 30px; backdrop-filter: blur(6px); }
.verify-form label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 8px; }
.verify-form input {
  width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  border-radius: 9px; padding: 13px 15px; color: #fff; font-size: 15.5px; font-family: inherit; margin-bottom: 20px;
}
.verify-form input::placeholder { color: rgba(255,255,255,.45); }
.verify-form input:focus { outline: none; border-color: #fff; background: rgba(255,255,255,.16); }
.verify-form .btn-primary { background: #fff; color: var(--navy); box-shadow: none; }
.verify-form .btn-primary:hover { background: rgba(255,255,255,.9); }
.verify-note { font-size: 12.5px; color: rgba(255,255,255,.6); margin-top: 14px; text-align: center; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; }
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about-grid h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.about-body { display: flex; flex-direction: column; gap: 20px; color: var(--ink-soft); }

/* ---------- footer ---------- */
.footer { background: var(--paper-tint); border-top: 1px solid var(--line); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
.footer-brand .brand-text { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 17px; }
.footer-brand p { font-size: 14px; color: var(--ink-soft); margin-top: 10px; max-width: 30ch; }
.footer-col h4 { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 15px; color: var(--ink-soft); padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--navy); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-faint);
}

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .75s var(--ease), transform .75s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- interior page header ---------- */
.page-head { padding: 88px 0 56px; border-bottom: 1px solid var(--line); position: relative; }
.page-head::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 96px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
}
.page-title { font-size: clamp(36px, 5.2vw, 62px); font-weight: 800; max-width: 18ch; }
.page-lede { font-size: clamp(16px, 1.8vw, 19px); color: var(--ink-soft); max-width: 58ch; margin-top: 24px; }

/* ---------- prose layout ---------- */
.prose-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; }
@media (max-width: 880px) { .prose-grid { grid-template-columns: 1fr; gap: 24px; } }
.prose-side h2 { font-size: clamp(24px, 2.8vw, 34px); font-weight: 800; position: sticky; top: 100px; }
@media (max-width: 880px) { .prose-side h2 { position: static; } }
.prose { display: flex; flex-direction: column; gap: 20px; color: var(--ink-soft); font-size: 16.5px; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- EB role grid ---------- */
.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 980px) { .role-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .role-grid { grid-template-columns: 1fr; } }
.role { padding: 24px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: border-color .3s, transform .3s var(--ease); }
.role:hover { border-color: var(--gold); transform: translateY(-3px); }
.role h3 { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.role p { font-size: 14px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .role:hover { transform: none; } }

/* ---------- CTA band ---------- */
.cta-band { background: var(--navy); color: #fff; padding: 68px 0; position: relative; overflow: hidden; }
.cta-band::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-soft) 50%, var(--gold) 100%);
}
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-inner h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; }
.cta-inner p { color: rgba(255,255,255,.78); margin-top: 12px; max-width: 46ch; }
.cta-band .btn-primary { background: var(--gold); color: var(--navy-deep); box-shadow: none; }
.cta-band .btn-primary:hover { background: var(--gold-soft); }

/* ---------- gold accents, used sparingly ---------- */
.eyebrow { position: relative; padding-left: 26px; }
.eyebrow::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 16px; height: 2px;
  background: var(--gold); transform: translateY(-50%);
}
.eyebrow-light::before { background: var(--gold); }
.hero-glow {
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 12%, transparent) 0%, transparent 66%);
}
.stat-num { position: relative; }
.section-head h2::after,
.hero-title::after { content: none; }
.committee h3 { color: var(--navy); }
.committee::before { background: linear-gradient(90deg, var(--navy), var(--gold)); }
.exchange-card { border-top: 3px solid var(--gold); }
.step:hover { border-top-color: var(--gold); }
.verify-form .btn-primary { background: var(--gold); color: var(--navy-deep); }
.verify-form .btn-primary:hover { background: var(--gold-soft); }
