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

:root {
  --bg:      #fafaf8;
  --surface: #ffffff;
  --text:    #1a1a1a;
  --muted:   #717171;
  --border:  #ebebeb;
  --radius:  16px;
  --max:     480px;
}

body {
  font-family: 'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  background-image: radial-gradient(circle, #ccc9c2 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── DOODLES ─────────────────────────────────────────────────────────────── */

.doodles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.doodle {
  position: absolute;
  color: #b5b2aa;
  opacity: 0.55;
}

.d-wave-tl  { top: 6%;  left: 3%;   width: 90px;  transform: rotate(-8deg); }
.d-spark-tr { top: 8%;  right: 5%;  width: 32px;  transform: rotate(12deg); }
.d-star-ml  { top: 38%; left: 2%;   width: 22px;  transform: rotate(-5deg); }
.d-circle-mr{ top: 42%; right: 3%;  width: 48px;  transform: rotate(8deg);  }
.d-dots-bl  { bottom: 18%; left: 4%;  width: 50px;  }
.d-wave-br  { bottom: 10%; right: 3%; width: 70px;  transform: rotate(6deg); }
.d-plus-tc  { top: 22%; right: 8%;  width: 18px;  }
.d-dots-r   { top: 55%; right: 2%;  width: 12px;  }

.page { position: relative; z-index: 1; }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* ── HERO ────────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 56px 0 40px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #fff;
  margin: 0 auto 20px;
  display: block;
  border: 3px solid #e8e5e0;
}

.hero-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.hero-tagline {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 400;
}

.hero-bio {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── LINKS ───────────────────────────────────────────────────────────────── */

.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.link-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  overflow: hidden;
  min-height: 112px;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, #ccc);
  border-radius: 16px 16px 0 0;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.link-card:active { transform: scale(0.98); }

.card-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0.75;
}

.card-desc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
}

.card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f4f4f2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg { width: 18px; height: 18px; }

.card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.card-name {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-handle {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-arrow {
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}

/* ── GROUP CARD ──────────────────────────────────────────────────────────── */

.group-card {
  grid-column: 1 / -1;
}

.group-links {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.group-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: opacity 0.12s;
}

.group-link:last-child { border-bottom: none; padding-bottom: 2px; }
.group-link:hover { opacity: 0.65; }

/* ── BAZI CARD ───────────────────────────────────────────────────────────── */

.bazi-card { grid-column: 1 / -1; }

.bazi-icon-box {
  font-size: 15px;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -1px;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding-top: 36px;
  font-size: 12px;
  color: var(--muted);
}

/* ── MOBILE ──────────────────────────────────────────────────────────────── */

@media (max-width: 430px) {
  .page          { padding: 0 16px 20px; }
  .hero          { padding: 22px 0 18px; }
  .avatar        { width: 68px; height: 68px; margin-bottom: 10px; }
  .hero-name     { font-size: 22px; margin-bottom: 4px; }
  .hero-tagline  { font-size: 13px; margin-bottom: 6px; }
  .hero-bio      { font-size: 12px; }

  .links-grid  { gap: 8px; }
  .link-card   { min-height: 100px; padding: 12px; }
  .card-desc   { font-size: 11px; }
  .card-bottom { margin-top: 10px; padding-top: 8px; gap: 6px; }
  .card-icon   { width: 26px; height: 26px; border-radius: 7px; }
  .card-icon svg { width: 15px; height: 15px; }
  .card-name   { font-size: 11px; }
  .card-handle { font-size: 9.5px; }
  .bazi-icon-box { width: 26px; height: 26px; font-size: 13px; }

  .footer { padding-top: 14px; }
}
