/* =========================================================
   Best Better Life — link-in-bio
   Direction: dark luxury · action-first link hub
   ========================================================= */

:root {
  /* ---- palette (warm obsidian + phoenix ember/gold) ---- */
  --bg:            oklch(15% 0.018 55);
  --bg-deep:       oklch(11% 0.016 50);
  --surface:       oklch(20% 0.022 55);
  --surface-2:     oklch(24% 0.026 56);
  --line:          oklch(34% 0.03 60 / 0.55);

  --text:          oklch(96% 0.012 80);
  --muted:         oklch(74% 0.022 70);
  --faint:         oklch(60% 0.02 65);

  --ember:         oklch(70% 0.19 45);     /* hot orange  */
  --gold:          oklch(82% 0.14 80);     /* warm gold   */
  --gold-soft:     oklch(86% 0.10 85);
  --ember-ink:     oklch(22% 0.05 45);     /* text on gold */

  --grad-phoenix:  linear-gradient(115deg, var(--ember) 0%, var(--gold) 100%);
  --grad-ink:      linear-gradient(180deg, oklch(22% 0.024 55 / 0.9), oklch(17% 0.02 52 / 0.92));

  /* ---- typography ---- */
  --font-display: "Noto Serif Thai", "Times New Roman", serif;
  --font-body:    "IBM Plex Sans Thai", system-ui, -apple-system, sans-serif;

  --text-name:  clamp(2.4rem, 1.4rem + 4.6vw, 3.6rem);
  --text-h:     clamp(1.05rem, 0.9rem + 0.7vw, 1.25rem);
  --text-base:  clamp(0.95rem, 0.9rem + 0.25vw, 1.02rem);
  --text-sm:    0.84rem;
  --text-xs:    0.74rem;

  /* ---- space / shape / motion ---- */
  --shell:      30rem;          /* mobile-first column width */
  --gap:        0.7rem;
  --pad:        clamp(1.1rem, 0.7rem + 2vw, 1.6rem);
  --radius:     1.05rem;
  --radius-sm:  0.7rem;

  --dur:        260ms;
  --dur-fast:   140ms;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);

  --shadow:     0 1px 0 oklch(100% 0 0 / 0.04) inset,
                0 10px 30px -18px oklch(0% 0 0 / 0.8);
  --shadow-lift:0 1px 0 oklch(100% 0 0 / 0.06) inset,
                0 22px 46px -22px oklch(0% 0 0 / 0.85);
  --glow:       0 0 0 1px oklch(82% 0.14 80 / 0.35),
                0 14px 40px -14px oklch(70% 0.19 45 / 0.55);
}

/* ---------------- reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 50%; top: -4rem;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--ember-ink);
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.6rem 0.6rem;
  font-weight: 600;
  z-index: 50;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------------- atmosphere ---------------- */
.atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}
.ember--one {
  width: 60vmax; height: 60vmax;
  top: -28vmax; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, oklch(60% 0.18 45 / 0.55), transparent 62%);
}
.ember--two {
  width: 44vmax; height: 44vmax;
  bottom: -22vmax; right: -14vmax;
  background: radial-gradient(circle, oklch(60% 0.13 80 / 0.4), transparent 64%);
}
.grain {
  position: absolute; inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- shell ---------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.4rem, 1rem + 2vw, 2.2rem) var(--pad) 2rem;
  display: flex;
  flex-direction: column;
}

/* ---------------- hero ---------------- */
.hero { text-align: center; }

.hero__avatar {
  --size: 8.4rem;
  position: relative;
  width: var(--size); height: var(--size);
  margin: 0 auto 1.1rem;
  display: grid; place-items: center;
}
.avatar__photo {
  position: absolute; inset: 5px;
  border-radius: 50%;
  background:
    var(--avatar-img, var(--grad-ink)) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.06);
}
.avatar__mark {
  position: relative;
  width: 46%; height: 46%;
  fill: var(--gold);
  filter: drop-shadow(0 2px 10px oklch(70% 0.19 45 / 0.6));
}
:root[style*="--avatar-img"] .avatar__mark { display: none; }
.avatar__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: var(--grad-phoenix);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}

.hero__eyebrow {
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: var(--gold-soft);
  font-weight: 600;
}
.hero__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-name);
  line-height: 1.02;
  letter-spacing: 0;
  margin: 0.25rem 0 0.55rem;
}
.hero__name em {
  font-style: italic;
  font-weight: 500;
  background: var(--grad-phoenix);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.hero__tagline {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
  max-width: 22rem;
  margin-inline: auto;
}

/* stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.2rem auto 1.3rem;
  max-width: 26rem;
}
.stat {
  flex: 1;
  background: var(--grad-ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.3rem;
  box-shadow: var(--shadow);
}
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--gold);
  line-height: 1.1;
}
.stat__label { display: block; font-size: var(--text-xs); color: var(--faint); margin-top: 0.15rem; }

/* primary CTA */
.hero__cta { margin-top: 0.2rem; }
.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.2;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur) var(--ease),
              filter var(--dur) var(--ease);
  will-change: transform;
}
.btn--primary {
  color: var(--ember-ink);
  background: var(--grad-phoenix);
  box-shadow: var(--glow);
}
.btn--primary:hover { transform: translateY(-2px); filter: saturate(1.08) brightness(1.03); }
.btn--primary:active { transform: translateY(0); }
.btn__icon { display: inline-flex; width: 1.25rem; height: 1.25rem; }
.btn__icon svg { width: 100%; height: 100%; }
.hero__cta-note { font-size: var(--text-xs); color: var(--faint); margin-top: 0.65rem; }

/* ---------------- sticky category tabs ---------------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  /* bleed the sticky blur to the column edges */
  margin: 1.5rem calc(var(--pad) * -1) 0;
  padding: 0.55rem var(--pad);
  background: linear-gradient(var(--bg-deep) 62%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.tabs__rail {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
}
.tabs__rail::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 0.5rem 0.85rem;
  border-radius: 2rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.tab:hover { color: var(--text); transform: translateY(-1px); }
.tab.is-active {
  color: var(--ember-ink);
  background: var(--grad-phoenix);
  border-color: transparent;
  box-shadow: 0 8px 20px -12px oklch(70% 0.19 45 / 0.7);
}

/* ---------------- panels & cards ---------------- */
.panels { margin-top: 1rem; min-height: 16rem; }
.panel { display: flex; flex-direction: column; gap: var(--gap); }
.panel[hidden] { display: none; }

/* entrance animation when a panel becomes active */
.panel.is-active > * {
  animation: rise var(--dur) var(--ease) both;
}
.panel.is-active > *:nth-child(2) { animation-delay: 40ms; }
.panel.is-active > *:nth-child(3) { animation-delay: 80ms; }
.panel.is-active > *:nth-child(4) { animation-delay: 120ms; }
.panel.is-active > *:nth-child(5) { animation-delay: 160ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--grad-ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  will-change: transform;
}
.card:hover {
  transform: translateY(-2px);
  border-color: oklch(82% 0.14 80 / 0.4);
  box-shadow: var(--shadow-lift);
}
.card:active { transform: translateY(0); }

.card__ic {
  flex: 0 0 auto;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  font-size: 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.card__body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.card__title { font-weight: 600; font-size: 0.98rem; letter-spacing: 0; }
.card__sub { font-size: var(--text-sm); color: var(--muted); line-height: 1.35; }
.card__arrow {
  margin-left: auto;
  color: var(--faint);
  font-size: 1.1rem;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.card:hover .card__arrow { color: var(--gold); transform: translateX(3px); }

/* feature card (lead magnet) */
.card--feature {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1.1rem 1.15rem 1.15rem;
  background:
    radial-gradient(120% 140% at 0% 0%, oklch(30% 0.06 55 / 0.9), transparent 60%),
    var(--grad-ink);
  border-color: oklch(82% 0.14 80 / 0.3);
}
.card--feature .card__arrow {
  position: absolute; right: 1.1rem; bottom: 1.1rem; margin: 0;
}
.card__badge {
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: oklch(82% 0.14 80 / 0.12);
  border: 1px solid oklch(82% 0.14 80 / 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 2rem;
}
.card--feature .card__title { font-size: 1.12rem; }

.card--site {
  border-color: oklch(82% 0.14 80 / 0.34);
  background:
    linear-gradient(120deg, oklch(82% 0.14 80 / 0.1), transparent 58%),
    var(--grad-ink);
}
.card--site .card__ic {
  color: var(--gold);
  font-weight: 700;
}

/* accent card (premium class) */
.card--accent {
  background:
    linear-gradient(120deg, oklch(70% 0.19 45 / 0.14), oklch(82% 0.14 80 / 0.08)),
    var(--grad-ink);
  border-color: oklch(70% 0.19 45 / 0.4);
}

/* split row (onsite / online) */
.card-row { display: flex; gap: var(--gap); }
.card--half {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.4rem;
  padding: 0.95rem;
}
.card--half .card__ic { width: 2.2rem; height: 2.2rem; }

/* pills */
.pill {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 1rem;
  vertical-align: middle;
}
.pill--free { color: var(--ember-ink); background: var(--gold); margin-left: 0.3rem; }

.panel__note {
  font-size: var(--text-sm);
  color: var(--faint);
  text-align: center;
  padding: 0.4rem 0.6rem;
  line-height: 1.5;
}

.community-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}
.community-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* transient hint shown when a not-yet-linked card is tapped */
.todo-hint {
  position: absolute;
  left: 1rem; right: 1rem; bottom: 0.5rem;
  font-size: var(--text-xs);
  color: var(--gold-soft);
  background: oklch(22% 0.03 55 / 0.96);
  border: 1px solid oklch(82% 0.14 80 / 0.35);
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  text-align: center;
  animation: rise var(--dur) var(--ease) both;
}

/* social grid */
.grid-social { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.social {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem;
  background: var(--grad-ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.social:hover {
  transform: translateY(-2px);
  border-color: oklch(82% 0.14 80 / 0.4);
  box-shadow: var(--shadow-lift);
}
.social__ic { width: 1.7rem; height: 1.7rem; color: var(--gold); }
.social__ic svg { width: 100%; height: 100%; }
.social__name { font-weight: 600; }
.social__handle { font-size: var(--text-xs); color: var(--faint); }

/* ---------------- about ---------------- */
.panel--about { gap: 0.9rem; }
.about__lead { font-size: 1.02rem; line-height: 1.6; }
.about__lead strong, .about__body strong { color: var(--gold-soft); font-weight: 600; }
.about__body { color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
.about__h {
  font-family: var(--font-display);
  font-size: var(--text-h);
  font-weight: 600;
  margin-top: 0.3rem;
  color: var(--text);
}
.creds { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.creds li {
  font-size: var(--text-xs);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.32rem 0.7rem;
}
.about__mission {
  font-family: var(--font-display);
  font-style: italic;
  text-align: center;
  color: var(--gold-soft);
  line-height: 1.5;
  padding: 1rem 0.5rem 0.2rem;
}

/* ---------------- footer ---------------- */
.footer {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.btn--ghost {
  color: var(--gold-soft);
  background: var(--surface);
  border: 1px solid oklch(82% 0.14 80 / 0.3);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--text); }
.footer__disclaim { font-size: var(--text-xs); color: var(--faint); line-height: 1.6; max-width: 24rem; margin-inline: auto; }
.footer__meta { font-size: var(--text-xs); color: oklch(50% 0.015 60); }

/* ---------------- responsive up ---------------- */
@media (min-width: 32rem) {
  :root { --shell: 31rem; }
  .hero__avatar { --size: 9rem; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover, .social:hover, .btn:hover, .tab:hover { transform: none; }
}
