/* ============================================================================
   Talkdraft — Minimal UI
   ดีไซน์: สะอาด เรียบ ใช้งานง่าย · พื้นขาว · อักษรเข้ม · accent เดียว (indigo)
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --c-bg: #ffffff;
  --c-bg-soft: #f7f7f8;
  --c-surface: #ffffff;
  --c-text: #18181b;
  --c-text-dim: #71717a;
  --c-border: #e5e7eb;
  --c-border-strong: #d4d4d8;
  --c-accent: #4f46e5;
  --c-accent-hover: #4338ca;
  --c-accent-soft: #eef2ff;
  /* ไล่เฉดสไตล์ Google Gemini (น้ำเงิน → ม่วง → ชมพู) ใช้กับโลโก้/หัวข้อ */
  --grad-gemini: linear-gradient(135deg, #4285f4 0%, #9b72cb 48%, #d96570 100%);
  --c-danger: #dc2626;
  --c-success: #16a34a;
  --c-success-soft: #f0fdf4;
  --c-info-soft: #eff6ff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.18);

  --font: 'Plus Jakarta Sans', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* กันหัวข้อโดน sticky header บัง เวลาเลื่อนด้วยลิงก์ */
}
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
/* ให้แอตทริบิวต์ hidden ชนะ class ที่ตั้ง display (เช่น .gate, .audio-chip, svg) เสมอ */
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* กันคำถูกตัดข้ามบรรทัด (เช่นคำไทยที่ไม่มีช่องว่าง) */
.nowrap {
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--c-bg-soft);
  color: var(--c-text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.05s ease;
  white-space: nowrap;
}
.btn:hover {
  background: #efeff1;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.btn-primary:hover {
  background: var(--c-accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-text);
}
.btn-ghost:hover {
  background: var(--c-bg-soft);
  border-color: var(--c-border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--c-danger);
  border-color: transparent;
}
.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
}
.btn-block {
  width: 100%;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: -0.15em;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad-gemini);
}
.brand-mark svg {
  width: 17px;
  height: 17px;
}

/* ============================================================================
   Landing page
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 2px;
  background: var(--c-surface);
}
.lang-switch button {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-dim);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch button[aria-pressed='true'] {
  background: var(--c-accent);
  color: #fff;
}
.lang-switch button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.hero {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.hero-inner {
  max-width: 720px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.gradient-text {
  background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570, #4285f4);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 7s linear infinite;
}
@keyframes gradientShift {
  to { background-position: 250% center; }
}
.lead {
  margin: 1.25rem auto 0;
  max-width: 600px;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--c-text-dim);
}
.hero-cta {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-cta .btn {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}
.hero-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--c-text-dim);
}

.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
}
.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}
.section-head p {
  margin-top: 0.6rem;
  color: var(--c-text-dim);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.feature-card {
  padding: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  margin-bottom: 1rem;
}
.feature-icon svg {
  width: 22px;
  height: 22px;
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--c-text-dim);
}

.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 740px;
  margin-inline: auto;
}
.price-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.price-card.featured {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent);
  position: relative;
}
.featured-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.price-card h3 {
  font-size: 1.2rem;
}
.price {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  perspective: 600px;
}
.price span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text-dim);
}
.price-features {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.92rem;
  flex: 1;
}
.price-features li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.price-features svg {
  width: 16px;
  height: 16px;
  color: var(--c-success);
  flex-shrink: 0;
}

.site-footer {
  border-top: 1px solid var(--c-border);
  margin-top: 3.5rem;
  padding: 3rem 0 2rem;
}
.site-footer .container {
  display: block;
  font-size: 0.85rem;
  color: var(--c-text-dim);
}

/* ============================================================================
   Auth page
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--c-bg-soft);
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.auth-card .brand {
  justify-content: center;
  font-size: 1.25rem;
}
.tabs {
  display: flex;
  background: var(--c-bg-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-dim);
  padding: 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab[aria-selected='true'] {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
}
.input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: var(--ring);
}
.input:disabled {
  background: var(--c-bg-soft);
}

.alert {
  font-size: 0.88rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.alert-error {
  color: var(--c-danger);
  background: #fef2f2;
  border-color: #fecaca;
}
.alert-success {
  color: var(--c-success);
  background: var(--c-success-soft);
  border-color: #bbf7d0;
}
.alert-info {
  color: #1d4ed8;
  background: var(--c-info-soft);
  border-color: #bfdbfe;
}
.auth-foot {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  text-align: center;
}

.btn-google {
  font-weight: 600;
  padding-block: 0.7rem;
}
.btn-google svg {
  flex-shrink: 0;
}
/* ตัวคั่นในการ์ด auth ให้ระยะห่างพอดี */
.auth-card .divider {
  margin: 0.1rem 0;
}

/* ============================================================================
   App
   ========================================================================== */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--c-text-dim);
  font-size: 0.95rem;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.app-topbar .container {
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.user-email {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  color: var(--c-text-dim);
}
.badge-pro {
  background: var(--c-accent-soft);
  border-color: transparent;
  color: var(--c-accent);
}
.credits-pill {
  color: var(--c-text);
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: 1.5rem 20px 3rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 84px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem;
}
.sidebar h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-dim);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.note-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.empty-hint {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  padding: 0.5rem 0;
}
.note-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: background 0.12s ease;
}
.note-item button:hover {
  background: var(--c-bg-soft);
}
.note-item button.is-active {
  background: var(--c-accent-soft);
}
.note-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-date {
  font-size: 0.75rem;
  color: var(--c-text-dim);
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}
.panel-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Recorder */
.recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}
.record-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: var(--c-accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.record-btn svg {
  width: 30px;
  height: 30px;
}
.record-btn:hover {
  background: var(--c-accent-hover);
}
.record-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.record-btn.is-recording {
  background: var(--c-danger);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(220, 38, 38, 0);
  }
}
.rec-timer {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.rec-hint {
  font-size: 0.88rem;
  color: var(--c-text-dim);
}
.divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--c-text-dim);
  font-size: 0.8rem;
  margin: 0.25rem 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}
.file-pick {
  cursor: pointer;
}
.audio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  font-size: 0.85rem;
  max-width: 100%;
}
.audio-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 0.85rem 1rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
}
.textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: var(--ring);
}

/* ตัวนับตัวอักษร (จำกัด input) */
.char-counter {
  margin-top: 0.35rem;
  text-align: right;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-dim);
  transition: color 0.2s ease;
}
.char-counter.is-full {
  color: var(--c-danger);
  font-weight: 600;
}

/* ============================================================================
   FAQ accordion
   ========================================================================== */
.faq {
  max-width: 760px;
  margin-inline: auto;
}
.faq-item {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item[open] {
  border-color: var(--c-accent);
  box-shadow: var(--shadow);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.05rem 1.25rem;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--c-accent);
  transition: transform 0.25s ease;
  line-height: 1;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item summary:hover {
  color: var(--c-accent);
}
.faq-item summary:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius);
}
.faq-a {
  padding: 0 1.25rem 1.15rem;
  color: var(--c-text-dim);
  line-height: 1.7;
}
.faq-a a {
  color: var(--c-accent);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .faq-item[open] summary::after {
    transition: none;
  }
}

/* Format selector */
.format-grid {
  display: grid;
  /* 5 ฟอร์แมต — desktop ลงตัว 3 คอลัมน์ (3+2), แท็บเล็ต 2, มือถือ 1 */
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
/* desktop กว้างพอ → บังคับ 3 คอลัมน์ ให้แถวสองมี 2 ใบจัดสวย */
@media (min-width: 720px) {
  .format-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.format-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.format-btn svg {
  width: 22px;
  height: 22px;
  color: var(--c-text-dim);
  flex-shrink: 0;
}
.format-btn:hover {
  border-color: var(--c-border-strong);
  background: var(--c-bg-soft);
}
.format-btn[aria-pressed='true'] {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
}
.format-btn[aria-pressed='true'] svg {
  color: var(--c-accent);
}
.fmt-label {
  font-size: 0.92rem;
  font-weight: 600;
}
.fmt-desc {
  font-size: 0.78rem;
  color: var(--c-text-dim);
}

/* Result */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.result-box {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.95rem;
  line-height: 1.7;
  padding: 1.15rem 1.25rem;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  max-height: 460px;
  overflow-y: auto;
}
.result-box:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Toasts */
.toast-wrap {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100vw - 2.5rem);
}
.toast {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #fff;
  background: #27272a;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}
.toast.success {
  background: var(--c-success);
}
.toast.error {
  background: var(--c-danger);
}
.toast.info {
  background: #2563eb;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ============================================================================
   Animations — entrance + scroll reveal
   ========================================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeRight {
  from { opacity: 0; transform: translateX(26px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 30px; }
}
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -16px) scale(1.08); }
}

.anim-in {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero-text .anim-in:nth-child(1) { animation-delay: 0s; }
.hero-text .anim-in:nth-child(2) { animation-delay: 0.08s; }
.hero-text .anim-in:nth-child(3) { animation-delay: 0.16s; }
.hero-text .anim-in:nth-child(4) { animation-delay: 0.24s; }
.hero-text .anim-in:nth-child(5) { animation-delay: 0.32s; }
.anim-in-right {
  opacity: 0;
  animation: fadeRight 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Fly-in reveal variants (ดราม่ากว่า — พุ่งเข้ามา) ---------- */
.reveal.from-left {
  transform: translateX(-70px) scale(0.94);
}
.reveal.from-right {
  transform: translateX(70px) scale(0.94);
}
.reveal.pop {
  transform: translateY(34px) scale(0.9);
}
.reveal.from-left,
.reveal.from-right,
.reveal.pop {
  transition: opacity 0.7s ease, transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0s);
}
.reveal.from-left.is-visible,
.reveal.from-right.is-visible,
.reveal.pop.is-visible {
  transform: none;
}

/* ---------- Showcase section (ทำอะไรได้บ้าง) ---------- */
.showcase {
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-accent-soft) 100%);
}
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}
.showcase-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.4rem;
  text-align: center;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.showcase-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--c-accent);
}
.showcase-emoji {
  font-size: 2.3rem;
  display: block;
  margin-bottom: 0.6rem;
}
.showcase-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.showcase-item p {
  color: var(--c-text-dim);
  font-size: 0.92rem;
}
.showcase-cta {
  text-align: center;
  margin-top: 2.25rem;
}
@media (max-width: 860px) {
  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Hero — two columns + animated mockup
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem);
  text-align: left;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-bg::before,
.hero-bg::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: blob 14s ease-in-out infinite;
}
.hero-bg::before {
  top: -120px;
  right: -60px;
  background: radial-gradient(circle, #c7d2fe, transparent 70%);
}
.hero-bg::after {
  bottom: -160px;
  left: -80px;
  background: radial-gradient(circle, #ddd6fe, transparent 70%);
  animation-delay: -7s;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-text {
  max-width: 560px;
}
.hero-text .lead {
  margin-left: 0;
  margin-right: 0;
}
.hero-text .hero-cta {
  justify-content: flex-start;
}

.hero-visual {
  display: flex;
  justify-content: center;
}
.mock-card {
  width: 100%;
  max-width: 380px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  box-shadow: 0 30px 60px -22px rgba(79, 70, 229, 0.4), 0 10px 30px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.float {
  animation: floaty 5s ease-in-out infinite;
}
.mock-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-soft);
}
.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.mock-title {
  margin-left: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-dim);
}
.mock-body {
  padding: 1.6rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.mock-mic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad-gemini);
  display: grid;
  place-items: center;
  animation: pulse 2s infinite;
}
.mock-mic svg {
  width: 26px;
  height: 26px;
}
.mock-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 34px;
}
.mock-wave span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--c-accent);
  opacity: 0.7;
  animation: wave 1.1s ease-in-out infinite;
}
.mock-wave span:nth-child(5n + 1) { animation-delay: 0s; }
.mock-wave span:nth-child(5n + 2) { animation-delay: 0.12s; }
.mock-wave span:nth-child(5n + 3) { animation-delay: 0.24s; }
.mock-wave span:nth-child(5n + 4) { animation-delay: 0.36s; }
.mock-wave span:nth-child(5n + 5) { animation-delay: 0.48s; }
.mock-arrow {
  color: var(--c-text-dim);
  font-size: 1.2rem;
  line-height: 1;
}
.mock-doc {
  width: 100%;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mock-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
}
.mock-line {
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--c-border-strong), var(--c-border));
}
.mock-line.w100 { width: 100%; }
.mock-line.w90 { width: 90%; }
.mock-line.w85 { width: 85%; }
.mock-line.w75 { width: 75%; }

/* ============================================================================
   Story / Motivation
   ========================================================================== */
.story .section-head .eyebrow {
  margin-bottom: 0.75rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  text-align: center;
}
.stat-n {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-l {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  margin-top: 0.25rem;
  white-space: nowrap; /* ป้ายสถิติอยู่บรรทัดเดียว ไม่ตกบรรทัด */
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.story-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.story-img {
  position: relative;
}
.story-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--c-bg-soft);
}
.img-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.68rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-decoration: none;
  backdrop-filter: blur(2px);
  transition: background 0.15s ease;
}
.img-credit:hover {
  background: rgba(0, 0, 0, 0.75);
}
.story-card figcaption {
  padding: 1.25rem 1.5rem 1.5rem;
}
.story-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.story-card p {
  font-size: 0.92rem;
  color: var(--c-text-dim);
}

/* ============================================================================
   Billing period toggle + Pro price note
   ========================================================================== */
.billing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.billing-toggle {
  position: relative;
  display: inline-flex;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
/* ตัวไฮไลต์ที่เลื่อนตามปุ่มที่เลือก */
.toggle-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 0;
  background: var(--c-surface);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: left 0.32s cubic-bezier(0.2, 0.7, 0.2, 1),
    width 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 0;
}
.billing-toggle button {
  position: relative;
  z-index: 1;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-dim);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  transition: color 0.22s ease;
}
.billing-toggle button.is-active {
  color: var(--c-text);
}

/* ราคา: ตัวอักษรค่อย ๆ ไล่ขึ้นทีละตัว (smooth) */
.price .char {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity, filter;
  animation: charRise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes charRise {
  0% {
    opacity: 0;
    transform: translateY(0.55em) rotateX(-55deg);
    filter: blur(4px);
  }
  60% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
.billing-toggle button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.save-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-success);
  background: var(--c-success-soft);
  border: 1px solid #bbf7d0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.price-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-success);
  margin: 0;
}

/* ============================================================================
   Micro-interactions — ทำให้ลื่นไหลน่าใช้
   ========================================================================== */
/* ปุ่มยกตัวเล็กน้อย + เงานุ่มตอน hover */
.btn {
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary:hover {
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, 0.65);
}
.btn:active {
  transform: translateY(0);
}

/* Header ยกเงาเมื่อเลื่อนหน้า */
.site-header {
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 10px 30px -14px rgba(0, 0, 0, 0.18);
}

/* การ์ดยกตัวตอน hover */
.feature-card,
.price-card,
.story-card {
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s ease,
    border-color 0.18s ease;
}
.feature-card:hover,
.price-card:hover,
.story-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.28);
}

/* รูปในการ์ดเรื่องราว ซูมนุ่ม ๆ ตอน hover */
.story-img {
  overflow: hidden;
}
.story-card img {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.story-card:hover img {
  transform: scale(1.06);
}

/* ปุ่มเลือกฟอร์แมต/ลิงก์ มีจังหวะนุ่มขึ้น */
.format-btn {
  transition: border-color 0.18s ease, background 0.18s ease,
    transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.format-btn:hover {
  transform: translateY(-2px);
}

/* สลับภาษา: cross-fade ทั้งหน้าแบบนุ่ม (หรี่+เบลอเล็กน้อยแล้วเฟดกลับ) ไม่กระตุก */
body {
  transition: opacity 0.2s ease, filter 0.2s ease;
}
body.lang-anim {
  opacity: 0.35;
  filter: blur(3px);
}

/* สลับแพ็กเกจ: ตัวเลขราคา "เฟดเลื่อนเข้า" แทนการเด้งสลับทันที */
@keyframes swapIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.swap-in {
  animation: swapIn 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ปุ่มสลับรอบบิล/ภาษา ให้ active เปลี่ยนนุ่มขึ้น */
.billing-toggle button,
.lang-switch button {
  transition: background 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.22s ease,
    box-shadow 0.22s ease;
}

/* ============================================================================
   Modal — เครดิตหมด (เฟด + สเกลเข้า นุ่ม ๆ)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.modal-overlay.open {
  opacity: 1;
}
.modal {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  position: relative;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.4);
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.28s ease;
}
.modal-overlay.open .modal {
  transform: none;
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--c-bg-soft);
  color: var(--c-text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover {
  background: #ececef;
  color: var(--c-text);
}
.modal-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  animation: floaty 3.5s ease-in-out infinite;
}
.modal-icon svg {
  width: 28px;
  height: 28px;
}
.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}
.modal p {
  color: var(--c-text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ============================================================================
   Intro splash / preloader — โลโก้สเกล+หมุนเข้าแบบ spring แล้วเฟดเผยหน้า
   ========================================================================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  /* พื้นหลังโทนแบรนด์ indigo → violet นุ่ม ๆ */
  background: radial-gradient(120% 120% at 50% 40%, #1e1b4b 0%, #111827 55%, #0b0b12 100%);
  /* ค่าเริ่มต้น (กรณี JS ยังไม่รัน) ให้แสดงได้แต่ไม่ดักคลิกหลังถูกลบ */
  opacity: 1;
  will-change: opacity, transform;
}
/* ล็อกการเลื่อนหน้าระหว่างเล่นอินโทร */
body.intro-lock {
  overflow: hidden;
}

.intro-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}
.intro-mark-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
}

/* โลโก้ไมค์ (สี่เหลี่ยมมุมโค้ง ใหญ่ ~96px) */
.intro-mark {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 26px;
  background: var(--grad-gemini);
  box-shadow: 0 18px 50px -12px rgba(155, 114, 203, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: rotate(-200deg) scale(0);
}
.intro-mark svg {
  width: 48px;
  height: 48px;
}

/* วงแหวนเรืองแสง pulse รอบโลโก้ */
.intro-ring {
  position: absolute;
  z-index: 1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(129, 140, 248, 0.55);
  opacity: 0;
}

/* แท่งคลื่นเสียงใต้โลโก้ (on-brand) */
.intro-wave {
  position: absolute;
  z-index: 0;
  bottom: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 22px;
  opacity: 0;
}
.intro-wave span {
  width: 4px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, #a5b4fc, #6366f1);
}

/* wordmark "Talkdraft" */
.intro-word {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  opacity: 0;
  transform: translateY(14px);
}

/* ----- เล่นอินโทร ----- */
.intro.is-playing .intro-mark {
  animation: introMarkIn 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    introMarkBob 2.4s ease-in-out 1s infinite;
}
.intro.is-playing .intro-ring {
  animation: introRing 1.6s ease-out 0.55s infinite;
}
.intro.is-playing .intro-wave {
  animation: introWaveShow 0.4s ease forwards 0.7s;
}
.intro.is-playing .intro-wave span {
  animation: introWaveBar 0.9s ease-in-out infinite;
}
.intro.is-playing .intro-wave span:nth-child(1) { animation-delay: 0s; }
.intro.is-playing .intro-wave span:nth-child(2) { animation-delay: 0.08s; }
.intro.is-playing .intro-wave span:nth-child(3) { animation-delay: 0.16s; }
.intro.is-playing .intro-wave span:nth-child(4) { animation-delay: 0.24s; }
.intro.is-playing .intro-wave span:nth-child(5) { animation-delay: 0.32s; }
.intro.is-playing .intro-wave span:nth-child(6) { animation-delay: 0.4s; }
.intro.is-playing .intro-wave span:nth-child(7) { animation-delay: 0.48s; }
.intro.is-playing .intro-word {
  animation: introWord 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards 0.85s;
}

/* ----- ออก: เฟด + สเกลขึ้นเล็กน้อย เผยหน้าเว็บ ----- */
.intro {
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1),
    visibility 0.6s;
}
.intro.is-leaving {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
  visibility: hidden;
}

@keyframes introMarkIn {
  0% {
    transform: rotate(-200deg) scale(0);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}
@keyframes introMarkBob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
@keyframes introRing {
  0% {
    opacity: 0.8;
    transform: scale(0.85);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}
@keyframes introWaveShow {
  to { opacity: 0.9; }
}
@keyframes introWaveBar {
  0%, 100% { height: 6px; }
  50% { height: 20px; }
}
@keyframes introWord {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ปิดการเลื่อนแบบนุ่มเมื่อผู้ใช้ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* อินโทร: ไม่เล่นแอนิเมชันเลย (JS จะลบ overlay ทิ้งทันทีอยู่แล้ว) */
  .intro {
    display: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text {
    max-width: none;
    margin-inline: auto;
  }
  .hero-text .lead {
    margin-inline: auto;
  }
  .hero-text .hero-cta {
    justify-content: center;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hide-mobile {
    display: none;
  }
}

@media (max-width: 820px) {
  .app-main {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    order: 2;
  }
  .user-email {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================================
   Input mode tabs (เสียง / ข้อความ) — สลับด้วยตัวไฮไลต์เลื่อนนุ่ม ๆ
   ========================================================================== */
.mode-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}
.mode-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 6px);
  background: var(--c-surface);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 0;
}
.mode-tabs[data-mode='text'] .mode-thumb {
  transform: translateX(calc(100% + 4px));
}
.mode-tab {
  position: relative;
  z-index: 1;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-dim);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  transition: color 0.22s ease;
}
.mode-tab[aria-selected='true'] {
  color: var(--c-text);
}
.mode-tab:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* แต่ละโหมดเฟดเข้าตอนสลับ */
.mode-pane {
  animation: fadeUp 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ปุ่มดาวน์โหลดเสียงเล็ก ๆ ในชิป */
.audio-chip .chip-action {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--c-text-dim);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.audio-chip .chip-action:hover {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  transform: translateY(-1px);
}
.audio-chip .chip-action:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.audio-chip .chip-action svg {
  width: 15px;
  height: 15px;
}

/* ============================================================================
   Processing overlay — สถานะกำลังประมวลผล + ตัวนับวินาที (elapsed)
   วางคลุมพาเนลที่กำลังทำงาน (ต้องมี position: relative บนพาเนลนั้น)
   ========================================================================== */
.panel {
  position: relative;
}
.proc-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px) saturate(120%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.proc-overlay.show {
  opacity: 1;
}
/* วงแหวนหมุน + จุดวิ่ง (high-quality spinner) */
.proc-ring {
  position: relative;
  width: 54px;
  height: 54px;
}
.proc-ring::before,
.proc-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}
.proc-ring::before {
  border-color: var(--c-accent-soft);
}
.proc-ring::after {
  border-top-color: var(--c-accent);
  border-right-color: var(--c-accent);
  animation: spin 0.85s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
.proc-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.proc-time {
  font-variant-numeric: tabular-nums;
  color: var(--c-accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 2.6em;
  text-align: left;
}
/* แถบ shimmer บาง ๆ ใต้ข้อความ ให้รู้สึกมีชีวิต */
.proc-bar {
  width: 160px;
  max-width: 60%;
  height: 4px;
  border-radius: 999px;
  background: var(--c-accent-soft);
  overflow: hidden;
}
.proc-bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
  animation: procSlide 1.1s ease-in-out infinite;
}
@keyframes procSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(330%); }
}

/* ============================================================================
   Format lock (free tier) — ปุ่มฟอร์แมตที่ถูกล็อก
   ========================================================================== */
.format-btn.is-locked {
  cursor: not-allowed;
  opacity: 0.65;
}
.format-btn.is-locked:hover {
  transform: none;
  border-color: var(--c-border);
  background: var(--c-surface);
}
.format-btn .lock-ic {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--c-text-dim);
  flex-shrink: 0;
}
.format-btn:not(.is-locked) .lock-ic {
  display: none;
}

/* ============================================================================
   Account page
   ========================================================================== */
.account-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg-soft);
}
.account-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3rem) 20px 3rem;
}
.account-head {
  text-align: center;
  margin-bottom: 1.75rem;
}
.account-head h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
}
.account-head p {
  margin-top: 0.5rem;
  color: var(--c-text-dim);
}
.account-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.account-plan-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--c-accent-soft);
  border: 1px solid transparent;
}
.account-plan-banner .plan-emoji {
  font-size: 1.9rem;
  line-height: 1;
}
.account-plan-banner .plan-text {
  min-width: 0;
}
.account-plan-banner .plan-name {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.account-plan-banner .plan-desc {
  font-size: 0.88rem;
  color: var(--c-text-dim);
  margin-top: 0.15rem;
}
.account-rows {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--c-border);
}
.account-row:last-child {
  border-bottom: none;
}
.account-row .row-label {
  font-size: 0.85rem;
  color: var(--c-text-dim);
}
.account-row .row-value {
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.account-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.account-foot a,
.account-foot button {
  font-size: 0.85rem;
}

/* ============================================================================
   Pricing page (dedicated) — 3 tier cards
   ========================================================================== */
.pricing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.pricing-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 3.5rem) 20px 4rem;
}
.pricing-head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
}
.pricing-head h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
}
.pricing-head p {
  margin-top: 0.6rem;
  color: var(--c-text-dim);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 980px;
  margin-inline: auto;
  align-items: stretch;
}
.tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.85rem 1.6rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s ease,
    border-color 0.18s ease;
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: var(--d, 0s);
}
.tier-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px -24px rgba(0, 0, 0, 0.3);
}
.tier-card.featured {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent);
}
.tier-card.featured:hover {
  box-shadow: 0 0 0 1px var(--c-accent), 0 22px 48px -22px rgba(79, 70, 229, 0.45);
}
.tier-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}
.tier-badge.popular {
  color: #fff;
  background: var(--c-accent);
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.7);
}
.tier-badge.save {
  color: var(--c-success);
  background: var(--c-success-soft);
  border: 1px solid #bbf7d0;
}
.tier-name {
  font-size: 1.15rem;
  font-weight: 700;
}
.tier-price {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tier-amount {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.tier-suffix {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--c-text-dim);
}
.tier-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-success);
  min-height: 1.1em;
}
.tier-features {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.92rem;
  flex: 1;
}
.tier-features li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.tier-features svg {
  width: 16px;
  height: 16px;
  color: var(--c-success);
  flex-shrink: 0;
}
.tier-cancel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--c-text-dim);
  justify-content: center;
}
.tier-cancel svg {
  width: 14px;
  height: 14px;
  color: var(--c-success);
}

/* confirm modal — reuse .modal-overlay/.modal, ปุ่มเรียงแถว */
.modal-actions {
  display: flex;
  gap: 0.6rem;
}
.modal-actions .btn {
  flex: 1;
}
.modal .modal-price {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.modal .modal-price small {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-dim);
}

/* ปุ่มกลับเล็ก ๆ ที่หัวหน้า pricing/account */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-dim);
  transition: color 0.15s ease, gap 0.15s ease;
}
.back-link:hover {
  color: var(--c-text);
  gap: 0.5rem;
}
.back-link svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  .account-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .account-row .row-value {
    text-align: left;
  }
}

/* ============================================================================
   Panel reveal animation — ขั้นตอนถัดไปเลื่อนขึ้น + จาง เข้ามาอย่างลื่นไหล
   ========================================================================== */
@keyframes vfPanelReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel.revealed {
  animation: vfPanelReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ผลลัพธ์ค่อย ๆ จางเข้า */
@keyframes vfFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.panel.revealed .result-box {
  animation: vfFadeIn 0.6s ease 0.1s both;
}

/* การ์ดราคา/ฟอร์แมต ยกตัวตอน hover (เฉพาะอุปกรณ์ที่ชี้ได้ — desktop) */
@media (hover: hover) and (pointer: fine) {
  .format-btn:not(.is-locked):hover {
    transform: translateY(-3px);
  }
  .format-btn {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.revealed,
  .panel.revealed .result-box {
    animation: none;
  }
  .format-btn:hover {
    transform: none;
  }
}

/* ============================================================================
   Document upload (text mode) — ปุ่ม + chip สถานะ
   ========================================================================== */
.doc-upload {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.file-pick.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.4rem 0.55rem 0.4rem 0.7rem;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 0.85rem;
  animation: vfChipIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes vfChipIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.doc-chip .doc-file-ic {
  color: var(--c-text-dim);
  flex-shrink: 0;
}
.doc-chip .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.doc-chip .doc-status {
  color: var(--c-text-dim);
  font-size: 0.78rem;
  white-space: nowrap;
}
.doc-spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================================
   Flow section — inputs → Talkdraft AI → outputs (พูดออกไป ได้คอนเทนต์จริง ๆ)
   ========================================================================== */
.flow-section {
  position: relative;
  overflow: hidden;
}
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px auto 80px minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
  max-width: 980px;
  margin: 0 auto;
}
.flow-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.flow-outputs { align-items: stretch; }
.flow-col-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 0.15rem;
}
.flow-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 0.95rem;
  /* เริ่มซ่อน แล้วเผยตอน section visible */
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease, box-shadow 0.25s ease;
  transition-delay: calc(0.12s + var(--i, 0) * 0.08s);
}
.flow-chip-out {
  transform: translateX(14px);
}
.flow .reveal.is-visible .flow-chip,
.reveal.is-visible .flow-chip {
  opacity: 1;
  transform: none;
}
.flow-emoji {
  font-size: 1.25rem;
  line-height: 1;
  width: 1.6rem;
  text-align: center;
  flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
  .flow-chip:hover {
    border-color: var(--c-border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
  }
}

/* connectors — เส้นโค้งเชื่อมแบบ SVG */
.flow-conn {
  align-self: stretch;
  min-height: 160px;
  display: flex;
}
.flow-conn svg {
  width: 100%;
  height: 100%;
}
.flow-path {
  stroke: var(--c-border-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 7;
  opacity: 0.55;
}
.reveal.is-visible .flow-path {
  animation: flowDash 1.1s linear infinite;
}
@keyframes flowDash {
  to { stroke-dashoffset: -26; }
}

/* core: Talkdraft AI */
.flow-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.05s;
}
.reveal.is-visible .flow-core {
  opacity: 1;
  transform: none;
}
.flow-core-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: var(--grad-gemini);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.9;
}
.flow-core-glow::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: var(--grad-gemini);
  filter: blur(26px);
  opacity: 0.18;
  z-index: -1;
  border-radius: 50%;
  animation: flowCorePulse 4s ease-in-out infinite;
}
@keyframes flowCorePulse {
  0%, 100% { opacity: 0.14; transform: scale(0.95); }
  50% { opacity: 0.28; transform: scale(1.08); }
}
.flow-core-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad-gemini);
  box-shadow: 0 6px 18px rgba(155, 114, 203, 0.35);
}
.flow-core-mark svg {
  width: 24px;
  height: 24px;
}
.flow-core-title {
  font-weight: 800;
  font-size: 1.02rem;
}
.flow-core-sub {
  font-size: 0.74rem;
  color: var(--c-text-dim);
}

/* responsive: ซ้อนแนวตั้งบนจอแคบ — ซ่อน connector โค้ง ใช้เส้นแนวตั้งแทน */
@media (max-width: 820px) {
  .flow {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    max-width: 420px;
  }
  .flow-conn {
    min-height: 0;
    height: 34px;
    justify-content: center;
  }
  .flow-conn svg {
    width: 34px;
    height: 100%;
    transform: rotate(90deg);
  }
  .flow-core {
    justify-self: center;
  }
  .flow-chip {
    transform: translateY(12px);
  }
  .flow-chip-out {
    transform: translateY(12px);
  }
}

/* ============================================================================
   Site-wide micro-animations — hover/press polish (transform/opacity only)
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .feature-card {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.25s ease, border-color 0.2s ease;
  }
  .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
  .price-card {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.25s ease;
  }
  .price-card:hover {
    transform: translateY(-4px);
  }
  .btn {
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
      background 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease,
      color 0.18s ease;
  }
  .btn:hover {
    transform: translateY(-2px);
  }
  .stat:hover .stat-n {
    transform: scale(1.06);
  }
  .stat-n {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
/* กดแล้วเด้งลงนิด ๆ ให้รู้สึก tactile */
.btn:active {
  transform: translateY(0) scale(0.98);
}
.format-btn:active {
  transform: scale(0.98);
}

/* แตะ brand mark → sheen วิ่งผ่านโลโก้บนหัว landing */
.site-header .brand-mark {
  position: relative;
  overflow: hidden;
}
.site-header .brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.6s ease;
}
.site-header .brand:hover .brand-mark::after {
  transform: translateX(130%);
}

@media (prefers-reduced-motion: reduce) {
  .flow-chip,
  .flow-chip-out,
  .flow-core {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .flow-path {
    animation: none !important;
  }
  .flow-core-glow::before {
    animation: none !important;
  }
}

/* ============================================================================
   Footer — link columns (discoverability + internal linking)
   ========================================================================== */
.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem 2rem;
  padding: 0.5rem 0 2.25rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 1.75rem;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-col-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text);
  margin-bottom: 0.15rem;
}
.footer-col a {
  font-size: 0.88rem;
  color: var(--c-text-dim);
  width: fit-content;
  transition: color 0.15s ease;
}
.footer-col a:hover {
  color: var(--c-accent);
}
.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--c-text-dim);
}

/* ============================================================================
   Use-case landing pages — focused hero, benefits, how-it-works, CTA
   ========================================================================== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page > main {
  flex: 1;
}

/* Focused hero (single column, centered) */
.uc-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.uc-hero .container {
  max-width: 760px;
  position: relative;
  z-index: 1;
}
.uc-hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-top: 1.1rem;
}
.uc-hero .lead {
  margin-left: auto;
  margin-right: auto;
}
.uc-hero .hero-cta {
  justify-content: center;
}

/* Benefits grid */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.benefit-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.4rem 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease,
    border-color 0.18s ease;
}
.benefit-card:hover {
  transform: translateY(-4px);
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow);
}
.benefit-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.benefit-ic svg {
  width: 21px;
  height: 21px;
}
.benefit-card h3 {
  font-size: 1.05rem;
}
.benefit-card p {
  font-size: 0.9rem;
  color: var(--c-text-dim);
}

/* How it works — 3 numbered steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 920px;
  margin-inline: auto;
  counter-reset: step;
}
.step-card {
  position: relative;
  padding: 1.5rem 1.5rem 1.4rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-gemini);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.85rem;
}
.step-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.step-card p {
  font-size: 0.9rem;
  color: var(--c-text-dim);
}

/* CTA band */
.cta-band {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  background: var(--c-bg-soft);
}
.cta-band .container {
  max-width: 640px;
}
.cta-band h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}
.cta-band p {
  margin: 0.6rem auto 1.75rem;
  color: var(--c-text-dim);
  max-width: 480px;
}

/* ============================================================================
   Blog — index cards + article (prose)
   ========================================================================== */
.blog-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}
.blog-head h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.blog-head p {
  margin-top: 0.7rem;
  color: var(--c-text-dim);
  font-size: clamp(0.98rem, 2vw, 1.1rem);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1000px;
  margin-inline: auto;
}
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.6rem 1.6rem 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease,
    border-color 0.18s ease;
}
.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--c-border-strong);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.28);
}
.blog-card .blog-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}
.blog-card h2 {
  font-size: 1.2rem;
  line-height: 1.35;
}
.blog-card p {
  font-size: 0.92rem;
  color: var(--c-text-dim);
  flex: 1;
}
.blog-card .blog-meta {
  font-size: 0.8rem;
  color: var(--c-text-dim);
}
.blog-card .blog-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.15s ease;
}
.blog-card:hover .blog-more {
  gap: 0.55rem;
}

/* Article / prose */
.article {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem) 20px clamp(2.5rem, 6vw, 4rem);
}
.article-header {
  margin-bottom: 2rem;
}
.article-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.article-header h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.article-meta {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--c-text-dim);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-border-strong);
}
.prose {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #27272a;
}
.prose > * + * {
  margin-top: 1.15rem;
}
.prose h2 {
  font-size: clamp(1.35rem, 3.2vw, 1.7rem);
  margin-top: 2.4rem;
  letter-spacing: -0.02em;
}
.prose h3 {
  font-size: 1.18rem;
  margin-top: 1.8rem;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.prose li {
  line-height: 1.7;
}
.prose strong {
  font-weight: 700;
  color: var(--c-text);
}
.prose a {
  color: var(--c-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.prose a:hover {
  color: var(--c-accent-hover);
}
/* ปุ่มในบทความ: ไม่ให้สไตล์ลิงก์ของ .prose มาทับ (กันตัวอักษรหายบนพื้นปุ่ม) */
.prose a.btn {
  text-decoration: none;
}
.prose a.btn-primary {
  color: #fff;
}
.prose a.btn-primary:hover {
  color: #fff;
}
.prose a.btn-ghost {
  color: var(--c-text);
}

/* ============================================================================
   Dramatic entrances สำหรับหน้า SEO (landing/blog — body.page)
   ========================================================================== */
.page .reveal {
  transform: translateY(48px) scale(0.96);
  transition: opacity 0.75s ease,
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}
.page .reveal.is-visible {
  transform: none;
}
/* hero: ไล่เข้าทีละบรรทัด + เบลอจางเข้า */
.page .uc-hero .anim-in {
  animation: vfHeroIn 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.page .uc-hero .anim-in:nth-child(1) { animation-delay: 0.02s; }
.page .uc-hero .anim-in:nth-child(2) { animation-delay: 0.12s; }
.page .uc-hero .anim-in:nth-child(3) { animation-delay: 0.24s; }
.page .uc-hero .anim-in:nth-child(4) { animation-delay: 0.36s; }
.page .uc-hero .anim-in:nth-child(5) { animation-delay: 0.46s; }
@keyframes vfHeroIn {
  from {
    opacity: 0;
    transform: translateY(42px) scale(0.92);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
/* การ์ดในบทความ/หน้า hover ยกเด่นขึ้น */
.page .benefit-card,
.page .blog-card,
.page .step-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s ease, border-color 0.2s ease;
}
.page .benefit-card:hover,
.page .blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) {
  .page .uc-hero .anim-in {
    animation: none;
  }
  .page .reveal,
  .page .benefit-card,
  .page .blog-card,
  .page .step-card {
    transition: none;
  }
  .page .benefit-card:hover,
  .page .blog-card:hover {
    transform: none;
  }
}
.prose blockquote {
  border-left: 3px solid var(--c-accent);
  padding: 0.4rem 0 0.4rem 1.1rem;
  color: var(--c-text-dim);
  font-style: italic;
}
/* In-article CTA box */
.article-cta {
  margin-top: 2.5rem;
  padding: 1.6rem 1.6rem 1.7rem;
  background: var(--c-accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: center;
}
.article-cta h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.article-cta p {
  font-size: 0.92rem;
  color: var(--c-text-dim);
  margin-bottom: 1.1rem;
}
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-dim);
  margin-bottom: 1.5rem;
  transition: color 0.15s ease, gap 0.15s ease;
}
.back-to-blog:hover {
  color: var(--c-text);
  gap: 0.5rem;
}
.back-to-blog svg {
  width: 15px;
  height: 15px;
}
