:root {
  --bg: #080b16;
  --bg-soft: #101526;
  --surface: rgba(15, 21, 39, 0.82);
  --surface-strong: #12182a;
  --ink: #f5f2ea;
  --muted: #9da6ba;
  --line: rgba(245, 242, 234, 0.14);
  --accent: #43e0c3;
  --accent-rgb: 67, 224, 195;
  --accent-two: #a978ff;
  --header-height: 86px;
  --page-pad: clamp(20px, 5vw, 76px);
  --max-width: 1440px;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans Thai", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  transition: color 420ms ease, background 520ms ease;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  color: #08110f;
  background: var(--accent);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient::before {
  content: "";
  position: absolute;
  top: -48vw;
  left: 15vw;
  width: 92vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 30deg,
    transparent 0 18%,
    rgba(67, 224, 195, 0.42) 25%,
    transparent 34% 48%,
    rgba(169, 120, 255, 0.4) 57%,
    transparent 66% 78%,
    rgba(255, 122, 138, 0.28) 87%,
    transparent 94%
  );
  filter: blur(120px);
  opacity: 0.1;
  will-change: transform, opacity;
  animation: auroraSweep 34s linear infinite;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 11, 22, 0.28) 54%, var(--bg) 100%);
}

.ambient-orb {
  position: absolute;
  width: 46vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.13;
  transition: background 550ms ease;
  will-change: transform, opacity;
}

.ambient-orb-a {
  top: -24vw;
  right: -8vw;
  background: var(--accent);
  animation: auroraDriftA 22s ease-in-out infinite alternate;
}

.ambient-orb-b {
  top: 44vh;
  left: -30vw;
  background: var(--accent-two);
  animation: auroraDriftB 28s ease-in-out infinite alternate;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.11;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at 70% 20%, #000, transparent 54%);
  animation: gridDrift 42s linear infinite;
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.1) 0 0.5px, transparent 0.7px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.08) 0 0.5px, transparent 0.8px);
  background-size: 7px 7px, 11px 11px;
  animation: starBreath 7s ease-in-out infinite alternate;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  width: min(100%, var(--max-width));
  height: var(--header-height);
  margin-inline: auto;
  padding: 20px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--bg);
  background: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  transition: color 300ms ease, background 300ms ease;
}

.brand:hover .brand-mark {
  background: var(--accent);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  letter-spacing: 0.18em;
  font-size: 0.88rem;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  font-size: 0.78rem;
  font-weight: 600;
}

.theme-toggle {
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  transition: color 220ms ease, border-color 220ms ease, background 320ms ease;
}

.theme-toggle span {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.2);
}

.theme-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.5);
  transition: transform 260ms ease, background 260ms ease;
}

html[data-theme="dark"] .theme-toggle span::after {
  transform: translateX(12px);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.top-nav a {
  position: relative;
  color: rgba(245, 242, 234, 0.78);
  transition: color 200ms ease;
}

.top-nav a:not(.nav-home)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 1px;
  background: var(--accent);
  transition: right 220ms ease;
}

.top-nav a:hover {
  color: var(--ink);
}

.top-nav a:hover::after {
  right: 0;
}

.nav-home {
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--bg) !important;
  background: var(--ink);
}

.nav-home:hover {
  background: var(--accent);
}

.hero {
  position: relative;
  width: min(100%, var(--max-width));
  min-height: max(720px, 100svh);
  margin: 0 auto;
  padding: calc(var(--header-height) + clamp(52px, 8vh, 96px)) var(--page-pad) 76px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  align-items: center;
  gap: clamp(30px, 4vw, 74px);
}

.hero::before {
  content: "";
  position: absolute;
  top: var(--header-height);
  bottom: 0;
  left: var(--page-pad);
  width: 1px;
  background: linear-gradient(var(--line), transparent 80%);
}

.hero-copy {
  position: relative;
  z-index: 4;
}

.eyebrow {
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(245, 242, 234, 0.66);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.eyebrow span {
  width: 34px;
  height: 2px;
  background: var(--accent);
}

.hero h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(4rem, 7.6vw, 7.2rem);
  font-weight: 900;
  line-height: 0.89;
  letter-spacing: -0.075em;
}

.hero h1 span {
  display: block;
  white-space: nowrap;
}

.hero h1 .outline {
  color: transparent;
  -webkit-text-stroke: clamp(1px, 0.12vw, 2px) rgba(245, 242, 234, 0.74);
}

.accent-text {
  color: var(--accent);
  transition: color 400ms ease;
}

.hero-intro {
  max-width: 600px;
  margin: clamp(26px, 4vh, 42px) 0 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.2vw, 1.12rem);
  font-weight: 300;
}

.hero-actions,
.closing-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.primary-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-height: 58px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  color: #07120f;
  background: var(--accent);
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(var(--accent-rgb), 0.15);
  transition: transform 200ms ease, box-shadow 200ms ease, background 300ms ease;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 56px rgba(var(--accent-rgb), 0.25);
}

.text-button {
  padding: 9px 2px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid rgba(245, 242, 234, 0.38);
  font-size: 0.86rem;
  font-weight: 600;
}

.text-button:hover {
  border-color: var(--accent);
}

.hero-stats {
  margin: clamp(34px, 6vh, 62px) 0 0;
  display: flex;
  gap: 0;
}

.hero-stats div {
  min-width: 112px;
  padding: 0 25px;
  border-left: 1px solid var(--line);
}

.hero-stats div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stats dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.28rem;
  font-weight: 600;
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.hero-visual {
  position: relative;
  height: clamp(520px, 68vh, 710px);
  perspective: 1600px;
  transform-style: preserve-3d;
}

.visual-halo {
  position: absolute;
  top: 17%;
  left: 16%;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.06) 46%, transparent 68%);
  filter: blur(18px);
  will-change: transform, opacity;
  animation: haloBreath 8s ease-in-out infinite;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 50%;
  transform: rotate(-17deg);
}

.orbit-a {
  inset: 12% 2% 16% 8%;
}

.orbit-b {
  inset: 22% 10% 8% 17%;
}

.hero-card {
  position: absolute;
  width: min(82%, 590px);
  margin: 0;
  overflow: visible;
  background: transparent;
  transform-style: preserve-3d;
  transition: transform 280ms cubic-bezier(.2,.7,.2,1), opacity 280ms ease;
  animation: heroCardIn 850ms cubic-bezier(.17,.67,.3,1) both;
}

.hero-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #141a29;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}

.hero-card figcaption {
  position: absolute;
  top: -34px;
  left: var(--folder-tab, 8%);
  width: 58px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #141a29;
  box-shadow: inset 0 2px 0 var(--folder-accent, var(--accent));
  font-size: 0;
}

.hero-card figcaption span {
  color: var(--folder-accent, var(--accent));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
}

.hero-card-five {
  --folder-accent: #7dd3fc;
  --folder-tab: 5%;
  top: 17%;
  left: 7%;
  z-index: 1;
  opacity: 0.42;
  transform: rotateZ(-3deg) translate3d(-10px, -18px, -160px);
  animation-delay: 320ms;
}

.hero-card-four {
  --folder-accent: #ff9a52;
  --folder-tab: 24%;
  top: 20%;
  left: 9%;
  z-index: 2;
  opacity: 0.54;
  transform: rotateZ(2.2deg) translate3d(-4px, -10px, -120px);
  animation-delay: 270ms;
}

.hero-card-four img {
  object-fit: contain;
  background: #f7f1e6;
}

.hero-card-three {
  --folder-accent: #ff7a8a;
  --folder-tab: 43%;
  top: 23%;
  left: 7%;
  z-index: 3;
  opacity: 0.68;
  transform: rotateZ(-1.8deg) translate3d(0, -4px, -80px);
  animation-delay: 220ms;
}

.hero-card-two {
  --folder-accent: #f2c55c;
  --folder-tab: 62%;
  top: 26%;
  left: 9%;
  z-index: 4;
  opacity: 0.82;
  transform: rotateZ(1deg) translate3d(4px, 3px, -40px);
  animation-delay: 120ms;
}

.hero-card-one {
  --folder-accent: #43e0c3;
  --folder-tab: 81%;
  top: 29%;
  left: 8%;
  z-index: 5;
  transform: rotateZ(-0.4deg) translate3d(8px, 10px, 20px);
}

.visual-label {
  position: absolute;
  z-index: 4;
  color: rgba(245, 242, 234, 0.4);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  line-height: 1.7;
}

.visual-label-top {
  top: 5%;
  right: 2%;
  text-align: right;
}

.visual-label-side {
  right: -32px;
  bottom: 5%;
  writing-mode: vertical-rl;
}

.scroll-cue {
  position: absolute;
  left: var(--page-pad);
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(245, 242, 234, 0.46);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

.scroll-cue i {
  width: 70px;
  height: 1px;
  position: relative;
  background: var(--line);
  overflow: hidden;
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scrollLine 2s ease-in-out infinite;
}

.course-section {
  position: relative;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(84px, 12vw, 150px) var(--page-pad);
}

.course-section::before,
.how-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--page-pad);
  right: var(--page-pad);
  height: 1px;
  background: var(--line);
}

.section-heading {
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 430px);
  align-items: end;
  gap: 40px;
}

.section-heading h2,
.how-heading h2,
.closing-section h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.section-heading > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.library-groups {
  display: grid;
  gap: 14px;
}

.category-tabs {
  --category-accent: #43e0c3;
  --category-accent-rgb: 67, 224, 195;
  --category-surface: #10242b;
  --category-surface-open: #14343a;
  --category-ink: #ecfffb;
  --category-muted: #a7d7cf;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--category-accent-rgb), 0.48) transparent;
  border: 1px solid rgba(var(--category-accent-rgb), 0.42);
  border-radius: 14px;
  background: var(--category-surface);
}

.category-tab {
  position: relative;
  min-width: 220px;
  min-height: 88px;
  padding: 16px 22px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  color: var(--category-muted);
  text-align: left;
  border: 0;
  border-right: 1px solid rgba(var(--category-accent-rgb), 0.24);
  background: var(--category-surface);
  cursor: pointer;
  transition: color 220ms ease, background 220ms ease;
}

.category-tab[data-category="egp"] {
  --category-accent: #f2c55c;
  --category-accent-rgb: 242, 197, 92;
  --category-surface: #2c2519;
  --category-surface-open: #3a301b;
  --category-ink: #fff8df;
  --category-muted: #ddc98d;
}

.category-tab[data-category="circulars"] {
  --category-accent: #ff9a5c;
  --category-accent-rgb: 255, 154, 92;
  --category-surface: #2b1c22;
  --category-surface-open: #39251f;
  --category-ink: #fff5ec;
  --category-muted: #e1bba5;
}

.category-tab:hover,
.category-tab:focus-visible,
.category-tab.is-active {
  color: var(--category-ink);
  background: var(--category-surface-open);
}

.category-tab:focus-visible {
  outline: 2px solid var(--category-accent);
  outline-offset: -4px;
}

.category-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 3px;
  background: var(--category-accent);
  transition: right 280ms ease;
}

.category-tab.is-active::after {
  right: 0;
}

.category-tab > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.category-tab strong {
  font-size: 0.92rem;
  line-height: 1.35;
}

.category-tab small {
  margin-top: 4px;
  color: var(--category-muted);
  font-size: 0.68rem;
}

.category-tab-pinned {
  min-width: 248px;
  margin-left: auto;
  position: sticky;
  right: 0;
  z-index: 2;
  border-right: 0;
  border-left: 1px solid rgba(var(--category-accent-rgb), 0.42);
  box-shadow: -16px 0 24px rgba(8, 11, 22, 0.18);
}

.course-group[hidden] {
  display: none;
}

.course-group {
  --category-accent: #43e0c3;
  --category-accent-rgb: 67, 224, 195;
  --category-surface: #10242b;
  --category-surface-open: #14343a;
  --category-ink: #ecfffb;
  --category-muted: #a7d7cf;
  overflow: hidden;
  border: 1px solid rgba(var(--category-accent-rgb), 0.34);
  border-radius: 14px;
  background: var(--category-surface);
  transition: border-color 260ms ease, background 320ms ease, transform 320ms cubic-bezier(.22,.75,.2,1);
}

.course-group[data-category="circulars"] {
  --category-accent: #ff9a5c;
  --category-accent-rgb: 255, 154, 92;
  --category-surface: #2b1c22;
  --category-surface-open: #39251f;
  --category-ink: #fff5ec;
  --category-muted: #e1bba5;
}

.course-group[data-category="egp"] {
  --category-accent: #f2c55c;
  --category-accent-rgb: 242, 197, 92;
  --category-surface: #2c2519;
  --category-surface-open: #3a301b;
  --category-ink: #fff8df;
  --category-muted: #ddc98d;
}

.course-group.is-open {
  border-color: rgba(var(--category-accent-rgb), 0.72);
  background: var(--category-surface-open);
}

.category-index {
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  color: #07120f;
  border-radius: 50%;
  background: var(--category-accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.course-group-panel {
  overflow: hidden;
  animation: categoryReveal 360ms cubic-bezier(.2,.7,.2,1) both;
}

.course-group-panel[hidden] {
  display: none;
}

.course-tabs {
  display: grid;
  grid-template-columns: repeat(var(--course-count, 6), minmax(190px, 1fr));
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--category-accent-rgb), 0.48) transparent;
  border-top: 1px solid rgba(var(--category-accent-rgb), 0.24);
  border-bottom: 0;
  background: rgba(var(--category-accent-rgb), 0.035);
}

.course-tab {
  position: relative;
  min-height: 116px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  color: var(--category-muted);
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: color 220ms ease, background 220ms ease;
}

.course-tab:last-child {
  border-right: 0;
}

.course-tab:hover {
  color: var(--category-ink);
  background: rgba(var(--category-accent-rgb), 0.08);
}

.course-tab.is-active {
  color: var(--category-ink);
  background: rgba(var(--category-accent-rgb), 0.12);
}

.course-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 3px;
  background: var(--category-accent);
  transition: right 280ms ease;
}

.course-tab.is-active::after {
  right: 0;
}

.tab-number {
  color: var(--category-accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
}

.course-tab > span:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.course-tab strong {
  font-size: 0.88rem;
  line-height: 1.4;
}

.course-tab small {
  margin-top: 5px;
  color: var(--category-muted);
  font-size: 0.66rem;
}

.course-tab i {
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.viewer-shell {
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.75fr);
  gap: clamp(24px, 4vw, 58px);
  outline: none;
}

#course-viewer {
  --accent: #43e0c3;
  --accent-rgb: 67, 224, 195;
  --accent-two: #a978ff;
}

.course-info {
  min-height: 600px;
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
}

.course-info > *,
.slide-viewer {
  transition: opacity 260ms ease, transform 340ms cubic-bezier(.2,.7,.2,1);
}

.viewer-shell.course-swap .course-info > * {
  opacity: 0.32;
  transform: translateY(10px);
}

.viewer-shell.course-swap .slide-viewer {
  opacity: 0.45;
  transform: translateY(8px) scale(0.992);
}

.course-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.course-info h3 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -0.045em;
}

.course-info > div:first-child > p:last-child {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.course-meta {
  margin-top: 36px;
  border-top: 1px solid var(--line);
}

.course-meta div {
  padding: 13px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.73rem;
}

.course-meta span {
  color: var(--muted);
}

.course-meta strong {
  text-align: right;
}

.course-actions {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-button,
.copy-button {
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.download-button:hover,
.copy-button:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.keyboard-tip {
  margin: 15px 0 0;
  color: rgba(157, 166, 186, 0.56);
  font-size: 0.6rem;
}

kbd {
  min-width: 19px;
  height: 19px;
  margin-right: 3px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.55rem;
}

.slide-viewer {
  min-width: 0;
}

.slide-topbar {
  height: 46px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.slide-id span {
  color: var(--accent);
}

.slide-tools {
  display: flex;
  gap: 18px;
}

.slide-tools button {
  padding: 5px 0;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 0.68rem;
}

.slide-tools button:hover,
.slide-tools button[aria-pressed="true"] {
  color: var(--accent);
}

.slide-frame {
  position: relative;
  aspect-ratio: var(--slide-ratio, 16 / 9);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05070d;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.slide-frame.is-portrait {
  width: min(100%, calc(78vh * 0.8), 720px);
  aspect-ratio: var(--slide-ratio, 4 / 5);
  margin-inline: auto;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.06), transparent 42%),
    #05070d;
}

.slide-frame.is-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: scale(1);
  filter: saturate(1);
  transition: opacity 180ms ease, transform 350ms cubic-bezier(.2,.7,.2,1), filter 240ms ease;
  cursor: zoom-in;
}

.slide-frame.is-loading img {
  opacity: 0.24;
  transform: scale(0.985);
  filter: saturate(0.72);
}

.slide-frame.is-zoomed {
  overflow: auto;
  place-items: start;
}

.slide-frame.is-zoomed img {
  width: 150%;
  max-width: none;
  height: auto;
  cursor: zoom-out;
}

.slide-frame:fullscreen,
.slide-frame:-webkit-full-screen,
.slide-frame.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none;
  max-height: none;
  margin: 0 !important;
  aspect-ratio: auto;
  overflow: hidden;
  place-items: center;
  background: #03050a;
}

.slide-frame:fullscreen img,
.slide-frame:fullscreen.is-zoomed img,
.slide-frame:-webkit-full-screen img,
.slide-frame:-webkit-full-screen.is-zoomed img,
.slide-frame.is-fullscreen img,
.slide-frame.is-fullscreen.is-zoomed img {
  width: auto !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain;
  object-position: center;
  cursor: default;
}

.slide-loader {
  position: absolute;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: spin 850ms linear infinite;
  pointer-events: none;
}

.slide-frame.is-loading .slide-loader {
  opacity: 1;
}

.frame-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 46px;
  height: 70px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(4, 7, 13, 0.62);
  backdrop-filter: blur(10px);
  font-size: 2rem;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.slide-frame:hover .frame-nav,
.frame-nav:focus-visible {
  opacity: 1;
}

.frame-nav:hover {
  background: rgba(var(--accent-rgb), 0.78);
  color: #07120f;
}

.frame-prev { left: 14px; }
.frame-next { right: 14px; }

.frame-nav:disabled,
.slide-nav:disabled {
  opacity: 0.22 !important;
  cursor: not-allowed;
}

.slide-footer {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr minmax(160px, 1.4fr) 1fr;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--line);
}

.slide-nav {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  cursor: pointer;
}

.slide-nav:last-child {
  justify-content: flex-end;
}

.slide-nav:hover {
  color: var(--ink);
}

.slide-progress-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

.slide-progress-wrap > span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
}

.slide-progress {
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.slide-progress i {
  display: block;
  width: 9.09%;
  height: 100%;
  background: var(--accent);
  transition: width 300ms ease, background 300ms ease;
}

.thumbnail-rail {
  margin-top: 18px;
  padding: 4px 0 10px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.4) transparent;
}

.thumbnail-button {
  position: relative;
  width: 112px;
  min-width: 112px;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  background: #0d1120;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.thumbnail-button:hover {
  opacity: 0.82;
}

.thumbnail-button.is-active {
  border-color: var(--accent);
  opacity: 1;
  transform: translateY(-3px);
}

.thumbnail-button.is-portrait {
  width: 76px;
  min-width: 76px;
  aspect-ratio: 4 / 5;
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-button span {
  position: absolute;
  right: 4px;
  bottom: 3px;
  min-width: 20px;
  padding: 2px 4px;
  color: var(--ink);
  background: rgba(4,7,13,0.8);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.5rem;
}

.checklist-section {
  position: relative;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--page-pad);
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1.38fr);
  align-items: center;
  gap: clamp(36px, 7vw, 90px);
}

.checklist-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--page-pad);
  right: var(--page-pad);
  height: 1px;
  background: var(--line);
}

.checklist-copy h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.checklist-copy h2 span {
  color: var(--accent);
}

.checklist-copy > p:not(.eyebrow) {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.checklist-open {
  width: fit-content;
  min-height: 48px;
  margin-top: 28px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  gap: 24px;
  color: #3f2b34;
  background: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 16px 38px rgba(var(--accent-rgb), 0.22);
}

.checklist-copy small {
  max-width: 390px;
  margin-top: 18px;
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
}

.checklist-frame {
  position: relative;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: rotate(0.35deg);
  transition: transform 320ms ease, background 420ms ease, box-shadow 420ms ease;
}

.checklist-frame:hover {
  transform: rotate(0deg) translateY(-4px);
}

.checklist-frame > div {
  overflow: hidden;
  border-radius: 14px;
  background: #f3dfca;
}

.checklist-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.checklist-tab {
  position: absolute;
  top: -28px;
  right: 28px;
  min-height: 28px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface-strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
}

.checklist-frame figcaption {
  padding: 13px 4px 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.how-section {
  position: relative;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(88px, 12vw, 160px) var(--page-pad);
  display: grid;
  grid-template-columns: 0.85fr 1.45fr;
  gap: clamp(50px, 8vw, 120px);
}

.how-heading h2 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 242, 234, 0.58);
}

.how-grid {
  border-top: 1px solid var(--line);
}

.how-grid article {
  min-height: 150px;
  padding: 28px 0;
  display: grid;
  grid-template-columns: 46px minmax(150px, 0.7fr) 1fr;
  align-items: start;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.how-number {
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.how-grid h3 {
  margin: 0;
  font-size: 1.12rem;
}

.how-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.music-section {
  --music-accent: #f3a35f;
  --music-accent-rgb: 243, 163, 95;
  position: relative;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(88px, 11vw, 150px) var(--page-pad);
}

.music-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--page-pad);
  right: var(--page-pad);
  height: 1px;
  background: var(--line);
}

.music-heading {
  margin-bottom: clamp(38px, 5vw, 64px);
  display: grid;
  grid-template-columns: minmax(290px, 1fr) auto;
  align-items: end;
  gap: clamp(28px, 5vw, 72px);
}

.music-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-wrap: pretty;
}

.music-heading > div:first-child > p {
  margin-bottom: 10px;
  color: var(--music-accent);
  font-weight: 700;
}

.music-heading h2 {
  margin: 0;
  font-size: clamp(2.8rem, 5.4vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.music-heading h2 span {
  color: var(--music-accent);
}

.music-equalizer {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--music-accent);
}

.music-equalizer span {
  width: 4px;
  height: 52px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  animation: musicPulse 1.25s cubic-bezier(.22,.75,.2,1) infinite alternate;
}

.music-equalizer span:nth-child(2),
.music-equalizer span:nth-child(6) { animation-delay: -0.85s; }
.music-equalizer span:nth-child(3),
.music-equalizer span:nth-child(5) { animation-delay: -0.45s; }
.music-equalizer span:nth-child(4) { animation-delay: -1.05s; }
.music-equalizer span:nth-child(7) { animation-delay: -0.2s; }

.music-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.72fr);
  align-items: stretch;
  gap: clamp(22px, 3vw, 42px);
}

.music-player-shell {
  overflow: hidden;
  border: 1px solid rgba(var(--music-accent-rgb), 0.35);
  border-radius: 14px;
  background: #111522;
}

.music-player-topbar,
.music-player-footer {
  min-height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #f8eee5;
  background: #111522;
}

.music-player-topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.music-player-topbar span,
.music-player-footer span {
  color: #b7afaa;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
}

.music-player-topbar strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #07090f;
}

.music-player iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  opacity: 1;
  transition: opacity 240ms ease, filter 240ms ease;
}

.music-player::after {
  content: "กำลังเปลี่ยนเพลง";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f8eee5;
  background: rgba(7, 9, 15, 0.72);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.music-player-shell.is-switching .music-player::after {
  opacity: 1;
}

.music-player-shell.is-switching iframe {
  opacity: 0.35;
  filter: saturate(0.5);
}

.music-player-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.music-player-footer a {
  color: var(--music-accent);
  font-size: 0.68rem;
  font-weight: 700;
}

.music-playlist {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.music-track {
  width: 100%;
  min-height: 78px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease, transform 280ms cubic-bezier(.22,.75,.2,1);
}

.music-track:hover,
.music-track:focus-visible {
  border-color: rgba(var(--music-accent-rgb), 0.7);
  transform: translateX(-5px);
}

.music-track:focus-visible {
  outline: 2px solid var(--music-accent);
  outline-offset: 3px;
}

.music-track.is-active {
  color: var(--ink);
  border-color: var(--music-accent);
  background: rgba(var(--music-accent-rgb), 0.14);
  transform: translateX(-8px);
}

.music-track > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.music-track strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-track small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.music-track-number {
  min-width: 34px;
  color: var(--music-accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
}

.music-track i {
  color: var(--music-accent);
  font-size: 0.6rem;
  font-style: normal;
  transition: transform 220ms ease;
}

.music-track.is-active i {
  transform: translateX(3px);
}

.closing-section {
  position: relative;
  width: min(calc(100% - (var(--page-pad) * 2)), calc(var(--max-width) - (var(--page-pad) * 2)));
  min-height: 480px;
  margin: 0 auto clamp(50px, 7vw, 90px);
  padding: clamp(60px, 8vw, 100px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 50%, rgba(var(--accent-rgb), 0.22), transparent 32%),
    linear-gradient(120deg, #111729, #0b0f1c);
  border: 1px solid var(--line);
}

.closing-section::before {
  content: "14 / 165";
  position: absolute;
  right: -2%;
  bottom: -24%;
  color: rgba(245, 242, 234, 0.025);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(8rem, 21vw, 19rem);
  font-weight: 600;
  letter-spacing: -0.11em;
  white-space: nowrap;
}

.closing-section > * {
  position: relative;
  z-index: 1;
}

.closing-section h2 {
  max-width: 900px;
}

.site-footer {
  width: min(100%, var(--max-width));
  min-height: 150px;
  margin: 0 auto;
  padding: 36px var(--page-pad);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 40px;
  color: rgba(245, 242, 234, 0.48);
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.footer-brand strong {
  color: var(--ink);
  letter-spacing: 0.15em;
}

.footer-brand span {
  font-family: "IBM Plex Mono", monospace;
}

.site-footer a:hover {
  color: var(--accent);
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 28px;
  min-width: 240px;
  padding: 13px 18px;
  color: #07120f;
  background: var(--accent);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, background 300ms ease;
}

html[data-theme="soft"] {
  color-scheme: light;
  --bg: #f3e3cd;
  --bg-soft: #ead3b7;
  --surface: rgba(255, 247, 232, 0.78);
  --surface-strong: #f4ddc3;
  --ink: #473746;
  --muted: #79665f;
  --line: rgba(119, 80, 72, 0.2);
  --shadow: 0 30px 80px rgba(126, 82, 51, 0.16);
}

html[data-theme="soft"] .category-tabs {
  --category-accent: #168f80;
  --category-accent-rgb: 22, 143, 128;
  --category-surface: #dceee4;
  --category-surface-open: #c8e4d8;
  --category-ink: #17473f;
  --category-muted: #4d706a;
}

html[data-theme="soft"] .category-tab[data-category="knowledge"] {
  --category-accent: #168f80;
  --category-accent-rgb: 22, 143, 128;
  --category-surface: #dceee4;
  --category-surface-open: #c8e4d8;
  --category-ink: #17473f;
  --category-muted: #4d706a;
}

html[data-theme="soft"] .category-tab[data-category="egp"] {
  --category-accent: #b88722;
  --category-accent-rgb: 184, 135, 34;
  --category-surface: #f3e5bf;
  --category-surface-open: #ead6a0;
  --category-ink: #5d4613;
  --category-muted: #7a652f;
}

html[data-theme="soft"] .category-tab[data-category="circulars"] {
  --category-accent: #c65c35;
  --category-accent-rgb: 198, 92, 53;
  --category-surface: #f4d9c7;
  --category-surface-open: #edc8af;
  --category-ink: #6c301f;
  --category-muted: #805a4d;
}

html[data-theme="soft"] .course-group[data-category="knowledge"] {
  --category-accent: #168f80;
  --category-accent-rgb: 22, 143, 128;
  --category-surface: #dceee4;
  --category-surface-open: #c8e4d8;
  --category-ink: #17473f;
  --category-muted: #4d706a;
}

html[data-theme="soft"] .course-group[data-category="circulars"] {
  --category-accent: #c65c35;
  --category-accent-rgb: 198, 92, 53;
  --category-surface: #f4d9c7;
  --category-surface-open: #edc8af;
  --category-ink: #6c301f;
  --category-muted: #805a4d;
}

html[data-theme="soft"] .course-group[data-category="egp"] {
  --category-accent: #b88722;
  --category-accent-rgb: 184, 135, 34;
  --category-surface: #f3e5bf;
  --category-surface-open: #ead6a0;
  --category-ink: #5d4613;
  --category-muted: #7a652f;
}

html[data-theme="soft"] .course-group .category-index,
html[data-theme="soft"] .category-tab .category-index {
  color: #fffdfb;
}

html[data-theme="soft"] .music-section {
  --music-accent: #b85a30;
  --music-accent-rgb: 184, 90, 48;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="soft"] .ambient::before {
  background: conic-gradient(
    from 20deg,
    transparent 0 14%,
    rgba(230, 166, 92, 0.7) 22%,
    transparent 34% 46%,
    rgba(247, 198, 126, 0.68) 56%,
    transparent 66% 76%,
    rgba(209, 151, 178, 0.34) 86%,
    transparent 95%
  );
  filter: blur(112px);
  opacity: 0.26;
}

html[data-theme="soft"] .ambient::after {
  background: linear-gradient(180deg, rgba(255, 249, 235, 0.08), rgba(243, 227, 205, 0.38) 58%, var(--bg));
}

html[data-theme="soft"] .ambient-orb {
  opacity: 0.18;
}

html[data-theme="soft"] .ambient-grid {
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(111, 75, 93, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 75, 93, 0.08) 1px, transparent 1px);
}

html[data-theme="soft"] .ambient-noise {
  opacity: 0.13;
}

html[data-theme="soft"] .top-nav a,
html[data-theme="soft"] .visual-label,
html[data-theme="soft"] .scroll-cue,
html[data-theme="soft"] .site-footer {
  color: rgba(68, 51, 61, 0.58);
}

html[data-theme="soft"] .course-tab {
  color: var(--category-muted);
}

html[data-theme="soft"] .course-tab:hover {
  color: var(--category-ink);
  background: rgba(var(--category-accent-rgb), 0.09);
}

html[data-theme="soft"] .hero-card img {
  border-color: rgba(111, 75, 93, 0.18);
  box-shadow: 0 24px 60px rgba(128, 79, 101, 0.2);
}

html[data-theme="soft"] .hero-card figcaption {
  border-color: rgba(111, 75, 93, 0.18);
  background: #f4dfca;
}

html[data-theme="soft"] .text-button {
  border-color: rgba(68, 51, 61, 0.28);
}

html[data-theme="soft"] .hero h1 .outline {
  -webkit-text-stroke-color: rgba(68, 51, 61, 0.58);
}

html[data-theme="soft"] .how-heading h2 span {
  -webkit-text-stroke-color: rgba(68, 51, 61, 0.42);
}

html[data-theme="soft"] .closing-section {
  background:
    radial-gradient(circle at 80% 50%, rgba(var(--accent-rgb), 0.2), transparent 34%),
    linear-gradient(120deg, #f2dcc3, #ead2c2);
}

html[data-theme="soft"] .closing-section::before {
  color: rgba(68, 51, 61, 0.035);
}

html[data-theme="soft"] .thumbnail-button {
  background: #e8d0b8;
}

html[data-theme="soft"] .thumbnail-button span {
  color: #fffaf7;
  background: rgba(68, 51, 61, 0.78);
}

@keyframes categoryReveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes heroCardIn {
  from {
    opacity: 0;
    translate: 0 90px;
    scale: 0.94;
    filter: blur(5px);
  }
}

@keyframes auroraSweep {
  0% { transform: rotate(0deg) scale(0.92); opacity: 0.07; }
  50% { transform: rotate(180deg) scale(1.08); opacity: 0.13; }
  100% { transform: rotate(360deg) scale(0.92); opacity: 0.07; }
}

@keyframes auroraDriftA {
  0% { transform: translate3d(0, 0, 0) scale(0.94); opacity: 0.09; }
  45% { transform: translate3d(-8vw, 10vh, 0) scale(1.08); opacity: 0.16; }
  100% { transform: translate3d(5vw, 18vh, 0) scale(0.98); opacity: 0.12; }
}

@keyframes auroraDriftB {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.08; }
  52% { transform: translate3d(14vw, -9vh, 0) scale(1.12); opacity: 0.14; }
  100% { transform: translate3d(24vw, 8vh, 0) scale(0.92); opacity: 0.1; }
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 80px 80px, 80px 80px; }
}

@keyframes starBreath {
  0% { opacity: 0.11; transform: translate3d(0, 0, 0); }
  100% { opacity: 0.23; transform: translate3d(-6px, 4px, 0); }
}

@keyframes haloBreath {
  0%, 100% { transform: scale(0.94); opacity: 0.72; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes musicPulse {
  0% { transform: scaleY(0.22); opacity: 0.45; }
  100% { transform: scaleY(1); opacity: 1; }
}

@keyframes scrollLine {
  0%, 15% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
  }

  .hero h1 {
    font-size: clamp(3.7rem, 7vw, 5.5rem);
  }

  .course-tab {
    padding-inline: 16px;
  }

  .viewer-shell {
    grid-template-columns: minmax(230px, 0.62fr) minmax(0, 1.55fr);
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 76px;
  }

  .site-header {
    position: absolute;
  }

  .top-nav > a:not(.nav-home) {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 70px);
    padding-bottom: 104px;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero h1 {
    font-size: clamp(4.1rem, 13vw, 7rem);
  }

  .hero-visual {
    height: min(72vw, 580px);
    margin-top: 18px;
  }

  .hero-card {
    width: min(72%, 520px);
  }

  .hero-card-one { right: 8%; }
  .hero-card-two { left: 5%; }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section-heading > p {
    max-width: 580px;
  }

  .course-tabs {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 42vw);
    border-bottom: 1px solid var(--line);
  }

  .course-tab {
    min-height: 92px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .viewer-shell {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .checklist-section {
    grid-template-columns: 1fr;
  }

  .checklist-copy {
    max-width: 650px;
  }

  .course-info {
    min-height: 0;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 34px;
  }

  .course-meta {
    margin-top: 0;
  }

  .course-actions {
    padding-top: 0;
  }

  .keyboard-tip {
    display: none;
  }

  .how-section {
    grid-template-columns: 1fr;
  }

  .music-heading {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .music-layout {
    grid-template-columns: 1fr;
  }

  .music-playlist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --page-pad: 20px;
  }

  .brand-copy small {
    display: none;
  }

  .nav-home {
    min-height: 38px;
    padding: 0 13px;
    font-size: 0.7rem;
  }

  .top-nav {
    gap: 10px;
  }

  .theme-toggle {
    min-height: 34px;
    padding-inline: 8px;
  }

  .theme-toggle b {
    display: none;
  }

  .hero {
    padding-top: calc(var(--header-height) + 50px);
    padding-bottom: 86px;
  }

  .hero::before {
    display: none;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 0.56rem;
  }

  .hero h1 {
    font-size: clamp(3.55rem, 18.5vw, 5.7rem);
    line-height: 0.9;
  }

  .hero-intro {
    font-size: 0.9rem;
  }

  .hero-actions,
  .closing-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .primary-button {
    width: 100%;
  }

  .text-button {
    align-self: flex-start;
  }

  .hero-stats {
    justify-content: space-between;
  }

  .hero-stats div {
    min-width: 0;
    padding-inline: 16px;
  }

  .hero-visual {
    height: 108vw;
    min-height: 340px;
    max-height: 500px;
    margin-inline: -8px;
  }

  .hero-card {
    width: 84%;
  }

  .hero-card { width: 91%; }
  .hero-card-five { top: 16%; left: 2%; }
  .hero-card-four { top: 20%; left: 4%; }
  .hero-card-three { top: 24%; left: 2%; }
  .hero-card-two { top: 28%; left: 4%; }
  .hero-card-one { top: 32%; left: 3%; }

  .visual-label-top,
  .visual-label-side {
    display: none;
  }

  .scroll-cue {
    bottom: 20px;
  }

  .section-heading h2,
  .how-heading h2,
  .music-heading h2,
  .closing-section h2 {
    font-size: clamp(2.25rem, 12vw, 3.6rem);
  }

  .course-tab {
    padding: 15px 12px;
  }

  .category-tab {
    min-width: 210px;
    min-height: 74px;
    padding: 13px 15px;
    gap: 12px;
  }

  .category-tab-pinned {
    min-width: 230px;
  }

  .course-tabs {
    grid-auto-columns: minmax(230px, 82vw);
  }

  .viewer-shell {
    margin-top: 26px;
  }

  .course-info {
    display: flex;
    gap: 0;
  }

  .course-meta {
    margin-top: 28px;
  }

  .course-actions {
    margin-top: 28px;
  }

  .slide-topbar {
    height: 42px;
  }

  .slide-frame {
    margin-inline: calc(var(--page-pad) * -1);
    width: calc(100% + (var(--page-pad) * 2));
  }

  .frame-nav {
    display: none;
  }

  .slide-footer {
    min-height: 70px;
    grid-template-columns: auto 1fr auto;
    gap: 13px;
  }

  .slide-nav {
    font-size: 0;
  }

  .slide-nav span {
    font-size: 1.15rem;
  }

  .thumbnail-button {
    width: 94px;
    min-width: 94px;
  }

  .checklist-section {
    padding-top: 90px;
    padding-bottom: 90px;
  }

  .checklist-frame {
    margin-inline: calc(var(--page-pad) * -0.45);
    padding: 10px;
    border-radius: 16px;
  }

  .checklist-frame > div {
    border-radius: 10px;
  }

  .how-grid article {
    grid-template-columns: 38px 1fr;
  }

  .how-grid p {
    grid-column: 2;
  }

  .music-section {
    padding-top: 90px;
    padding-bottom: 90px;
  }

  .music-heading {
    grid-template-columns: 1fr auto;
    gap: 22px;
  }

  .music-equalizer {
    height: 50px;
  }

  .music-equalizer span {
    height: 42px;
  }

  .music-playlist {
    grid-template-columns: 1fr;
  }

  .music-track:hover,
  .music-track:focus-visible,
  .music-track.is-active {
    transform: none;
  }

  .music-player-topbar,
  .music-player-footer {
    padding-inline: 13px;
  }

  .music-player-footer > span {
    display: none;
  }

  .closing-section {
    width: calc(100% - 24px);
    min-height: 440px;
    padding: 34px 22px;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }

  .site-footer p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #c9cfdb;
    --line: rgba(255, 255, 255, 0.35);
  }
}
