/* ============================================================
   FutureGuide.org — one-page directory
   Palette: deep navy #00084F + gold #D4AF37 (brand: dark-first)
   Type: Trirong (display) + IBM Plex Sans Thai (body)
   ============================================================ */

:root {
  /* Fluid type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* 4px spacing system */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  --font-display: 'Trirong', 'IBM Plex Sans Thai', serif;
  --font-body: 'IBM Plex Sans Thai', 'Trirong', sans-serif;

  /* Brand anchors (ดึงจากโลโก้ FGA-Universe จริง) */
  --navy: #00084f;
  --gold: #f4dc92;
}

/* ---------- DARK (brand default) ---------- */
:root,
[data-theme='dark'] {
  --color-bg: #010530;
  --color-surface: #00084f;
  --color-surface-2: #071058;
  --color-surface-offset: #0b1767;
  --color-divider: oklch(0.92 0.04 95 / 0.14);
  --color-border: oklch(0.92 0.04 95 / 0.18);

  --color-text: #f2eee2;
  --color-text-muted: #a7add0;
  --color-text-faint: #6e759f;
  --color-text-inverse: #0b1040;

  --color-primary: #f0d68f;
  --color-primary-hover: #f8e6b0;
  --color-primary-active: #d9bc72;
  --color-primary-highlight: #2a2a12;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 44px oklch(0 0 0 / 0.45);

  --hero-glow: oklch(0.32 0.09 268 / 0.55);
  color-scheme: dark;
}

/* ---------- LIGHT ---------- */
[data-theme='light'] {
  --color-bg: #f6f2e7;
  --color-surface: #fbf8f0;
  --color-surface-2: #fdfbf6;
  --color-surface-offset: #ece5d2;
  --color-divider: oklch(0.25 0.06 268 / 0.14);
  --color-border: oklch(0.25 0.06 268 / 0.2);

  --color-text: #131a45;
  --color-text-muted: #4a5170;
  --color-text-faint: #8a8fa8;
  --color-text-inverse: #f6f2e7;

  --color-primary: #8a6a14;
  --color-primary-hover: #6f5510;
  --color-primary-active: #58420c;
  --color-primary-highlight: #efe4c3;

  --shadow-sm: 0 1px 2px oklch(0.3 0.05 268 / 0.08);
  --shadow-md: 0 4px 14px oklch(0.3 0.05 268 / 0.1);
  --shadow-lg: 0 16px 44px oklch(0.3 0.05 268 / 0.14);

  --hero-glow: oklch(0.85 0.06 95 / 0.5);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg: #f6f2e7;
    --color-surface: #fbf8f0;
    --color-surface-2: #fdfbf6;
    --color-surface-offset: #ece5d2;
    --color-divider: oklch(0.25 0.06 268 / 0.14);
    --color-border: oklch(0.25 0.06 268 / 0.2);
    --color-text: #131a45;
    --color-text-muted: #4a5170;
    --color-text-faint: #8a8fa8;
    --color-text-inverse: #f6f2e7;
    --color-primary: #8a6a14;
    --color-primary-hover: #6f5510;
    --color-primary-active: #58420c;
    --color-primary-highlight: #efe4c3;
    --shadow-sm: 0 1px 2px oklch(0.3 0.05 268 / 0.08);
    --shadow-md: 0 4px 14px oklch(0.3 0.05 268 / 0.1);
    --shadow-lg: 0 16px 44px oklch(0.3 0.05 268 / 0.14);
    --hero-glow: oklch(0.85 0.06 95 / 0.5);
    color-scheme: light;
  }
}

/* ================= LAYOUT ================= */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 100;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-4);
}

/* ================= HEADER ================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}
.site-header.is-scrolled {
  border-bottom-color: var(--color-divider);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  min-height: 44px;
}
.brand .brand-logo {
  height: 42px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px oklch(from var(--color-primary) l c h / 0.35));
}
.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.brand-name small {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}
.main-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.main-nav a:hover {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  border: 1px solid transparent;
}
.icon-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-border);
}

.nav-toggle {
  display: none;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }
  .main-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-divider);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .main-nav.is-open {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-4);
  }
  .main-nav a {
    display: flex;
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--color-divider);
  }
  .main-nav li:last-child a {
    border-bottom: none;
  }
}

/* ================= BUTTONS ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: #0b1040;
}
[data-theme='light'] .btn-primary {
  color: #f6f2e7;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}
.btn-primary:active {
  background: var(--color-primary-active);
}

.btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn-outline:hover {
  background: oklch(from var(--color-primary) l c h / 0.12);
}

.btn[aria-disabled='true'] {
  border-style: dashed;
  opacity: 0.75;
  cursor: default;
}
.btn[aria-disabled='true']:hover {
  background: transparent;
}

/* ================= HERO ================= */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 72% 30%, var(--hero-glow), transparent 70%),
    var(--color-bg);
}
.hero-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: var(--color-primary);
  opacity: 0.8;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: var(--space-12);
  min-height: min(78vh, 760px);
  padding-block: clamp(var(--space-12), 7vw, var(--space-20));
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-5);
}
.hero-eyebrow::before {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--color-primary);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.18;
  max-width: 14ch;
  margin-bottom: var(--space-5);
}
.hero h1 em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-lead {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-8);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-logo {
  width: min(100%, 340px);
  height: auto;
  filter: drop-shadow(0 0 56px oklch(from var(--color-primary) l c h / 0.3));
  animation: float 9s ease-in-out infinite;
}
/* Light mode: โลโก้ทองแชมเปญต้องอยู่บนพื้นกรมท่าเสมอ */
[data-theme='light'] .brand-logo {
  background: #010530;
  border-radius: var(--radius-md);
  padding: 3px 8px;
}
[data-theme='light'] .hero-logo {
  aspect-ratio: 1;
  object-fit: contain;
  background: radial-gradient(circle at 50% 40%, #071058, #010530 74%);
  border-radius: 50%;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-lg);
  filter: none;
}
[data-theme='light'] .about-logo {
  background: linear-gradient(160deg, #071058, #010530);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: var(--space-10);
    text-align: left;
  }
  .hero-logo {
    width: min(64%, 280px);
  }
}

/* ================= STATS ================= */

.stats {
  border-block: 1px solid var(--color-divider);
  background: var(--color-surface);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}
.stat {
  padding: var(--space-8) var(--space-4);
}
.stat + .stat {
  border-left: 1px solid var(--color-divider);
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.1;
}
.stat-label {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ================= SECTION HEADINGS ================= */

.section-head {
  max-width: var(--content-narrow);
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-12));
}
.section-eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--color-primary);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
.section-sub {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ================= TEACHERS ================= */

.teachers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 720px) {
  .teachers-grid {
    grid-template-columns: 1fr;
  }
}

.teachers-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-8);
}
.teachers-pagination button {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition:
    background var(--transition-interactive),
    color var(--transition-interactive),
    border-color var(--transition-interactive);
}
.teachers-pagination button:hover:not(:disabled):not(.is-active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-surface-2);
}
.teachers-pagination button.is-active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.teachers-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.teachers-pagination .pagination-info {
  font-size: 0.82rem;
  color: var(--color-text-faint);
  margin: 0 4px;
}

.teacher-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.teacher-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: oklch(from var(--color-primary) l c h / 0.45);
}

.teacher-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-surface-offset);
}
.teacher-media-link {
  display: block;
  width: 100%;
  height: 100%;
}
.teacher-name a {
  color: inherit;
  text-decoration: none;
}
.teacher-name a:hover {
  color: var(--color-primary);
}
.teacher-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.teacher-card:hover .teacher-media img {
  transform: scale(1.04);
}

.teacher-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: oklch(from var(--color-bg) l c h / 0.82);
  color: var(--color-primary);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.5);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
}

.teacher-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2);
}
.teacher-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
}
.teacher-nick {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.teacher-field {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex: 1;
  margin-bottom: var(--space-4);
}
.teacher-link {
  align-self: stretch;
}

/* ================= ABOUT ================= */

.about {
  background: var(--color-surface);
  border-block: 1px solid var(--color-divider);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}
.about-copy p + p {
  margin-top: var(--space-4);
}
.about-logo {
  width: min(60%, 210px);
  height: auto;
  margin-top: var(--space-8);
  opacity: 0.95;
}
.about-copy .lead {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-text);
}
.about-copy p {
  color: var(--color-text-muted);
}

.principles {
  list-style: none;
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-2);
}
.principle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.principle:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.principle-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-primary);
  line-height: 1.2;
}
.principle h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.principle p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ================= FAQ ================= */

.faq-list {
  max-width: var(--content-default);
  display: grid;
  gap: var(--space-3);
}
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 500;
  font-size: var(--text-base);
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '';
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition-interactive);
}
.faq-item[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}
.faq-item summary:hover {
  color: var(--color-primary);
}
.faq-answer {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ================= FINAL CTA ================= */

.final-cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(50% 60% at 50% 40%, var(--hero-glow), transparent 75%),
    var(--color-bg);
  border-block: 1px solid var(--color-divider);
}
.final-cta .container {
  position: relative;
  padding-block: clamp(var(--space-16), 10vw, var(--space-24));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}
.final-cta h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  max-width: 20ch;
}
.final-cta p {
  color: var(--color-text-muted);
  max-width: 52ch;
}
.final-cta .stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--color-primary);
  opacity: 0.55;
}

/* ================= FOOTER ================= */

.site-footer {
  padding-block: var(--space-12) var(--space-8);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-divider);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
}
.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-nav a:hover {
  color: var(--color-primary);
}
.footer-bottom {
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ================= BIO PAGES ================= */

.bio-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 85% 75% at 28% -10%, oklch(0.32 0.09 285 / 0.45), transparent 62%),
    radial-gradient(ellipse 70% 65% at 92% 28%, oklch(0.30 0.08 265 / 0.38), transparent 66%),
    radial-gradient(55% 60% at 82% 32%, var(--hero-glow), transparent 72%),
    var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
}
/* — Bio space background — อวกาศ เนบิวลา + ดวงดาว — */
.bio-hero::before {
  content: '';
  position: absolute;
  inset: -35% -18%;
  background:
    radial-gradient(52% 62% at 18% 28%, oklch(0.60 0.18 295 / 0.22), transparent 60%),
    radial-gradient(44% 56% at 82% 24%, oklch(0.58 0.16 265 / 0.18), transparent 62%),
    radial-gradient(42% 38% at 52% 88%, oklch(0.62 0.14 200 / 0.14), transparent 60%),
    radial-gradient(28% 32% at 68% 62%, oklch(0.70 0.13 45 / 0.09), transparent 60%),
    radial-gradient(22% 28% at 35% 72%, oklch(0.62 0.10 320 / 0.10), transparent 65%);
  filter: blur(24px);
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
  animation: bio-aurora 22s ease-in-out infinite alternate;
  will-change: transform;
}
.bio-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 7% 14%, #fff 100%, transparent 100%),
    radial-gradient(1.2px 1.2px at 11% 42%, var(--color-primary) 100%, transparent 100%),
    radial-gradient(1px 1px at 18% 68%, #fff 100%, transparent 100%),
    radial-gradient(1.4px 1.4px at 24% 28%, #fff 100%, transparent 100%),
    radial-gradient(1px 1px at 32% 76%, var(--color-primary) 100%, transparent 100%),
    radial-gradient(1.8px 1.8px at 38% 18%, #fff 100%, transparent 100%),
    radial-gradient(1.1px 1.1px at 44% 52%, #fff 100%, transparent 100%),
    radial-gradient(1.3px 1.3px at 52% 32%, var(--color-primary) 100%, transparent 100%),
    radial-gradient(1px 1px at 58% 88%, #fff 100%, transparent 100%),
    radial-gradient(1.5px 1.5px at 64% 20%, #fff 100%, transparent 100%),
    radial-gradient(1px 1px at 71% 48%, var(--color-primary) 100%, transparent 100%),
    radial-gradient(1.2px 1.2px at 78% 66%, #fff 100%, transparent 100%),
    radial-gradient(1.6px 1.6px at 83% 14%, #fff 100%, transparent 100%),
    radial-gradient(1px 1px at 88% 38%, #fff 100%, transparent 100%),
    radial-gradient(1.3px 1.3px at 92% 72%, var(--color-primary) 100%, transparent 100%),
    radial-gradient(1px 1px at 14% 88%, #fff 100%, transparent 100%),
    radial-gradient(1.4px 1.4px at 66% 74%, #fff 100%, transparent 100%);
  background-repeat: no-repeat;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: bio-twinkle 8.4s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes bio-aurora {
  0% { transform: translate3d(-2.5%, -1.5%, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(2%, 1.2%, 0) scale(1.04) rotate(0.7deg); }
  100% { transform: translate3d(1%, -1%, 0) scale(1.02) rotate(-0.6deg); }
}
@keyframes bio-twinkle {
  0% { opacity: 0.32; transform: translate3d(0, 0, 0); }
  50% { opacity: 0.68; transform: translate3d(10px, -8px, 0); }
  100% { opacity: 0.38; transform: translate3d(-7px, 6px, 0); }
}
/* ดาวตก — เพิ่มความรู้สึกอวกาศ แบบนานๆ มาที ไม่ถี่ */
.bio-space-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bio-space-effects .shooting-star {
  position: absolute;
  width: 140px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95) 50%, transparent);
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.8));
  opacity: 0;
  transform: rotate(-32deg);
  animation: bio-shoot 9s ease-in-out infinite;
}
.bio-space-effects .shooting-star:nth-child(1) { top: 18%; left: -10%; animation-delay: 1.2s; }
.bio-space-effects .shooting-star:nth-child(2) { top: 42%; left: -10%; width: 100px; animation-delay: 5.5s; animation-duration: 7.5s; opacity: 0.9; }
.bio-space-effects .shooting-star:nth-child(3) { top: 68%; left: -10%; width: 120px; animation-delay: 3.1s; animation-duration: 8.2s; }
@keyframes bio-shoot {
  0% { transform: translate3d(0, 0, 0) rotate(-32deg); opacity: 0; }
  8% { opacity: 1; }
  18% { opacity: 0; transform: translate3d(680px, 280px, 0) rotate(-32deg); }
  100% { opacity: 0; transform: translate3d(680px, 280px, 0) rotate(-32deg); }
}
.bio-hero .container {
  position: relative;
  z-index: 1;
  padding-block: clamp(var(--space-10), 7vw, var(--space-20));
}
.bio-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  min-height: 44px;
  margin-bottom: var(--space-8);
}
.bio-back:hover {
  color: var(--color-primary);
}
.bio-back svg {
  width: 16px;
  height: 16px;
}

.bio-hero-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
}
@media (max-width: 800px) {
  .bio-hero-grid {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

.bio-portrait {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-lg);
}

.bio-eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.bio-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.bio-role {
  font-size: var(--text-lg);
  font-family: var(--font-display);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.bio-tagline {
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-6);
}
.bio-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.bio-section {
  padding-block: clamp(var(--space-8), 6vw, var(--space-16));
}
.bio-section + .bio-section {
  border-top: 1px solid var(--color-divider);
}
.bio-h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.bio-h2::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--color-primary);
}
.bio-prose p {
  color: var(--color-text-muted);
  max-width: 68ch;
}
.bio-prose p + p {
  margin-top: var(--space-3);
}

.facts-list {
  list-style: none;
  display: grid;
  gap: var(--space-4);
  max-width: var(--content-default);
}
.facts-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.facts-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.facts-list .fact-star {
  color: var(--color-primary);
  font-family: var(--font-display);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 800px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}
.video-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface-offset);
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-play span {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: oklch(from var(--color-primary) l c h / 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1040;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-interactive);
}
.video-card:hover .video-play span {
  transform: scale(1.08);
}
.video-play svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}
.video-title {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  max-width: var(--content-default);
}
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
a.contact-item:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.5);
  box-shadow: var(--shadow-sm);
}
.contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.contact-item .ci-label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.contact-item .ci-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* — Featured: จองคิวปรึกษา — ย้ายขึ้นอันดับแรกและเด่นสุด สีส้ม #FF8107 ตัวหนังสือน้ำเงินเข้มแบบ background */
.contact-item--primary {
  background: #FF8107;
  border-color: #FF8107;
  color: #00084F;
  box-shadow: 0 4px 14px oklch(0.7 0.18 45 / 0.35);
  position: relative;
}
.contact-item--primary svg {
  color: #00084F;
}
.contact-item--primary .ci-label {
  color: #00084F;
  opacity: 0.85;
}
.contact-item--primary .ci-value {
  color: #00084F;
  font-weight: 700;
}
a.contact-item--primary:hover {
  background: #ff9a3a;
  border-color: #ff9a3a;
  box-shadow: 0 8px 24px oklch(0.7 0.18 45 / 0.45);
  transform: translateY(-2px);
}
a.contact-item--primary:active {
  background: #e67300;
  border-color: #e67300;
  transform: none;
  box-shadow: var(--shadow-sm);
}
/* คงสีส้ม #FF8107 ตัวหนังสือน้ำเงินเข้ม ทั้งโหมดมืดและสว่าง */
[data-theme='light'] .contact-item--primary,
[data-theme='dark'] .contact-item--primary {
  background: #FF8107;
  border-color: #FF8107;
  color: #00084F;
}
[data-theme='light'] .contact-item--primary svg,
[data-theme='dark'] .contact-item--primary svg,
[data-theme='light'] .contact-item--primary .ci-label,
[data-theme='dark'] .contact-item--primary .ci-label,
[data-theme='light'] .contact-item--primary .ci-value,
[data-theme='dark'] .contact-item--primary .ci-value {
  color: #00084F;
}

.bio-next {
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface);
}
.bio-next .container {
  padding-block: var(--space-12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.bio-next p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ================= REVEAL ANIMATION ================= */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 640ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 640ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-logo {
    animation: none;
  }
  .bio-hero::before,
  .bio-hero::after,
  .bio-space-effects .shooting-star {
    animation: none !important;
  }
}


/* Star Matching nav button */
.btn-star{color:#ffff00!important;font-weight:800;background:transparent!important;box-shadow:none!important;padding:0!important;min-width:0!important;text-decoration:underline;text-decoration-color:#ff8ac2;text-decoration-thickness:2px;text-underline-offset:4px;white-space:nowrap;border-radius:0;display:inline;}
.btn-star:hover{color:#fff28a!important;text-decoration-color:#ff9fce;}

.btn-star:hover{background:#ff9fce!important;}


/* Star Matching — advisor cards */
.star-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px;max-width:1080px;margin:32px auto 0;}
.star-card{background:var(--color-surface);border:1px solid var(--border);border-radius:18px;overflow:hidden;display:flex;flex-direction:column;}
.star-card img{width:100%;aspect-ratio:4/5;object-fit:cover;display:block;}
.star-card-body{padding:18px;display:flex;flex-direction:column;gap:14px;flex:1;}
.star-card h3{margin:0;font-size:1.15rem;text-align:center;}
.star-card .btn{width:100%;}
@media(max-width:840px){.star-cards{grid-template-columns:1fr;max-width:420px;}}


/* Star Matching — service note */
.service-note{font-size:clamp(1rem,2.3vw,1.3rem);font-weight:700;color:#0b5d2b;background:#3aa0ff;background:linear-gradient(135deg,#4aa8ff,#1e78d8);border:1px solid rgba(255,255,255,0.3);border-radius:14px;padding:14px 22px;text-align:center;box-shadow:0 6px 18px rgba(59,150,255,0.28);}

.service-hint{line-height:1.6;}
.service-avatar{width:250px;height:250px;flex:0 0 250px;border-radius:50%;border:2px dashed oklch(0.7 0.14 85 / 0.5);display:flex;align-items:center;justify-content:center;color:var(--faint);font-size:0.85rem;}
