:root {
  --black: #1a1a1a;
  --white: #ffffff;
  --off-white: #faf9f7;
  --muted: #888888;
  --border: #eeeeee;
}

html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
  background-color: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

/* All text uses Inter — headings are 700, not 900 */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.025em; }
.logo { font-weight: 700; letter-spacing: -0.03em; }

/* ── Navigation ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  height: 64px;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s;
}

.logo { font-size: 1.1rem; text-decoration: none; color: var(--black); }
.nav-right { display: flex; align-items: center; gap: 20px; height: 100%; }
.lang-switch { display: flex; align-items: center; gap: 4px; height: 32px; }
.lang-switch { font-size: 0.82rem; font-weight: 500; }
.lang-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-family: inherit; font-size: inherit; }
.lang-btn--active { color: var(--black); font-weight: 600; }

.nav-cta {
  background: var(--black);
  color: var(--white);
  padding: 0 12px;
  height: 40px;
  min-width: 120px;
  justify-content: center;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { opacity: 0.8; }
.nav-cta .arrow-pill {
  font-size: 0.85rem;
  transition: transform 0.2s;
}
.nav-cta:hover .arrow-pill { transform: translateX(2px); }


/* ── Hero ── */
.hero {
  padding: 100px 24px 80px;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-bottom: 24px;
}

.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--muted);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 40px;
  font-weight: 400;
}

.btn-primary {
  background: var(--black);
  color: white;
  padding: 0 22px;
  height: 50px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  letter-spacing: -0.01em;
}
.btn-primary:hover { opacity: 0.85; }

.arrow-circle {
  font-size: 1rem;
  transition: transform 0.2s;
  display: inline-block;
}
.btn-primary:hover .arrow-circle { transform: translateX(3px); }


/* ── Carousel ── */
.carousel-section { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.carousel-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; }
.carousel-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }

.personas-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}


/* Image-first card — 4:3 landscape */

.p-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--white);
  aspect-ratio: 4/5;
  background: #1a1a1a;
  transition: transform 0.25s, box-shadow 0.25s;
  display: block;
}
.p-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(0,0,0,0.15); }

/* Background image */
.p-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
  transform: translateZ(0);
  backface-visibility: hidden;
  image-rendering: auto;
}
.p-card:hover .p-card-img { transform: scale(1.03); }

/* Dark gradient overlay */
.p-card-overlay {
position: absolute;
inset: 0;
background: linear-gradient(
  to top, 
  rgba(0,0,0,0.75) 0%,  
  rgba(0,0,0,0.35) 15%, 
  rgba(0,0,0,0) 25%   
);
}

/* Status badge — top right */
.p-card-status {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px;
  padding: 4px 10px;
  color: rgba(255,255,255,0.9);
  z-index: 2;
}
.p-card-status.alpha {
  background: rgba(0,0,0,0.25);
  border-color: rgba(212,175,55,0.75);
  color: rgb(212,175,55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Bottom text area */
.p-card-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 2;
}

/* Category badge — small, above name */
.p-card-cat {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}
.p-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.p-card-desc {
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.68;
  font-weight: 400;
  margin-top: 1px;
}

/* ── Directory ── */
.all-personas-section { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.directory-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.directory-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.directory-filters { display: flex; gap: 6px; flex-wrap: wrap; }

.fbtn { padding: 5px 14px; border-radius: 100px; font-size: 0.8rem; font-weight: 500; font-family: inherit; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: all 0.2s; }
.fbtn:hover { border-color: var(--black); color: var(--black); }
.fbtn--active { background: var(--black); color: var(--white); border-color: var(--black); }


/* Avatar */
.ap-avatar {
  width: 64px; height: 64px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e8e8;
  display: flex; align-items: center; justify-content: center;
}
.ap-avatar img {
width: 100%;
height: 100%;
object-fit: cover; 
}

.ap-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--black);
  transition: opacity 0.2s;
}
.ap-row.col-right {
  padding: 24px 0;
}
.ap-row:hover { opacity: 0.5; }
.ap-row.dimmed { opacity: 0.4; cursor: not-allowed; }
.ap-row.dimmed:hover { opacity: 0.4; }

.directory-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  position: relative;
}

.ap-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-cats { display: flex; gap: 4px; flex-wrap: wrap; }
.ap-cat {
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.03em;
  color: var(--muted); background: var(--off-white);
  border: 1px solid var(--border); border-radius: 100px;
  padding: 1px 7px;
}
.ap-name { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.ap-sub { font-size: 0.78rem; color: var(--muted); font-weight: 400; }

.ap-tags { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ap-status-alpha {
  font-size: 0.72rem; font-weight: 600;
  color: rgb(212,175,55);
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 4px;
}
.ap-status-alpha .arr { font-size: 0.8rem; transition: transform 0.2s; }
.ap-row:hover .ap-status-alpha .arr { transform: translateX(3px); }
.ap-status-soon {
  font-size: 0.72rem; font-weight: 400;
  color: #bbb; letter-spacing: 0.02em;
}

/* ── See it in action ── */
.action-section { background: var(--off-white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 80px 0; overflow: hidden; }
.action-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.action-header { margin-bottom: 40px; }
.action-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.action-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.025em; }
.action-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 0 4px; }

.action-card { background: white; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; min-height: 350px; position: relative; }
.action-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 24px;
  background: white;
  pointer-events: none;
  z-index: 10;
}
.action-chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px 0; overflow-y: auto; max-height: 336px; scrollbar-width: none; }
.action-chat::-webkit-scrollbar { display: none; }

.action-card-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: white; }
.action-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.8); flex-shrink: 0; }
.action-persona-name { font-size: 0.8rem; font-weight: 600; }
.action-persona-name span { font-weight: 400; color: var(--muted); }

.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-row.user { flex-direction: row-reverse; }
.chat-av { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.8); }
.chat-bubble { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 0.8rem; line-height: 1.55; }
.chat-bubble.ai { background: #f2f2f2; color: var(--black); border-bottom-left-radius: 4px; }
.chat-bubble.user { background: var(--black); color: white; border-bottom-right-radius: 4px; }

/* typing dots */
.chat-bubble.typing {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; min-width: 44px; min-height: 38px;
}
.chat-bubble.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.7);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Thay LINE flex card */
.thay-flex-wrap { position: relative; background: white; border: 1px solid var(--border); border-bottom: none; border-radius: 14px 14px 0 0; margin-top: 0; max-width: 82%; width: 100%; min-width: 0; }
.thay-flex { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 3px; }
.thay-flex-tag { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 100px; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; align-self: flex-start; margin-bottom: 3px; }
.thay-flex-ticker-row { display: flex; align-items: center; gap: 5px; margin-bottom: 0; }
.thay-flex-ticker { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; color: #111; }
.thay-flex-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 1px; margin-bottom: 1px; }
.thay-flex-price { font-size: 1.9rem; font-weight: 800; color: #111; letter-spacing: -0.03em; line-height: 1; }
.thay-flex-change { font-size: 0.82rem; font-weight: 700; color: #16a34a; }
.thay-flex-after { font-size: 0.65rem; color: #888; display: flex; align-items: center; margin-bottom: 6px; }
.thay-flex-bar-wrap { margin-top: 8px; padding-bottom: 4px; }
.thay-flex-bar-track { position: relative; height: 3px; background: #e5e7eb; border-radius: 2px; margin-bottom: 7px; }

.thay-bar-level { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; border: 1.5px solid white; }
.thay-bar-dark { background: #111 !important; }
.thay-bar-pivot { background: #9ca3af !important; }
.thay-flex-bar-dot { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 10px; height: 10px; border-radius: 50%; background: #667eea; border: 2px solid white; box-shadow: 0 0 0 1.5px #667eea; z-index: 1; }
.thay-flex-bar-labels { display: flex; justify-content: space-between; font-size: 0.58rem; color: #aaa; font-weight: 500; margin-top: 6px; }
.thay-flex-bar-labels span { text-align: center; width: 14%; }
.thay-flex-bar-labels span:first-child { text-align: left; }
.thay-flex-bar-labels span:last-child { text-align: right; }

/* Tawan action result card */
.tawan-flex-wrap { background: white; border: 1px solid var(--border); border-bottom: none; border-radius: 14px 14px 0 0; max-width: 82%; width: 100%; min-width: 0; }
.tawan-flex { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.tawan-badge { display: inline-flex; align-items: center; gap: 5px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 100px; padding: 3px 9px; align-self: flex-start; margin-bottom: 10px; }
.tawan-status-dot { width: 5px; height: 5px; border-radius: 50%; background: #16a34a; flex-shrink: 0; }
.tawan-badge span:last-child { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #16a34a; }
.tawan-shop-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.tawan-shop-name { font-size: 0.78rem; font-weight: 700; color: #111; }
.tawan-section { display: flex; flex-direction: column; gap: 6px; }
.tawan-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #bbb; }
.tawan-hero-row { display: flex; align-items: center; gap: 10px; }
.tawan-hero-num { font-size: 2.2rem; font-weight: 800; color: #111; letter-spacing: -0.03em; line-height: 1; flex-shrink: 0; }
.tawan-hero-sub { display: flex; flex-direction: column; gap: 2px; }
.tawan-hero-sub span:first-child { font-size: 0.75rem; font-weight: 500; color: #555; }
.tawan-hero-reason { font-size: 0.62rem; color: #aaa; }
.tawan-divider { height: 1px; background: var(--border); margin: 8px 0; }
.tawan-channels { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 6px; }
.tawan-ch-logo { width: 26px; height: 26px; border-radius: 7px; background: #f0f0f0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tawan-ch-logo img { width: 100%; height: 100%; object-fit: contain; }
.tawan-preview { font-size: 0.72rem; color: #555; line-height: 1.5; font-style: italic; }

/* Grace map card */
.grace-map-card { max-width: 65%; width: 100%; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: white; }
.grace-map-img { height: 90px; background: #e8e0f0; overflow: hidden; }
.grace-map-img img { width: 100%; height: 100%; object-fit: cover; }
.grace-map-info { padding: 7px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.grace-map-name { font-size: 0.75rem; font-weight: 700; color: #111; }
.grace-map-meta { font-size: 0.6rem; color: #888; }
.grace-map-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.grace-map-tag { font-size: 0.58rem; font-weight: 600; color: #16a34a; }
.grace-map-link { font-size: 0.58rem; font-weight: 700; color: #6366f1; cursor: pointer; }


/* ── Framework ── */
.framework-section { max-width: 1200px; margin: 0 auto; padding: 80px 24px 80px; }
.fw-header { margin-bottom: 6px; }
.fw-sub { font-size: 1rem; color: var(--muted); text-align: center; margin-top: 12px; margin-bottom: 0; line-height: 1.6; }
.fw-statement { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; text-align: center; margin-bottom: 8px; }

/* Unified bento grid */
.fw-unified-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.fw-cell {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 300px;
}

/* Unified size variants */
.fw-cell.uc-half { grid-column: span 6; min-height: 500px; }
.fw-cell.uc-half.persona { 
  overflow: hidden;
}
.fw-cell.uc-wide   { grid-column: span 8; }
.fw-cell.uc-narrow { grid-column: span 4; }
.fw-cell.uc-full   { grid-column: span 12; min-height: 300px; }

/* Expert visual — data panel + answer card on navy */
.fw-expert-noise-card {
  position: absolute;
  top: 56px;
  left: -16px;
  width: 80%;
  bottom: -24px;
  background: #111;
  border-radius: 0 16px 0 0;
  padding: 14px 14px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Data panel styles */
.fw-json-dump {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.55);
  word-break: break-all;
}
.fw-json-dump .jk { color: rgba(255,255,255,0.28); }
.fw-json-dump .jr { color: rgba(239,68,68,0.85); }
.fw-json-dump .jg { color: rgba(34,197,94,0.8); }
.fw-json-dump .jy { color: rgba(253,230,138,0.8); }

.fw-data-panel-label {
  font-size: 0.42rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  font-family: 'Inter', sans-serif;
}
.fw-data-panel-header {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.fw-data-panel-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; font-weight: 700; color: white;
  letter-spacing: 0.04em;
}
.fw-data-panel-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; font-weight: 600; color: rgba(255,255,255,0.6);
}
.fw-data-section-label {
  font-size: 0.42rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  font-family: 'Inter', sans-serif;
  margin-top: 8px; margin-bottom: 2px;
}
.fw-data-ticker-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.fw-data-ticker-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem; font-weight: 700; color: rgba(255,255,255,0.75);
}
.fw-data-ticker-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem; font-weight: 700; color: rgba(255,255,255,0.9);
}
.fw-data-ticker-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem; font-weight: 600;
}
.fw-data-ticker-change.up { color: #22c55e; }
.fw-data-ticker-change.dn { color: #ef4444; }
.fw-data-metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5px 12px; margin-top: 2px;
}
.fw-data-metric-row { display: flex; justify-content: space-between; align-items: baseline; }
.fw-data-metric-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.48rem; color: rgba(255,255,255,0.3);
}
.fw-data-metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem; font-weight: 700; color: rgba(255,255,255,0.7);
}
.fw-data-metric-val.r { color: #ef4444; }
.fw-data-metric-val.g { color: #22c55e; }
.fw-data-metric-val.y { color: rgba(253,230,138,0.8); }

.fw-expert-answer {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 38%;
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 10;
}
.fw-ea-header { display: flex; align-items: center; gap: 7px; }
.fw-ea-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.46rem; font-weight: 700; color: white;
  flex-shrink: 0;
}
.fw-ea-name { font-size: 0.58rem; font-weight: 700; color: #111; }
.fw-ea-divider { height: 1px; background: #f0f0f0; }
.fw-ea-text { font-size: 0.6rem; color: #333; line-height: 1.55; font-style: italic; }
.fw-ea-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.fw-ea-tag {
  font-size: 0.44rem; font-weight: 700;
  background: linear-gradient(135deg, #1e3a5f, #0f2040);
  color: white; padding: 2px 7px; border-radius: 99px;
}

/* Personal = light */
.fw-cell.persona {
  background: white;
  border-color: var(--border);
}
.fw-cell.persona .fw-cell-img { background: #e2e0db; }
.fw-cell.persona .fw-cell-text { background: white !important; }
.fw-cell.persona .fw-cell-title { color: var(--black); }
.fw-cell.persona .fw-cell-desc { color: var(--muted); }

/* Expert = dark */
.fw-cell.expert {
  background: white;
  border-color: var(--border);
  overflow: hidden;
}
.fw-cell.expert .fw-cell-img { background: #1a1a1a; }
.fw-cell.expert .fw-cell-img-label { color: #2e2e2e; }
.fw-cell.expert .fw-cell-text { background: white !important; }
.fw-cell.expert .fw-cell-title { color: var(--black); }
.fw-cell.expert .fw-cell-desc { color: var(--muted); }

/* Profile card zone */
.fw-memory-zone {
  background: #FFCE69 !important;
  padding: 28px 24px 0 24px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  flex: 1;
  overflow: hidden !important;
  position: relative;
}

/* Double card wrapper */
.fw-card-stack {
  position: relative;
  width: 100%;
  height: 400px;
}

/* Back card — flush left, wide enough to show content */
.fw-profile-card-back {
  position: absolute;
  top: 60px;
  left: 0;
  width: 62%;
  bottom: -20px;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  z-index: 0;
  display: flex;
  flex-direction: column;
}

/* Front card — narrow, flush right, on top */
.fw-profile-card {
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  bottom: -20px;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.fw-back-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.fw-back-label {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #bbb; margin-bottom: 8px;
}
.fw-back-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.fw-back-tag {
  font-size: 0.54rem; font-weight: 600;
  padding: 3px 8px; border-radius: 99px;
}
.fw-back-tag:nth-child(1) { background: rgba(253,230,138,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.fw-back-tag:nth-child(2) { background: rgba(191,219,254,0.08); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.fw-back-tag:nth-child(3) { background: rgba(252,165,165,0.08); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.fw-back-patterns {
  padding: 14px 16px 16px;
  border-top: 1px solid #f0f0f0;
  display: flex; flex-direction: column; gap: 8px;
}
.fw-back-pattern {
  font-size: 0.6rem; color: #444; line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid #f0d060;
}
.fw-back-stats {
  display: flex; gap: 0;
  border-bottom: 1px solid #f0f0f0;
}
.fw-back-stat {
  flex: 1; padding: 10px 16px;
  border-right: 1px solid #f0f0f0;
  text-align: center;
}
.fw-back-stat:last-child { border-right: none; }
.fw-back-stat-val { font-size: 0.85rem; font-weight: 700; color: #111; letter-spacing: -0.02em; }
.fw-back-stat-key { font-size: 0.52rem; color: #bbb; font-weight: 500; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; }
.fw-back-take {
    padding: 14px 16px 16px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
  
.fw-back-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #111;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
    border: none;
}
  
.fw-back-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
  
.fw-back-take-inner {
    flex: 1;
}
  
.fw-back-take-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 4px;
}
  
.fw-back-take-text {
    font-size: 0.6rem;   /* ให้เท่ากับ pattern */
    line-height: 1.5;
}

.fw-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 20px;
  flex-shrink: 0;
}
/* Zone 1: dark header */
.fw-profile-top {
  background: #111;
  padding: 20px 20px 18px;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.fw-profile-avatar-wrap {
  width: 44px; height: 44px; border-radius: 50%;
  background: #333; overflow: hidden; flex-shrink: 0;
  position: relative; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.12);
}
.fw-profile-avatar-fallback {
  font-size: 1rem; font-weight: 700; color: white;
  display: none; position: absolute; inset: 0;
  align-items: center; justify-content: center;
}
.fw-profile-info { flex: 1; }
.fw-profile-name { font-size: 1rem; font-weight: 700; color: white; letter-spacing: -0.02em; }
.fw-profile-meta { font-size: 0.68rem; color: rgba(255,255,255,0.55); margin-top: 3px; }
.fw-profile-bond-pill {
  font-size: 0.62rem; font-weight: 600;
  background: rgba(255,210,80,0.12); color: #f0c040;
  border: 1px solid rgba(255,210,80,0.2);
  padding: 5px 11px; border-radius: 99px; white-space: nowrap;
}
.fw-section-label {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #bbb; margin-bottom: 10px;
}
.fw-personal-zone {
  padding: 20px 20px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.fw-personal-row { display: flex; justify-content: space-between; align-items: baseline; }
.fw-personal-key { font-size: 0.65rem; color: #bbb; font-weight: 500; }
.fw-personal-val { font-size: 0.65rem; color: #111; font-weight: 600; text-align: right; }
.fw-risk-zone { padding: 18px 20px; flex-shrink: 0; }
.fw-risk-label-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.fw-risk-value { font-size: 0.72rem; font-weight: 700; color: #e05a2b; }
.fw-risk-track {
  height: 6px; background: #f0ede8; border-radius: 99px; overflow: hidden; margin-bottom: 5px;
}
.fw-risk-fill {
  height: 100%; width: 85%;
  background: linear-gradient(90deg, #f5c842, #e05a2b); border-radius: 99px;
}
.fw-risk-ticks {
  display: flex; justify-content: space-between;
  font-size: 0.6rem; color: #ccc; font-weight: 500;
}
.fw-card-bento {
  display: grid; grid-template-columns: 1fr 1fr;
  flex-shrink: 0;
}
.fw-card-bento-3 { grid-template-columns: 1fr 1fr 1fr; }
.fw-card-cell { padding: 16px 18px; border-right: 1px solid #f0f0f0; }
.fw-card-cell:last-child { border-right: none; }
.fw-ticker-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.fw-ticker-row {
  display: flex; align-items: center; gap: 4px;
}
.fw-ticker-logo {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; background-size: cover;
}
/* Mock logos via solid color blocks with initials feel */
.fw-logo-pltr { background: #1a1a2e; }
.fw-logo-nvda { background: #76b900; }
.fw-logo-alab { background: #0057ff; }
.fw-logo-tsla { background: #cc0000; }
.fw-ticker {
  font-size: 0.55rem; font-weight: 700;
  color: #111; letter-spacing: 0.03em;
}
/* Sector tags — navy gradient */
.fw-sector-tag {
  font-size: 0.48rem; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  background: linear-gradient(135deg, #1e3a5f, #0f2040);
  color: white; letter-spacing: 0.02em;
}
.fw-style-text {
  font-size: 0.65rem; font-weight: 700; color: #111; margin-top: 7px; line-height: 1.4;
}
/* Text sits on top — compact, white bg */
.fw-cell-text {
  padding: 20px 22px 18px;
  background: white;
  flex-shrink: 0;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.tawan-channels {
  display: flex;
  gap: 10px;            /* เพิ่มระยะห่างระหว่างไอคอนแอป */
  justify-content: center;
  padding: 4px 0 8px;   /* เพิ่มพื้นที่ด้านล่างก่อนถึงเส้น Divider ถัดไป */
}

.tawan-ch-icon {
  width: 20px;          /* ใหญ่ขึ้นอีกนิดเพื่อให้ดูเต็มตา */
  height: 20px;
  border-radius: 5px;   /* สัดส่วนความมนที่กริบขึ้น */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

/* แถม: ทำให้ Hover แล้วเด้งนิดๆ เหมือนกดแอปจริงๆ */
.tawan-ch-icon:hover {
  transform: scale(1.1);
}

/* Image fills remaining space below */
.fw-cell-img {
  width: 100%;
  flex: 1;
  background: #e8e7e5;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.fw-cell.expert .fw-cell-img { background: #1a1a1a; }
.fw-cell-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fw-cell-img-label {
  font-size: 0.62rem; color: #bbb; font-family: monospace;
  text-align: center; padding: 8px; line-height: 1.6;
}
.fw-cell.expert .fw-cell-img-label { color: #2e2e2e; }
.fw-cell-title {
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.2;
  margin-bottom: 8px;
}
.fw-cell-desc { font-size: 0.78rem; line-height: 1.6; }



/* ── Mini Cards ── */
.capabilities-grid {
  grid-column: span 12; 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px; 
  width: 100%;
}

.cap-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
}

.cap-card:hover {
  background: var(--off-white);
  border-color: #e5e5e5;
  transform: translateY(-2px);
}

/* ไอคอน 42px มน 14px ตามที่ตกลงกัน */
.cap-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  border: none; /* ลบเส้นขอบออกเพื่อให้สีพื้นหลังเด่น */
}

/* คลาสสีใหม่สำหรับไอคอน */
.bg-orange { background: #F97316; }
.bg-pink   { background: #EC4899; }
.bg-emerald { background: #10B981; }
.bg-purple { background: #8B5CF6; }

.cap-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.01em;
  margin: 0;
}

.cap-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Skip to content (accessibility) ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--black);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
/* ── App Integration Cards ── */
.app-card-light {
  background: #fff;
  border: 1px solid #eee;
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.app-card-light:hover {
  border-color: #ddd;
  background: #fafafa;
  transform: translateY(-2px);
}
.app-card-light img {
  height: 20px; width: auto;
  opacity: 1.0;
  transition: 0.3s;
  filter: grayscale(0.2);
}
.app-card-light:hover img { opacity: 1; filter: grayscale(0); }
.laz-fix-light { height: 20px !important; width: auto !important; }

/* ── Integration grid ── */
.integration-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 1. บังคับ Grid หลักให้เป็น 3 คอลัมน์บน PC */
.footer-grid {
  display: grid !important;
  grid-template-columns: 2fr 1fr 1fr !important; /* แบ่งสัดส่วน Brand(2) : Company(1) : Legal(1) */
  gap: 48px;
  margin-bottom: 28px;
  width: 100%;
}
  
/* 2. ตัวหุ้ม Company/Legal ต้องสลายตัวบน PC */
.footer-nav-group {
  display: contents !important; 
}

/* ════════════════════════════════════
    RESPONSIVE — breakpoints consolidated
    ════════════════════════════════════ */

@media (max-width: 1024px) and (min-width: 901px) {
  .carousel-section { padding: 48px 20px; }
  .all-personas-section { padding: 48px 20px; }
  .framework-section { padding: 60px 20px; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  /* Nav */
  nav { padding: 0 4%; }

  /* Carousel */
  .personas-track { gap: 10px; }
  .carousel-section { padding: 48px 20px; }

  /* Directory */
  .directory-list { grid-template-columns: 1fr 1fr; }
  .all-personas-section { padding: 48px 20px; }

  /* Action cards — scrollable on tablet */
  .action-cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 4px;
    scrollbar-width: none;
  }
  .action-cards::-webkit-scrollbar { display: none; }
  .action-card { flex: 0 0 42vw; scroll-snap-align: start; }

  /* Framework */
  .framework-section { padding: 60px 20px; }
  .fw-unified-grid { grid-template-columns: repeat(2, 1fr); }
  .fw-cell.uc-half { grid-column: span 1; min-height: 420px; }
  .fw-cell.uc-wide { grid-column: span 2; }
  .fw-cell.uc-narrow { grid-column: span 1; }
  .fw-cell.uc-full { grid-column: span 2; }

  /* Capabilities */
  .capabilities-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .fw-unified-grid { grid-template-columns: repeat(2, 1fr); }
  .fw-cell.uc-half   { grid-column: span 1; }
  .fw-cell.uc-wide   { grid-column: span 2; }
  .fw-cell.uc-narrow { grid-column: span 1; }
  .fw-cell.uc-full   { grid-column: span 2; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
}

@media (max-width: 768px) {
  /* Nav */
  .nav-cta { display: inline-flex; }

  /* Hero */
  .hero { padding: 72px 20px 40px; text-align: center; }
  .hero-title { font-size: 2.8rem; }
  .hero-sub { margin-left: 0; max-width: none; font-size: 0.88rem; }
  .btn-primary { width: auto; justify-content: center; }

  /* Carousel */
  .carousel-section { padding: 48px 0 48px 20px; overflow: hidden; }
  .carousel-header { padding-right: 20px; }
  .personas-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-right: 20px;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .personas-track::-webkit-scrollbar { display: none; }
  .p-card { flex: 0 0 72vw; scroll-snap-align: start; aspect-ratio: 4/5; }

  /* Directory */
  .all-personas-section { padding: 50px 20px; }
  .directory-list { grid-template-columns: 1fr; }
  .ap-row { padding: 18px 0 !important; border-left: none !important; }

  /* Action cards */
  .action-section { padding: 56px 0; }
  .action-inner { padding: 0 20px; }
  .action-cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 4px;
    scrollbar-width: none;
  }
  .action-cards::-webkit-scrollbar { display: none; }
  .action-card { flex: 0 0 80vw; scroll-snap-align: start; }

  /* Framework */
  .framework-section { padding: 50px 20px; }
  .fw-unified-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .fw-cell.uc-half, .fw-cell.uc-wide, .fw-cell.uc-narrow, .fw-cell.uc-full { grid-column: span 1; }
  .fw-cell { min-height: auto; }
  .fw-cell-text { padding: 24px; }
  .fw-sub-break::before {
    content: '\A';
    white-space: pre;
  }
  /* Card 1 personal */
  .fw-cell.persona {
    display: flex !important;
    min-height: auto !important;
    overflow: hidden !important;
    position: relative !important;
  }
  .fw-memory-zone {
    overflow: hidden !important;
    padding: 20px 0 0 !important;
    min-height: 340px !important;
    width: 100% !important;
    position: relative !important;
  }
  .fw-card-stack {
    position: relative !important;
    width: 100% !important;
    height: 320px !important;
    margin: 0 auto !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
  }
  .fw-card-stack {
    position: relative !important;
    width: 100% !important;
    height: 360px !important;
    transform: none !important;
  }
  .fw-profile-card-back {
    position: absolute !important;
    display: flex !important;
    flex-direction: column !important;
    width: 70% !important;
    left: 6% !important;
    right: auto !important;
    top: 40px !important;
    z-index: 1 !important;
  }
  .fw-profile-card {
    position: absolute !important;
    display: flex !important;
    flex-direction: column !important;
    width: 65% !important;
    left: auto !important;
    right: -16px !important;
    top: 0 !important;
    z-index: 5 !important;
    transform: none !important;
  }

  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  .integration-grid {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    gap: 26px;
    justify-content: center;
    padding: 8px 0;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr !important; /* ให้ Brand และส่วนเนื้อหาหลักอยู่แถวเดียวกัน */
    gap: 32px !important;
  }
  .footer-nav-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr; /* บังคับให้ Company กับ Legal วางคู่กัน */
    gap: 20px;
  }
  .footer-brand {
    text-align: left; /* มือถือก็ยังอยากให้ชิดซ้ายเพื่อความเท่ */
    margin-bottom: 10px;
  }
}