/* Hero, philosophy, and site background. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-thai);
}
h1,
h2,
h3,
.sec-title,
.course-title {
  letter-spacing: 0;
}
#bg-canvas,
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bg-glow {
  background:
    radial-gradient(60% 50% at 78% 12%, rgba(227, 160, 8, 0.05), transparent 70%),
    radial-gradient(48% 42% at 14% 84%, rgba(19, 122, 78, 0.035), transparent 70%);
}
main {
  position: relative;
  z-index: 1;
}

.hero {
  --hero-section-pad: clamp(1.25rem, 4vw, 2rem);
  --hero-section-max: 1120px;
  --hero-side: max(var(--hero-section-pad), calc((100% - var(--hero-section-max)) / 2 + var(--hero-section-pad)));
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 7rem 0 5rem;
  overflow: hidden;
}
.hero-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.16;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 56% at 32% 52%, rgba(241, 235, 221, 0.8), transparent 74%),
    linear-gradient(90deg, rgba(241, 235, 221, 0.96), rgba(241, 235, 221, 0.7) 54%, rgba(241, 235, 221, 0.2));
}
.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - var(--hero-side) - var(--hero-side)));
  max-width: 760px;
  margin-left: var(--hero-side);
  margin-right: var(--hero-side);
}
.eyebrow,
.hero-content .eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-content .eyebrow { margin-bottom: var(--space-4); }
.hero-title {
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: clamp(2.55rem, 7.4vw, 5.4rem);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: var(--space-4);
}
.hero-sub {
  font-family: var(--font-thai);
  font-size: clamp(1.04rem, 2.2vw, 1.28rem);
  line-height: 1.72;
  color: var(--ink-2);
  max-width: 43rem;
  margin: 0 0 var(--space-6);
}
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: 0.72rem 1.35rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background: var(--gold);
  color: var(--paper);
  border: 1px solid var(--gold);
  box-shadow: 0 16px 30px -22px rgba(176, 125, 8, 0.8);
}
.btn-primary:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
}
.btn-ghost {
  background: rgba(251, 247, 238, 0.58);
  color: var(--ink);
  border: 1px solid rgba(176, 125, 8, 0.34);
}
.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.hero-badges {
  position: absolute;
  top: 5.25rem;
  right: clamp(1rem, 4vw, 2.25rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.58rem;
}
.live-badge {
  width: 15.5rem;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.16rem 0.75rem;
  font-family: var(--font-mono);
  background: rgba(251, 247, 238, 0.84);
  color: var(--ink);
  border: 1px solid rgba(176, 125, 8, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.82rem;
  box-shadow: 0 14px 30px -24px rgba(23, 21, 18, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.live-badge .lb-sym {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(19, 122, 78, 0.16);
  animation: livePulse 1.8s ease-in-out infinite;
}
.live-badge .lb-price {
  font-size: 1.08rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.live-badge .lb-chg {
  justify-self: end;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lb-chg.is-up,
.lb-chg.lb-up { color: var(--green); }
.lb-chg.is-down,
.lb-chg.lb-down { color: var(--red); }
.lb-chg.lb-flat { color: var(--muted); }
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.38; }
}
.hero .scroll-cue {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  color: var(--muted);
  pointer-events: none;
}
.hero .scroll-cue .mouse {
  width: 22px;
  height: 34px;
  border: 2px solid rgba(115, 107, 88, 0.7);
  border-radius: 999px;
  position: relative;
}
.hero .scroll-cue .mouse::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: var(--gold);
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
.hero .scroll-cue .mono {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
}
@keyframes scrollDot {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 0.3; }
}

.philosophy {
  position: relative;
  z-index: 1;
  min-height: 48vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(5rem, 12vh, 8rem) var(--space-5);
  text-align: center;
  overflow: hidden;
  border-block: 1px solid rgba(176, 125, 8, 0.18);
  background: linear-gradient(180deg, rgba(251, 247, 238, 0.72), rgba(241, 235, 221, 0.9));
}
.philosophy-inner { max-width: 54rem; }
.phi-quote {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1;
  color: var(--gold);
  margin-bottom: var(--space-3);
}
.phi-attrib {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: var(--space-3);
}
.phi-th {
  display: block;
  font-family: var(--font-thai);
  font-size: clamp(1.08rem, 2.5vw, 1.35rem);
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .hero {
    align-items: flex-start;
    padding-top: 11.25rem;
  }
  .hero-badges {
    top: 4.55rem;
    left: 1rem;
    right: 1rem;
    align-items: stretch;
  }
  .hero .scroll-cue { display: none; }
}

@media (max-width: 520px) {
  .hero-buttons { align-items: stretch; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .hero .scroll-cue .mouse::after {
    animation: none;
  }
}
