@font-face {
  font-family: "Noto Sans Thai Looped";
  src: url("/fonts/noto-sans-thai-looped.woff2") format("woff2");
  font-display: swap;
}


.talkthai-home-experience, .portal-page {
  font-family: "Manrope", "Noto Sans Thai Looped", system-ui, sans-serif;
}
:is(.talkthai-home-experience, .portal-page) {
& {
  --ink: #2c1934;
  --muted: #55455e;
  --accent: #632b70;
  --accent-dark: #492155;
  --line: #ded0e5;
  --paper: #fffaff;
  --lilac: #f0e7f7;
  --gold: #f5cb79;
  --display: "Instrument Serif", Georgia, serif;
  --body: "Manrope", "Noto Sans Thai Looped", system-ui, sans-serif;
}

* { box-sizing: border-box; }
&.portal-page { margin: 0; background: var(--paper); color: var(--ink); font: 500 1rem/1.65 var(--body); }
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
figure, h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #9553a6; outline-offset: 4px; }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; top: 0; left: 12px; z-index: 2; padding: 8px 14px; background: white; transform: translateY(-125%); }
.skip:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--line); }
.nav, nav, .footer { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); }
.nav { min-height: 74px; justify-content: space-between; }
nav { flex-wrap: wrap; }
nav a, .footer a { font-weight: 750; text-decoration: none; }
nav a:hover, .footer a:hover { text-decoration: underline; text-underline-offset: .25em; }
.brand { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; font-size: 1.3rem; font-weight: 800; line-height: 1; text-decoration: none; }
.brand img { margin-right: 8px; }
.brand span { color: var(--accent); }

.hero-welcome {
  background:
    radial-gradient(ellipse at 86% 18%, #e9d9f6 0, transparent 52%),
    linear-gradient(125deg, #fff9f1 12%, #f9edf5 62%, #f0e3f7);
  border-bottom: 1px solid #e8d8ec;
}
.experiencia-hero { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); align-items: center; gap: clamp(24px, 5.2vw, 76px); padding-block: clamp(34px, 5.4vw, 82px); }
.experiencia-hero-copy { min-width: 0; }
.eyebrow { color: var(--accent); font-size: .85rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
& h1, & h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.03em; line-height: 1; }
.experiencia-hero h1 { font-size: clamp(2.95rem, 6vw, 5.75rem); margin-block: 10px 19px; max-width: 12ch; }
& h1 em { color: var(--accent); font-family: "Noto Sans Thai Looped", sans-serif; font-size: .69em; font-style: normal; white-space: nowrap; }
h2 { font-size: clamp(2.4rem, 4.1vw, 4.1rem); margin-block: 6px 12px; }
h3 { font-size: 1.18rem; line-height: 1.35; margin-block: 0 7px; }
.intro { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.16rem); max-width: 54ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 24px 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .6rem 1rem; border: 1px solid transparent; border-radius: 9px; text-align: center; text-decoration: none; font-weight: 800; cursor: pointer; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: transparent; color: var(--accent-dark); border-color: #ab86b5; }
.secondary:hover { background: var(--lilac); }
.experiencia-hero-note { color: var(--muted); font-size: .9rem; }

.mali-stage {
  width: 100%;
  max-width: 525px;
  margin-inline: auto;
  display: grid;
  justify-items: center;
  isolation: isolate;
}
.mali-scene { position: relative; display: grid; place-items: center; width: 100%; }
.mali-shadow {
  position: absolute;
  bottom: 9%;
  width: 53%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #6f3e875c, transparent 72%);
  pointer-events: none;
}
.mali-character {
  position: relative;
  width: min(86%, 428px);
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 40%;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.mali-character:enabled { cursor: pointer; touch-action: manipulation; }
.mali-character:focus-visible { outline: 0; }
.mali-stage:has(.mali-character:focus-visible) .mali-hint {
  outline: 3px solid #9553a6;
  outline-offset: 4px;
  border-radius: 2px;
}
.mali-figure { position: relative; display: block; transform-origin: 50% 90%; }
.mali-motion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.mali-stage[data-drawing] .mali-motion { opacity: 1; }
.mali-stage[data-drawing] .mali-art { opacity: 0; }
.mali-art {
  width: 100%;
  height: auto;
  transform-origin: 50% 90%;
  transition: transform .24s ease-out;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mali-stage:not([data-motion-ready]) .mali-character:enabled:hover .mali-art { transform: translateY(-3%) rotate(-4deg); }
}
.mali-message {
  position: relative;
  z-index: 1;
  justify-self: end;
  padding: 10px 15px;
  width: min(100%, 224px);
  margin: 2px 0 -23px;
  border: 1px solid #e1cee8;
  border-radius: 18px 18px 18px 4px;
  background: #fffbff;
  box-shadow: 0 6px 20px #50205d14;
  color: var(--ink);
  font-size: .96rem;
  line-height: 1.4;
  pointer-events: none;
}
.mali-message::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 17px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border: solid #e1cee8;
  border-width: 0 1px 1px 0;
  background: inherit;
}
.mali-thai {
  display: block;
  font: 700 1.3rem/1.4 "Noto Sans Thai Looped", sans-serif;
  color: var(--accent);
}
.mali-hint { margin: -12px 0 0; color: var(--muted); font-size: .875rem; font-weight: 650; }
.mali-sparkle { position: absolute; left: 12%; top: 20%; color: #976100; font-size: 1.55rem; opacity: 0; pointer-events: none; }
.mali-sparkle + .mali-sparkle { left: auto; right: 10%; top: 34%; font-size: 1.2rem; }

.mali-stage:not([data-motion-ready])[data-reaction="greet"] .mali-art { animation: mali-wave .92s ease-in-out; }
.mali-stage[data-reaction="jump"] .mali-figure { animation: mali-jump .8s ease-in-out; }
.mali-stage[data-reaction="jump"] .mali-shadow { animation: mali-shadow .8s ease-in-out; }
.mali-stage[data-reaction="bow"] .mali-figure { animation: mali-bow .85s ease-in-out; }
.mali-stage[data-reaction] .mali-sparkle { animation: mali-twinkle .85s ease-out; }
.mali-stage[data-reaction] .mali-sparkle + .mali-sparkle { animation-delay: .13s; }
@keyframes mali-wave {
  20% { transform: rotate(-8deg) translateY(-2%); }
  43% { transform: rotate(6deg); }
  67% { transform: rotate(-5deg); }
  85% { transform: rotate(2deg); }
}
@keyframes mali-jump {
  18%, 70% { transform: scale(1.06,.93); }
  44% { transform: translateY(-10%) scale(.95,1.06); }
  88% { transform: scale(.99,1.02); }
}
@keyframes mali-shadow {
  44% { transform: scale(.74); opacity: .48; }
}
@keyframes mali-bow {
  30%, 53% { transform: rotate(8deg) scale(1.02,.91); }
  78% { transform: rotate(-3deg); }
}
@keyframes mali-twinkle {
  0%, 100% { opacity: 0; transform: scale(.6); }
  47% { opacity: 1; transform: translateY(-10px) scale(1.14); }
}

.home-paths { padding-block: clamp(28px, 5vw, 66px); }
.home-paths h2 { font-size: clamp(2.25rem, 3.8vw, 3.5rem); margin-bottom: 17px; }
.path-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.path-card { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: clamp(16px,2.4vw,25px); border: 1px solid #e4d4ea; border-radius: 17px; background: #f8effb; }
.path-card:nth-child(2) { background: #fff1eb; border-color: #ead9cf; }
.path-card:nth-child(3) { background: #f0e6f6; }
.path-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.65rem, 2.5vw, 2.2rem); line-height: 1; }
.path-card p { color: var(--muted); }
.path-card a { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; }
.journey { padding-block: clamp(42px, 6.6vw, 90px); background: var(--lilac); }
.journey-lead { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px 40px; align-items: end; }
.journey-lead p:last-child, .learning-grid p { color: var(--muted); }
.learning-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-block: 24px 0; }
.learning-grid article { padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.text-link { text-decoration: underline; display: inline-block; color: var(--accent-dark); font-weight: 800; text-underline-offset: .22em; }
.home-portal { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:24px clamp(24px,5vw,64px); align-items:center; padding-block:clamp(40px,6vw,90px); }
.portal-preview { overflow: hidden; background:#fff; border:1px solid var(--line); border-radius:18px; box-shadow:0 12px 30px #59296513; }
.portal-preview-head { display: flex; align-items: center; gap: 10px; background: #3f254d; color: white; padding: 12px clamp(18px,3vw,30px); }
.portal-preview-head img { border-radius: 50%; }
.portal-preview-head h3 { margin: 0; }
.portal-preview dl { margin:0; padding:5px clamp(18px,3vw,30px) 9px; }
.portal-preview dl > div { display:grid; gap:3px; padding-block:11px; }
.portal-preview dl > div + div { border-top:1px solid var(--line); }
.portal-preview dt { font-weight:800; color:var(--accent-dark); }
.portal-preview dd { margin:0; color:var(--muted); }
.home-teacher { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 10px 40px; align-items: center; border-top:1px solid var(--line); padding-block:clamp(26px,5vw,62px); }
.home-teacher .text-link { margin-top: 10px; }
.home-teacher h2 { font-size:clamp(2rem,3.4vw,3rem); }
.mentor-example-link { margin:10px 0 0 12px; }

.mentoring { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: clamp(21px, 4vw, 54px); margin-bottom: clamp(26px,5vw,58px); padding: clamp(17px,3.5vw,42px); border-radius: 24px; background: #3f254d; color: #fff7fc; }
.mentoring .eyebrow, .mentoring .text-link { color: #f9daa1; }
.mentoring .intro { color: #f1e4f2; }
.mentoring .button { color: #3f254d; background: #f6e2f0; border-color: transparent; }
.mentoring .button:hover { background: #fff4fb; }
.mentoring img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; }
.mentoring ul { padding-left: 22px; }
.mentoring li::marker { color: #f9daa1; }
.footer { min-height: 80px; flex-wrap: wrap; color: var(--muted); }
.footer .brand { margin-right: auto; }

&.portal-page { background: #f7eff8; }
.portal { padding-block: clamp(36px, 7vw, 76px); }
.portal-head { margin-bottom: 30px; }
.portal-head h1 { font-size: clamp(3rem, 6vw, 5.1rem); }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sheet { padding: clamp(17px, 3.3vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.sheet h2 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
.activity-head { display: flex; gap: 4px 20px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
.progress-label { color: var(--accent-dark); font-size: .9rem; font-weight: 800; }
progress { display: block; width: 100%; height: .8rem; margin: 7px 0 22px; accent-color: var(--accent); }
fieldset { min-width: 0; margin: 0 0 18px; padding: 0 0 17px; border: solid var(--line); border-width: 0 0 1px; }
legend { padding: 0; font-weight: 800; }
.options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.options label { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 1.08rem; }
.options label:has(:checked) { outline: 1px solid var(--accent); background: var(--lilac); }
.options input { accent-color: var(--accent); }
.feedback { margin-top: 8px; color: var(--muted); }
.result { margin-block: 0 12px; padding: 10px 12px; border-radius: 8px; background: #f9eac5; font-weight: 800; }
.review dl { margin: 16px 0; }
.review dl div { padding-block: 7px; border-bottom: 1px solid var(--line); }
.review dt { color: var(--accent-dark); font: 700 1.3rem/1.5 "Noto Sans Thai Looped", sans-serif; }
.review dd { margin: 0; color: var(--muted); }

@media (max-width: 770px) {
  .experiencia-hero, .mentoring, .journey-lead, .home-portal, .home-teacher, .portal-grid { grid-template-columns: 1fr; }
  .experiencia-hero { padding-top: 36px; }
  .mali-stage { max-width: 420px; }
  .mentoring img { max-height: 330px; aspect-ratio: 16 / 9; }
}
@media (max-width: 550px) {
  .wrap { width: calc(100% - 32px); }
  .nav { flex-wrap: wrap; min-height: 0; padding-block: 10px 13px; gap: 6px; }
  .nav nav { width: 100%; gap: 13px; }
  .learning-grid, .path-grid { grid-template-columns: 1fr; }
  .experiencia-hero .actions { display: grid; }
  .mali-stage { max-width: 345px; }
  .mali-message { width: min(100%, 220px); min-height: 74px; margin-bottom: -13px; }
}
@media (prefers-reduced-motion: reduce) {
  .mali-stage[data-reaction] :is(.mali-art, .mali-figure, .mali-shadow, .mali-sparkle) { animation: none; }
  .mali-art { transition: none; }
}

}
