/* ---------- Shared section rhythm ---------- */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.head-row--result { align-items: flex-start; }
.section,
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-section) var(--gutter) 0;
}

.eyebrow {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-ink-3);
  margin-bottom: 20px;
}

.display {
  font-size: var(--t-display);
  line-height: var(--lh-display);
  font-weight: 700;
  letter-spacing: -0.012em;
  padding-top: 0.08em; /* room for Thai tone marks */
}
.display .line { display: block; white-space: nowrap; }

.heading {
  font-size: var(--t-heading);
  line-height: var(--lh-heading);
  font-weight: 700;
  letter-spacing: -0.008em;
  text-wrap: balance;
}
.heading--sm { font-size: var(--t-heading-sm); }

.lede,
.section-lede {
  font-size: var(--t-lede);
  line-height: 1.7;
  color: var(--c-ink-2);
  max-width: 34em;
  text-wrap: pretty;
}
.section-lede { margin-top: 22px; }
.br, .br-md { display: block; }
@media (max-width: 720px) {
  .br, .br-md { display: inline; }
  .br-md::after { content: ' '; }
  .br::before { content: ' '; }
}

.scope-note {
  margin-top: 28px;
  font-size: var(--t-small);
  color: var(--c-ink-3);
  max-width: 46em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  padding-top: clamp(3rem, 2rem + 6vh, 7rem);
  padding-bottom: clamp(2rem, 1rem + 4vh, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  column-gap: clamp(8px, 2vw, 32px);
}
.hero__copy { position: relative; z-index: 1; grid-column: 1; grid-row: 1; align-self: center; }
.hero .display { width: max-content; max-width: none; }
.hero .lede { margin-top: 28px; max-width: 29em; }
.stage--hero {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-height: 460px;
  margin: 4% 0 0 4%;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 40px;
}
.cta-row--center { justify-content: center; }

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 12px;
  }
  .stage--hero { grid-column: 1; grid-row: 1; min-height: 0; height: clamp(240px, 40svh, 380px); margin: 0; }
  .hero__copy { grid-row: 2; }
  .hero .display { width: auto; }
  .display .line { white-space: normal; }
}
@media (max-width: 520px) {
  .line-cta { width: 100%; }
  .line-cta__arrow { margin-left: auto; }
  .cta-row .button-ghost { width: 100%; }
}

/* ---------- 1. Roles ---------- */
.roles {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  column-gap: clamp(24px, 5vw, 80px);
  align-items: start;
}
.roles__copy { grid-column: 1; }
.stage--roles {
  grid-column: 2;
  position: sticky;
  top: calc(var(--header-h) + 8vh);
  height: min(72vh, 620px);
}

/* All pills wrap into rows and rotate on their own; the active pill fills as a progress bar. */
.role-strip {
  position: relative;
  margin-top: var(--space-block);
  margin-inline: -6px;
  --fade: 48px;
}
.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
}
.role-tabs::-webkit-scrollbar { display: none; }
.role-tab {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--radius-pill);
  background: var(--c-bg);
  color: var(--c-ink-2);
  font-size: var(--t-small);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(11, 11, 12, 0.06);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.role-tab:hover { border-color: var(--c-ink); color: var(--c-ink); box-shadow: 0 6px 16px -10px rgba(11, 11, 12, 0.5); transform: translateY(-1px); }
.role-tab:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.role-tab:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 3px; }
.role-tab[aria-selected='true'] {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-on-ink);
  box-shadow: none;
  transform: none;
}
/* Progress: a thin bar inside the selected pill fills while its case plays. */
.role-tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
}
.role-tab[aria-selected='true']::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}
.role-tab .icon { width: 18px; height: 18px; }
.role-tab--more { border-style: dashed; border-color: var(--c-ink-3); background: var(--c-surface); color: var(--c-ink); }
.role-tab--more[aria-selected='true'] { border-style: solid; }
.role-tab--more[aria-selected='true']::before, .role-tab--more[aria-selected='true']::after { display: none; }
.role-more-cta { margin-top: 24px; }

.role-panels { margin-top: 36px; min-height: 330px; }
.role-panel { outline-offset: 8px; }
.role-panel.is-entering { animation: panel-in 700ms var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } }
.role-example {
  font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2.15rem);
  line-height: 1.4;
  font-weight: 600;
  text-wrap: balance;
}
.role-points {
  margin-top: 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  color: var(--c-ink-2);
}
.role-points li { position: relative; padding-left: 26px; }
.role-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.8em;
  width: 12px;
  height: 1px;
  background: var(--c-ink);
}
.role-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 28px;
  font-size: var(--t-micro);
  color: var(--c-ink-2);
}
.role-flow span { display: inline-flex; align-items: center; gap: 10px; }
.role-flow span:not(:last-child)::after {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--c-line-strong);
}
.role-flow span::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid var(--c-ink);
}
.role-note { margin-top: 18px; font-size: var(--t-small); color: var(--c-ink-3); }
.no-js .role-panel[hidden] { display: block; margin-top: 40px; }
@media (prefers-reduced-motion: reduce) {
  .role-tab[aria-selected='true']::before, .role-tab[aria-selected='true']::after { display: none; }
  .role-tab, .role-tab:hover { transform: none; }
}

@media (max-width: 900px) {
  /* Heading, tabs, then the live demo right under the tabs, then the details. */
  .roles { display: flex; flex-direction: column; }
  .roles__copy { display: contents; }
  .roles__copy > *, .stage--roles { min-width: 0; width: 100%; }
  .roles .role-strip { width: auto; align-self: stretch; }
  .roles__copy > .eyebrow { order: 1; }
  .roles__copy > .heading { order: 2; }
  .roles__copy > .section-lede { order: 3; }
  .role-strip { order: 4; margin-top: 28px; margin-inline: calc(var(--gutter) * -1); --fade: 32px; }
  .stage--roles { order: 5; position: relative; top: 0; height: clamp(190px, 30svh, 280px); margin-top: 20px; }
  .role-panels { order: 6; }
  .role-tabs { gap: 6px 5px; padding: 6px var(--gutter); }
  .role-tab { min-height: 34px; padding: 0 10px 0 8px; font-size: 0.8125rem; gap: 4px; }
  .role-tab .icon { width: 15px; height: 15px; }
  .role-tab[aria-selected='true']::before, .role-tab[aria-selected='true']::after { left: 11px; right: 11px; bottom: 4px; }
  .role-panels { min-height: 0; margin-top: 20px; }
}

/* ---------- 2. Tools ---------- */
.tools__head { max-width: 760px; }
.stage--bridge { height: clamp(170px, 20vw, 290px); margin: clamp(1.5rem, 3vw, 3rem) 0; }
.app-directory { border-top: 1px solid var(--c-line); }
.app-group {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 16px 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--c-line);
}
.app-group h3 { font-size: var(--t-small); font-weight: 600; color: var(--c-ink-2); padding-top: 8px; }
.app-group ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px 12px; }
.app {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 6px 10px 6px 6px;
  border-radius: 12px;
  font-size: var(--t-small);
  transition: background var(--dur-fast);
}
.app:hover { background: var(--c-surface); }
.app img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.app--custom {
  border: 1px dashed var(--c-line-strong);
  padding: 10px 16px 10px 12px;
  grid-column: span 2;
  color: var(--c-ink-2);
}
@media (max-width: 720px) {
  .app-group { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 20px 0; }
  .app-group h3 { padding-top: 0; }
  .app-group ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app--custom { grid-column: 1 / -1; }
}

/* 3. Support: see the section at the end of this file. */
.support__head { max-width: 780px; }

/* ---------- FAQ ---------- */
.faq__list { margin-top: 32px; border-top: 1px solid var(--c-line); max-width: 900px; }
.faq-item { border-bottom: 1px solid var(--c-line); }
.faq-item summary,
.inline-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.faq-item summary { padding: 22px 0; font-size: 1.125rem; font-weight: 600; }
.faq-item summary::-webkit-details-marker,
.inline-faq summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat;
  transition: transform var(--dur) var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item div { display: grid; gap: 12px; padding: 0 0 26px; color: var(--c-ink-2); max-width: 46em; }
.faq-item strong { color: var(--c-ink); font-weight: 600; margin-right: 6px; }

/* ---------- 5. Closing ---------- */
.closing { text-align: center; padding-bottom: var(--space-section); }
.closing .heading, .closing .section-lede { margin-inline: auto; }
.closing .section-lede { max-width: 30em; }
.stage--closing { height: clamp(220px, 34vh, 380px); max-width: 520px; margin: 0 auto 24px; }

/* ---------- 3. Support: three steps, shared LINE group demo, care by package ---------- */
.support .support__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch;
  margin-top: var(--space-block);
}
.care-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; align-content: start; }
.care-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 26px 0;
  border-top: 1px solid var(--c-line);
}
.care-step:last-child { border-bottom: 1px solid var(--c-line); }
.care-step__no {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-ink);
  color: var(--c-on-ink);
  font-weight: 700;
}
.care-step__when { font-size: var(--t-micro); color: var(--c-ink-3); font-weight: 600; }
.care-step h3 { margin-top: 2px; font-size: 1.3rem; line-height: 1.4; }
.care-step p:not(.care-step__when):not(.care-step__who) { margin-top: 6px; color: var(--c-ink-2); }
.care-step__who { margin-top: 12px; display: flex; gap: 6px; }
.who { font-size: var(--t-micro); font-weight: 600; padding: 2px 12px; border-radius: var(--radius-pill); }
.who--ai { background: var(--c-ink); color: var(--c-on-ink); }
.who--you { background: var(--c-success-bg) !important; color: var(--c-success) !important; border-color: transparent !important; }
.who--team { background: var(--c-info-bg); color: var(--c-info); }
.support .stage--settle { min-height: 520px; }

@media (max-width: 900px) {
  .support .support__grid { grid-template-columns: minmax(0, 1fr); }
  .support .stage--settle { order: 0; min-height: 0; height: 480px; }
}
.support .work-scene--below { inset: 31% 0 0 0; }
.who--you { background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--c-line-strong); }
