@charset "UTF-8";
/* =========================================================
   วท.บ. (คณิตศาสตร์) 2569 — Corporate Bold Theme
   white topbar · black diagonal hero · red diagonal band
   ========================================================= */

:root {
  --red: #c8102e;
  --red-deep: #8f0b20;
  --red-dark: #6e0817;
  --red-wash: #fbe9ec;
  --gold: #e0922a;
  --gold-wash: #fcf0d8;
  --orange: #ef6c2e;
  --orange-wash: #fdeae0;
  --pink: #e0457e;
  --pink-wash: #fbe6ee;
  --teal: #0fa3a3;
  --teal-wash: #ddf3f3;
  --black: #141414;
  --black-soft: #1f1f1f;
  --gray-bg: #f5f5f6;
  --ink: #1d1d1f;
  --ink-soft: #55555c;
  --ink-faint: #8b8b93;
  --line: #e3e3e6;
  --line-strong: #c9c9cf;
  --font-display: "Prompt", sans-serif;
  --font-body: "Anuphan", sans-serif;
  --font-mono: var(--font-display); /* alias → Prompt · ระบบ 2 ฟอนต์ */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #fff;
  color: var(--ink);
  line-height: 1.75;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: #fff; }

a { color: var(--red); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}
.progbar { background: var(--black); }
.progbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 6px 24px;
  display: flex; gap: 20px; align-items: center; justify-content: flex-end;
  font-size: 14px; flex-wrap: wrap;
}
.progbar-label { color: #77777e; font-family: var(--font-display); }
.progbar a {
  color: #c9c9cf; text-decoration: none;
  font-family: var(--font-display); font-weight: 500;
  transition: color 0.2s;
}
.progbar a:hover { color: #fff; }
.progbar a.active { color: #ff8298; border-bottom: 2px solid var(--red); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px;
  max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  display: grid; place-items: center;
  transform: skewX(-8deg);
  border-radius: 10px;
}
.brand-mark span { transform: skewX(8deg); }
.brand-text { line-height: 1.3; }
.brand-text strong {
  display: block; font-size: 16.5px; font-weight: 700;
  font-family: var(--font-display); color: var(--red);
  letter-spacing: 0.01em;
}
.brand-text span { font-size: 13px; color: var(--ink-soft); }
.topnav { display: flex; gap: 2px; flex-wrap: wrap; }
.topnav a {
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display);
  font-size: 15.5px; font-weight: 500;
  padding: 8px 14px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.topnav a:hover { color: var(--red); border-bottom-color: var(--red); }

/* hamburger toggle — hidden on desktop, shown ≤760px */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 46px; height: 44px; flex: none;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  display: block; width: 24px; height: 2.5px; border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- hero (black, diagonal) ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(118deg, #0c0c0c 0%, #161616 46%, #2a2a2c 46.2%, #1b1b1d 72%, #232325 72.2%, #131315 100%);
  color: #fff;
  overflow: hidden;
}
/* breathing red glow (top-right, behind the art) */
.hero::before {
  content: ""; position: absolute;
  right: -180px; top: -240px;
  width: 740px; height: 740px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.3), transparent 62%);
  animation: heroglow 7s ease-in-out infinite alternate;
  pointer-events: none;
}
/* faint dot grid, fading in toward the art side */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(115deg, transparent 32%, #000 78%);
  mask-image: linear-gradient(115deg, transparent 32%, #000 78%);
  pointer-events: none;
}
@keyframes heroglow {
  from { opacity: 0.55; transform: scale(0.92); }
  to   { opacity: 1;    transform: scale(1.05); }
}
.hero-formulas {
  position: absolute; inset: 0;
  pointer-events: none; user-select: none;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.09);
}
.hero-formulas span {
  position: absolute; white-space: nowrap;
  animation: ffloat 9s ease-in-out infinite alternate;
}
@keyframes ffloat {
  from { transform: translateY(-9px); }
  to   { transform: translateY(11px); }
}
.hero-art {
  position: absolute;
  right: -30px; top: 50%;
  transform: translateY(-50%);
  width: min(48vw, 580px); height: auto;
  pointer-events: none; user-select: none;
  filter: drop-shadow(0 0 22px rgba(200, 16, 46, 0.22));
}
@media (max-width: 880px) { .hero-art { display: none; } }
.hero-inner {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(54px, 7vw, 96px) 24px clamp(30px, 4vw, 54px);
}
.hero-kicker {
  font-family: var(--font-display);
  font-size: clamp(17.5px, 2vw, 22px);
  font-weight: 500;
  color: #d8d8dc;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(39.5px, 5.6vw, 68px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--red);
  text-shadow: 0 0 42px rgba(200, 16, 46, 0.5);
  margin: 4px 0 14px;
}
.hero h1 small {
  display: block;
  font-size: clamp(22px, 2.6vw, 33px);
  font-weight: 600;
  color: #fff;
  text-shadow: none;
}
.hero-sub { max-width: 600px; color: #c9c9cf; font-size: 17.5px; }
.hero-deg {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 14px; color: #a6a6ae; letter-spacing: 0.08em;
}
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
/* staggered entrance */
.hero-kicker { animation: rise 0.8s var(--ease) backwards; }
.hero h1     { animation: rise 0.8s var(--ease) 0.08s backwards; }
.hero-sub    { animation: rise 0.8s var(--ease) 0.16s backwards; }
.hero-deg    { animation: rise 0.8s var(--ease) 0.24s backwards; }
.hero-cta    { animation: rise 0.8s var(--ease) 0.32s backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 16.5px; font-weight: 600;
  padding: 11px 26px; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.2s;
}
.btn-primary {
  background: #fff; color: var(--ink);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}
.btn-primary .dot {
  width: 26px; height: 26px; flex: none;
  background: var(--red); color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15.5px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
.btn-primary:hover .dot { animation: dotnudge 0.55s var(--ease); }
@keyframes dotnudge { 50% { transform: translateY(4px); } }
.btn-ghost { border: 1px solid #5a5a60; color: #e6e6ea; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

/* ---------- icon band (in dark hero) ---------- */
.icon-band {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 880px;
  margin: clamp(28px, 4vw, 50px) auto 0;
  padding: 6px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}
/* full-bleed dark wash: evens out the diagonal facets behind the band
   and eases the hero into the black half of the slash below */
.icon-band::before {
  content: ""; position: absolute;
  left: 50%; transform: translateX(-50%);
  top: -34px; bottom: 0; width: 100vw;
  background: linear-gradient(to bottom,
    rgba(13, 13, 14, 0) 0%,
    rgba(13, 13, 14, 0.55) 55%,
    rgba(17, 17, 18, 0.95) 100%);
  pointer-events: none;
}
.icon-cell {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-family: var(--font-display);
  font-size: 15.5px; font-weight: 600;
  padding: 14px 6px 18px;
  transition: transform 0.25s var(--ease), color 0.2s;
  animation: rise 0.7s var(--ease) backwards;
}
.icon-band .icon-cell:nth-child(1) { animation-delay: 0.38s; }
.icon-band .icon-cell:nth-child(2) { animation-delay: 0.44s; }
.icon-band .icon-cell:nth-child(3) { animation-delay: 0.5s; }
.icon-band .icon-cell:nth-child(4) { animation-delay: 0.56s; }
.icon-band .icon-cell:nth-child(5) { animation-delay: 0.62s; }
.icon-band .icon-cell:nth-child(6) { animation-delay: 0.68s; }
.icon-cell::after {
  content: ""; position: absolute; bottom: 9px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2.5px; border-radius: 2px;
  background: #ff6b85;
  transition: width 0.25s var(--ease);
}
.icon-cell:hover::after { width: 28px; }
.icon-cell svg { width: 46px; height: 46px; stroke: #fff; transition: stroke 0.2s, filter 0.25s; }
.icon-cell:hover { transform: translateY(-4px); color: #ff8298; }
.icon-cell:hover svg { stroke: #ff8298; filter: drop-shadow(0 0 8px rgba(255, 107, 133, 0.55)); }

/* ---------- red diagram band ---------- */
.diagram-band {
  background: linear-gradient(160deg, #d81b39 0%, var(--red) 45%, #a50d22 75%, var(--red-deep) 100%);
  color: #fff;
  padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px);
  position: relative; overflow: hidden;
}
/* faint diagonal hairlines over the red */
.diagram-band::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg,
    rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 90px);
  pointer-events: none;
}
/* big soft ring, bottom-left */
.diagram-band::after {
  content: ""; position: absolute;
  left: -170px; bottom: -240px;
  width: 540px; height: 540px; border-radius: 50%;
  border: 58px solid rgba(255, 255, 255, 0.055);
  pointer-events: none;
}
.diagram-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.hero-art .draw {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: figdraw 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.5s;
}
@keyframes figdraw { to { stroke-dashoffset: 0; } }
/* glowing data points */
.hero-art .pulse {
  transform-box: fill-box; transform-origin: center;
  animation: nodepulse 2.8s ease-in-out infinite;
}
@keyframes nodepulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.5); }
}
/* expanding ring ping */
.hero-art .ring {
  transform-box: fill-box; transform-origin: center;
  animation: ringping 3.2s ease-out infinite;
}
@keyframes ringping {
  0%        { transform: scale(0.4); opacity: 0.9; }
  70%, 100% { transform: scale(1.8); opacity: 0; }
}
/* histogram bars rising from the axis */
.hero-art .grow {
  transform-box: fill-box; transform-origin: center bottom;
  animation: bargrow 1s var(--ease) backwards;
}
@keyframes bargrow { from { transform: scaleY(0); } }
/* scatter dots popping in */
.hero-art .pop {
  transform-box: fill-box; transform-origin: center;
  animation: dotpop 0.55s var(--ease) backwards;
}
@keyframes dotpop { from { opacity: 0; transform: scale(0); } }
/* slowly rotating blueprint ring */
.hero-art .spin {
  transform-box: fill-box; transform-origin: center;
  animation: artspin 90s linear infinite;
}
@keyframes artspin { to { transform: rotate(360deg); } }

.donut-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#donutChart { width: min(330px, 76vw); height: auto; }
.donut-track {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  color: #ffd2d9;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 4px 8px;
}
.donut-track:not(:has(.dt-arrow)) { padding: 5px 16px; }
.dt-arrow {
  width: 26px; height: 26px; flex: none;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 17px; line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.18s var(--ease);
}
.dt-arrow:hover { background: #fff; color: var(--red-deep); transform: scale(1.08); }
.dt-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.donut-legend {
  list-style: none;
  margin: 22px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px 26px;
}
.donut-legend li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #ffe3e7; }
.donut-legend i { width: 12px; height: 12px; flex: none; border-radius: 4px; }
.donut-legend span { flex: 1; min-width: 0; }
.donut-legend b { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }
@media (max-width: 560px) { .donut-legend { grid-template-columns: 1fr; } }
.diagram-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(28.5px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.diagram-copy .dc-sub {
  font-family: var(--font-display);
  font-size: clamp(16.5px, 1.8vw, 20px);
  font-weight: 500;
  color: #ffd2d9;
  margin-bottom: 18px;
}
.diagram-copy p { font-size: 17px; color: #ffe3e7; }
.diagram-copy .btn { margin-top: 24px; }
.diagram-copy .btn-white {
  background: #fff; color: var(--red-deep);
}
.diagram-copy .btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }

/* ---------- sections ---------- */
section { padding: clamp(56px, 8vw, 100px) 0; }
section.alt {
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30"><path d="M15 11v8M11 15h8" stroke="%23c8102e" stroke-opacity="0.055" stroke-width="1.4"/></svg>')
    var(--gray-bg);
}

.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 12px; }
/* when a section has no description, keep rhythm before its content grid */
.sec-head + .careers-grid,
.sec-head + .contact-grid,
.sec-head + .tracks-grid,
.sec-head + #ploGroups { margin-top: 34px; }
.sec-head::before {
  content: ""; flex: none; align-self: center;
  width: 13px; height: 32px;
  background: linear-gradient(165deg, #e0264a, var(--red-deep));
  transform: skewX(-12deg);
  border-radius: 4px;
  box-shadow: 2px 3px 0 var(--red-wash);
}
.sec-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(27.5px, 3.6vw, 39.5px);
  color: var(--ink);
  line-height: 1.3;
}
.sec-head::after { content: ""; flex: 1; height: 3px; background: linear-gradient(90deg, var(--red), var(--gold)); align-self: center; max-width: 120px; }
.sec-desc { color: var(--ink-soft); max-width: 680px; margin-bottom: 38px; }

/* ---------- track cards ---------- */
.tracks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.track-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 28px 26px 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  overflow: hidden;
}
.track-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, var(--tw, var(--red-wash)), transparent 58%);
  opacity: 0; transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.track-card:hover::before { opacity: 1; }
.track-card > * { position: relative; }
.track-card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12); }
.tracks-grid .track-card:nth-child(3n+2) { --tw: var(--gold-wash); }
.tracks-grid .track-card:nth-child(3n+3) { --tw: var(--teal-wash); }
.tracks-grid .track-card:nth-child(3n+1) { border-top-color: var(--red); }
.tracks-grid .track-card:nth-child(3n+2) { border-top-color: var(--gold); }
.tracks-grid .track-card:nth-child(3n+3) { border-top-color: var(--teal); }
.track-card .t-no {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 61.5px; line-height: 1;
  color: var(--red-wash);
  -webkit-text-stroke: 1.5px var(--red);
  position: absolute; top: 14px; right: 18px;
}
.track-card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink); margin-bottom: 2px; padding-right: 52px; }
.track-card .t-en { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); letter-spacing: 0.04em; }
.track-card p { font-size: 16px; color: var(--ink-soft); margin-top: 12px; line-height: 1.7; }
.track-card .t-meta {
  display: flex; gap: 14px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14.5px; color: var(--ink-soft);
}
.track-card .t-meta b { color: var(--red); font-weight: 700; }
.tracks-note {
  border-radius: var(--radius-sm);
  margin-top: 24px; font-size: 16px; color: var(--ink-soft);
  background: var(--red-wash);
  border-left: 4px solid var(--red);
  padding: 12px 18px;
}

/* ---------- pills ---------- */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.pill {
  font-family: var(--font-display); font-size: 15.5px; font-weight: 600;
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft);
  padding: 10px 22px; border-radius: 999px; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.pill:hover { border-color: var(--red); color: var(--red); }
.pill.active {
  background: linear-gradient(135deg, #e0264a, var(--red) 55%, var(--red-deep));
  color: #fff;
  border-color: var(--red-deep);
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.35);
}

/* ---------- credit bar ---------- */
.credit-bar-box { margin-bottom: 38px; }
.credit-total { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.credit-total .big {
  font-family: var(--font-display); font-weight: 700;
  font-size: 46px; color: var(--red); line-height: 1;
}
.credit-total .cap { font-size: 16px; color: var(--ink-soft); }
.credit-bar {
  display: flex; width: 100%; height: 56px;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1);
}
.credit-seg {
  position: relative;
  display: grid; place-items: center;
  transition: width 0.6s var(--ease);
  cursor: pointer;
  min-width: 0;
}
.credit-seg span {
  font-family: var(--font-mono); font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden;
}
.credit-seg.s-ge { background: var(--red-deep); color: #ffe3ea; }
.credit-seg.s-core { background: var(--gold); color: #3a2600; }
.credit-seg.s-comp { background: var(--red); color: #ffeef1; }
.credit-seg.s-elec { background: var(--orange); color: #46190a; }
.credit-seg.s-cap { background: var(--pink); color: #fff; }
.credit-seg.s-free { background: var(--teal); color: #04302f; }
.credit-seg:hover { filter: brightness(1.1); }
.credit-legend { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 14px; font-size: 15px; color: var(--ink-soft); }
.credit-legend i { width: 11px; height: 11px; display: inline-block; margin-right: 7px; vertical-align: baseline; border-radius: 3.5px; }

/* ---------- structure accordion ---------- */
.acc { background: #fff; box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08); border-radius: var(--radius-lg); overflow: hidden; }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-item { border-left: 4px solid transparent; transition: border-color 0.25s; }
.acc-item.open { border-left-color: var(--red); }
.acc-head {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 16px;
  padding: 19px 22px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
}
.acc-head:hover { background: var(--red-wash); }
.acc-head .a-idx { font-family: var(--font-mono); font-size: 13px; color: var(--red); flex: none; width: 28px; }
.acc-head .a-title { font-family: var(--font-display); font-size: 17.5px; font-weight: 600; color: var(--ink); flex: 1; }
.acc-head .a-title small { display: block; font-family: var(--font-body); font-size: 14.5px; font-weight: 400; color: var(--ink-faint); }
.acc-head .a-cr {
  font-family: var(--font-mono); font-size: 14.5px;
  color: var(--red); font-weight: 600;
  white-space: nowrap;
}
.acc-head .a-arrow {
  flex: none; width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--red);
  transition: transform 0.3s var(--ease);
}
.acc-item.open .a-arrow { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
.acc-inner { padding: 4px 22px 24px; }
.subgroup { margin-top: 18px; }
.subgroup-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600; color: var(--ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--red);
  margin-bottom: 4px;
}
.subgroup-head .sg-cr { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--red); white-space: nowrap; }
.subgroup-note { font-size: 14.5px; color: var(--ink-faint); margin: 6px 0 2px; }

/* ---------- course rows ---------- */
.course-list { list-style: none; }
.course-row {
  display: flex; gap: 14px; align-items: baseline;
  padding: 9px 6px;
  border-bottom: 1px solid #f0f0f2;
  transition: background 0.15s;
}
.course-row:hover { background: var(--red-wash); }
.course-row .c-code {
  font-family: var(--font-mono); font-size: 14.5px;
  color: var(--red); font-weight: 600;
  flex: none; width: 64px;
}
.course-row .c-name { flex: 1; font-size: 16px; min-width: 0; }
.course-row .c-name small { display: block; font-size: 13px; color: var(--ink-faint); font-family: var(--font-body); letter-spacing: 0.01em; }
.course-row .c-cr { font-family: var(--font-mono); font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.course-row.is-elective .c-code, .course-row.is-free .c-code { color: var(--ink-faint); }
.course-row.is-noncredit { opacity: 0.6; }
.course-row.has-desc { cursor: pointer; border-radius: var(--radius-sm); }
.course-row.has-desc:hover { background: var(--red-wash); }
.course-row.has-desc:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.c-info {
  font-style: normal; color: var(--red);
  font-size: 14.5px; margin-left: 7px;
  opacity: 0; transition: opacity 0.18s;
  vertical-align: 1px;
}
.course-row.has-desc:hover .c-info,
.course-row.has-desc:focus-visible .c-info { opacity: 0.9; }
@media (hover: none) { .c-info { opacity: 0.55; } }

/* ---------- ไฮไลต์วิชาบังคับก่อน (รายวิชาที่วิชาถัดไปใช้เป็นบังคับก่อน) ---------- */
.course-row.is-prereq {
  background: linear-gradient(90deg, var(--gold-wash), rgba(252, 240, 216, 0) 88%);
  box-shadow: inset 3px 0 0 var(--gold);
  border-radius: var(--radius-sm);
}
.course-row.is-prereq:hover,
.course-row.is-prereq.has-desc:hover {
  background: linear-gradient(90deg, #f9e3ba, rgba(249, 227, 186, 0) 88%);
}
.course-row.is-prereq.has-desc:focus-visible { outline-color: var(--gold); }
.c-key {
  font-style: normal; font-size: 12.5px; line-height: 1;
  margin-left: 6px; vertical-align: 1px; cursor: help;
}
.prereq-legend {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 16px; padding: 9px 13px;
  font-family: var(--font-body); font-size: 13.5px; line-height: 1.55; color: var(--ink-soft);
  background: linear-gradient(90deg, var(--gold-wash), rgba(252, 240, 216, 0));
  border-left: 3px solid var(--gold); border-radius: var(--radius-sm);
}
.prereq-legend .c-key { font-size: 16px; margin-left: 0; cursor: default; flex: none; }
.prereq-legend b { color: var(--gold); font-weight: 700; }
.prereq-legend span { flex: 1; }

/* ---------- modal: วิชานี้เป็นบังคับก่อนของวิชาใดบ้าง ---------- */
.cm-unlocks {
  margin-top: 12px; font-size: 15.5px; color: var(--ink-soft);
  background: var(--gold-wash); border-radius: var(--radius-sm); padding: 10px 16px;
}
.cm-unlocks .cm-lbl { color: var(--gold); border-bottom-color: #f3dcae; }
.cm-unlocks-val { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 8px; }
.cm-unlocks-val b { font-family: var(--font-mono); font-size: 14.5px; color: var(--gold); font-weight: 600; }
.cm-unlocks-val .pre-link { border-bottom-color: var(--gold); }
.cm-unlocks-val .pre-link:hover { background: #f3dcae; }

/* ---------- course modal ---------- */
.cmodal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.cmodal[hidden] { display: none; }
.cmodal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 12, 12, 0.55);
  backdrop-filter: blur(3px);
  animation: cmfade 0.2s ease;
}
.cmodal-panel {
  position: relative;
  background: #fff;
  width: min(640px, 100%);
  max-height: 86vh; overflow-y: auto;
  border-radius: var(--radius-lg);
  border-top: 5px solid var(--red);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 30px 34px 34px;
  animation: cmpop 0.26s var(--ease);
}
@keyframes cmfade { from { opacity: 0; } }
@keyframes cmpop { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.cmodal-x {
  position: absolute; top: 16px; right: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--gray-bg); color: var(--ink-soft);
  font-size: 24px; line-height: 1; cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.cmodal-x:hover { background: var(--red); color: #fff; }
.cm-code {
  display: inline-block;
  font-family: var(--font-mono); font-size: 14.5px; font-weight: 600;
  color: var(--red); background: var(--red-wash);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 14px;
}
.cm-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.cm-en { font-family: var(--font-body); font-size: 14.5px; color: var(--ink-faint); margin-top: 2px; }
.cm-pre {
  margin-top: 16px; font-size: 15.5px; color: var(--ink-soft);
  background: var(--gray-bg); border-radius: var(--radius-sm); padding: 10px 16px;
}
.cm-pre .cm-lbl { border-bottom: none; padding-bottom: 4px; }
.cm-pre-val b { font-family: var(--font-mono); font-size: 14.5px; color: var(--red); font-weight: 600; }
.pre-link { cursor: pointer; border-bottom: 1px dashed var(--red); transition: background 0.15s; border-radius: 3px; }
.pre-link:hover { background: var(--red-wash); }
.cm-body { margin-top: 20px; display: grid; gap: 18px; }
.cm-desc p { font-size: 16.5px; line-height: 1.85; color: var(--ink); margin-top: 4px; }
.cm-desc:last-child p { color: var(--ink-soft); }
.cm-lbl {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--red); display: block;
  padding-bottom: 6px; border-bottom: 2px solid var(--red-wash);
}
.cm-plo-list { list-style: none; margin-top: 12px; display: grid; gap: 10px; }
.cm-plo-list li { display: flex; gap: 12px; align-items: baseline; }
.cm-plo-id {
  flex: none; min-width: 52px; text-align: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: #fff; background: var(--ink-soft);
  padding: 3px 9px; border-radius: 999px;
}
.cm-plo-id.d-k { background: var(--red); }
.cm-plo-id.d-s { background: var(--teal); }
.cm-plo-id.d-e { background: var(--gold); }
.cm-plo-id.d-ch { background: #4f9d4a; }
.cm-plo-txt { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); }
.cm-plo-tag {
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--red-wash); color: var(--red-deep);
  padding: 1px 8px; border-radius: 999px; margin-left: 4px;
}
.tag {
  font-size: 13px; font-weight: 600; padding: 1px 8px;
  border-radius: 999px; margin-left: 8px; white-space: nowrap;
  background: var(--red-wash); color: var(--red-deep);
  vertical-align: middle;
}

/* ---------- study plan ---------- */
.plan-years { display: grid; gap: 26px; }
.plan-year { background: #fff; box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08); border-radius: var(--radius-lg); overflow: hidden; }
.plan-year-head {
  display: flex; align-items: center; gap: 16px;
  background: var(--black); color: #fff;
  padding: 13px 22px;
  position: relative; overflow: hidden;
}
.plan-year-head::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0;
  width: 120px;
  background: linear-gradient(115deg, transparent 40%, var(--red) 40.3%);
}
.plan-year-head .py-num { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; }
.plan-year-head .py-lbl { font-size: 15px; opacity: 0.75; }
.plan-year-head .py-cr { margin-left: auto; font-family: var(--font-mono); font-size: 14px; position: relative; z-index: 1; padding-right: 6px; }
.plan-sems { display: grid; grid-template-columns: 1fr 1fr; }
.plan-sem { padding: 20px 22px 24px; border-radius: var(--radius-md); }
.plan-sem.sem-flash { animation: semflash 2.2s var(--ease); }
@keyframes semflash {
  0%   { background: var(--sycw, var(--red-wash)); box-shadow: inset 0 0 0 2px var(--syc, var(--red)); }
  45%  { background: var(--sycw, var(--red-wash)); box-shadow: inset 0 0 0 2px var(--syc, var(--red)); }
  100% { background: transparent; box-shadow: inset 0 0 0 0 transparent; }
}
.plan-sem + .plan-sem { border-left: 1px solid var(--line); }
.plan-sem-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.plan-sem-head .ps-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--red); }
.plan-sem-head .ps-cr { font-family: var(--font-mono); font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.plan-track-note {
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 26px;
  font-size: 15.5px; color: var(--red-deep);
  background: var(--red-wash);
  border-left: 4px solid var(--red);
  padding: 11px 18px;
}
.alt-or { text-align: center; font-size: 14px; color: var(--ink-faint); padding: 3px 0; font-style: italic; }

/* progress rail */
.plan-progress {
  display: flex; align-items: stretch;
  margin: 30px 0 36px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pp-step {
  flex: 1; padding: 12px 6px 14px; text-align: center;
  border: none; border-right: 1px solid var(--line); position: relative;
  background: linear-gradient(to bottom, var(--cw, var(--red-wash)), #fff 78%);
  cursor: pointer; font: inherit;
  transition: transform 0.18s var(--ease), filter 0.18s, box-shadow 0.18s;
}
.pp-step:last-child { border-right: none; }
.pp-step:hover { filter: saturate(1.15) brightness(1.02); transform: translateY(-2px); z-index: 1; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); }
.pp-step:focus-visible { outline: 2px solid var(--c, var(--red)); outline-offset: -2px; z-index: 1; }
.pp-step::after { z-index: 2; }
.pp-step:hover::after { height: 7px; }
.pp-step .pp-sem { display: block; font-size: 13px; color: var(--ink-soft); }
.pp-step .pp-cum { display: block; font-family: var(--font-display); font-size: 18.5px; font-weight: 700; color: var(--c, var(--red)); margin-top: 2px; }
/* light track + colored accumulated bar (per-year color) */
.pp-step::before {
  content: ""; position: absolute; left: 0; bottom: 0; height: 5px;
  width: 100%; background: var(--line);
}
.pp-step::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 5px;
  width: 100%; background: var(--c, var(--red)); border-top-right-radius: 3px;
  transform-origin: left; transform: scaleX(var(--p, 0));
  transition: transform 0.8s var(--ease);
}

/* ---------- PLOs (compact list) ---------- */
.pd-key {
  width: 24px; height: 24px; flex: none;
  background: var(--black); color: #fff;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  font-style: normal;
  display: inline-grid; place-items: center;
  transform: skewX(-8deg);
  border-radius: 7px;
}
/* domain colors — match the course card PLO badges */
.pd-key.d-k { background: var(--red); }
.pd-key.d-s { background: var(--teal); }
.pd-key.d-e { background: var(--gold); }
.pd-key.d-ch { background: #4f9d4a; }
.plo-legend {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  font-size: 14.5px; color: var(--ink-soft);
  margin-bottom: 16px;
}
.plo-legend span { display: inline-flex; align-items: center; gap: 8px; }
.plo-list {
  list-style: none;
  background: #fff;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.plo-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  transition: background 0.15s;
}
.plo-row + .plo-row { border-top: 1px solid #f0f0f2; }
.plo-row:hover { background: var(--red-wash); }
.plo-id {
  font-family: var(--font-mono); font-size: 14.5px; font-weight: 600;
  color: var(--red); flex: none; width: 58px;
}
.plo-text { flex: 1; font-size: 16px; color: var(--ink); min-width: 0; }
.plo-text .tag { vertical-align: middle; }
.plo-meta { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.plo-bloom {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-faint); letter-spacing: 0.04em;
  width: 96px;
}
@media (max-width: 640px) {
  .plo-bloom { display: none; }
  .plo-row { gap: 10px; }
}

/* ---------- careers ---------- */
.careers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.career-chip {
  display: flex; align-items: center; gap: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  font-size: 16px; font-weight: 600;
  font-family: var(--font-display);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}
.career-chip:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1); border-color: var(--red); }
.career-chip .ci {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--red-wash);
  border-radius: 50%;
  font-size: 20px;
  transition: transform 0.3s var(--ease);
}
.career-chip:hover .ci { transform: scale(1.12) rotate(-8deg); }
.careers-grid .career-chip:nth-child(5n+2) .ci { background: var(--gold-wash); }
.careers-grid .career-chip:nth-child(5n+3) .ci { background: var(--orange-wash); }
.careers-grid .career-chip:nth-child(5n+4) .ci { background: var(--pink-wash); }
.careers-grid .career-chip:nth-child(5n+5) .ci { background: var(--teal-wash); }

/* ---------- philosophy (black band) ---------- */
.philosophy {
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26"><circle cx="2" cy="2" r="1.2" fill="white" fill-opacity="0.05"/></svg>'),
    linear-gradient(118deg, #101010 0%, #181818 55%, #232325 55.2%, #141416 100%);
  color: #e9e9ec;
  position: relative; overflow: hidden;
}
.philosophy blockquote {
  font-size: clamp(20px, 2.4vw, 26.5px);
  line-height: 1.9;
  max-width: 860px;
  font-weight: 400;
}
.philosophy blockquote::before {
  content: "\201C";
  font-family: var(--font-display);
  font-size: 94.5px; line-height: 0;
  color: var(--red);
  display: block; margin: 30px 0 14px;
}
.philosophy figcaption { margin-top: 26px; font-size: 15.5px; color: #88888f; }
.philosophy figcaption b { color: #d8d8dc; }
.philosophy::after {
  content: "∑"; position: absolute;
  right: 3%; bottom: -90px;
  font-family: var(--font-display);
  font-size: 360px; font-weight: 700; line-height: 1;
  color: rgba(255, 255, 255, 0.035);
  pointer-events: none; user-select: none;
}

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.contact-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.1); }
.contact-card .cc-lbl { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); letter-spacing: 0.12em; margin-bottom: 8px; }
.contact-card .cc-val { font-family: var(--font-display); font-size: 18px; font-weight: 600; word-break: break-word; }
.contact-card a { text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

footer {
  position: relative;
  background: var(--black);
  color: #9a9aa1;
  padding: 30px 0 38px;
  font-size: 14.5px;
}
footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red), var(--gold) 55%, var(--teal));
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  /* keep hero figures fully drawn when the draw animation is disabled */
  .hero-art .draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  /* SMIL signal dots aren't covered by `animation: none` — hide them */
  .hero-art .signal { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .diagram-grid { grid-template-columns: 1fr; }
  .diagram-copy { order: -1; }
  .icon-band { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .plan-sems { grid-template-columns: 1fr; }
  .plan-sem + .plan-sem { border-left: none; border-top: 1px solid var(--line); }
  .nav-toggle { display: flex; }
  .topbar-inner { position: relative; }
  .topnav {
    display: none;
    position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.13);
  }
  .topnav.open { display: flex; animation: navdrop 0.22s var(--ease); }
  @keyframes navdrop { from { opacity: 0; transform: translateY(-8px); } }
  .topnav a {
    padding: 14px 24px; font-size: 16.5px;
    border-bottom: 1px solid var(--line);
  }
  .topnav a:last-child { border-bottom: none; }
  .topnav a:hover { color: var(--red); background: var(--red-wash); border-bottom-color: var(--line); }
  .icon-band { grid-template-columns: repeat(3, 1fr); }
  .plan-progress { flex-wrap: wrap; }
  .pp-step { flex: 1 1 25%; border-bottom: 1px solid var(--line); }
  .course-row { flex-wrap: wrap; }
  .course-row .c-cr { width: 100%; padding-left: 78px; }
}

/* ---------- course search (structure section) ---------- */
.course-search { margin-bottom: 26px; }
.cs-field {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid var(--line-strong);
  border-radius: 999px; padding: 3px 7px 3px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cs-field:focus-within { border-color: var(--red); box-shadow: 0 4px 16px rgba(200, 16, 46, 0.14); }
.cs-ic { font-size: 17px; opacity: 0.55; flex: none; }
.cs-input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-family: var(--font-body); font-size: 16.5px; color: var(--ink);
  padding: 11px 0;
}
.cs-clear {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gray-bg); color: var(--ink-soft); font-size: 21px; line-height: 1;
  transition: background 0.18s, color 0.18s;
}
.cs-clear:hover { background: var(--red); color: #fff; }
.cs-results {
  margin-top: 16px; background: #fff;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--gold);
  padding: 8px 20px 14px;
}
.cs-count { font-size: 14px; color: var(--ink-soft); padding: 10px 4px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.cs-empty { font-size: 16px; color: var(--ink-soft); padding: 16px 4px; }

/* ---------- back-to-top button ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 120;
  width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--red); color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.4);
  display: grid; place-items: center;
  opacity: 0; transform: translateY(16px) scale(0.9); pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--red-deep); transform: translateY(-3px); }
@media (max-width: 760px) {
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
