:root {
  --bg: #FBF7EF;
  --text: #2B2418;
  --muted: #8A7A5C;
  --card: #FFFFFF;
  --border: #EADFC8;
  --accent: #B8892B;
  --accent-soft: #F5ECD9;
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Noto Sans", "Noto Sans Thai", "Noto Sans Khmer", "Noto Sans Lao",
    "Noto Sans Myanmar", "Noto Sans Devanagari", "PingFang SC", "Microsoft YaHei",
    Arial, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ---------- Language bar ---------- */
.lang-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 12px 16px 6px;
  background: linear-gradient(var(--bg) 70%, rgba(251,247,239,0));
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(120, 90, 30, .08);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.lang-btn:active { transform: scale(.97); }
.lang-btn .flag { font-size: 18px; line-height: 1; }
.lang-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lang-btn .globe { color: var(--accent); }
.lang-btn .chev { color: var(--muted); transition: transform .2s ease; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* Bottom sheet picker (mobile) */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 20, 30, .35);
  opacity: 0; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; }

.sheet {
  position: fixed; z-index: 50;
  left: 0; right: 0; bottom: 0;
  max-height: 78vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 30px rgba(20,30,50,.12);
}
.sheet.open { transform: translateY(0); }

.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #E3D6BC; margin: 4px auto 10px; }
.sheet-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; }

.lang-list { list-style: none; }
.lang-list li button {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border: 0; border-radius: 14px;
  background: transparent;
  font-size: 16px; text-align: left;
  cursor: pointer;
}
.lang-list li button:hover { background: var(--card); }
.lang-list .flag { font-size: 22px; width: 28px; text-align: center; }
.lang-list .native { font-weight: 600; flex: 1; }
.lang-list .region { font-size: 13px; color: var(--muted); }
.lang-list .check { width: 20px; height: 20px; color: var(--accent); visibility: hidden; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lang-list button[aria-selected="true"] { background: var(--accent-soft); }
.lang-list button[aria-selected="true"] .check { visibility: visible; }

/* Larger screens: dropdown instead of bottom sheet */
@media (min-width: 640px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 58px;
    width: 340px; max-height: 70vh;
    border-radius: 20px;
    transform: translate(-50%, -8px);
    opacity: 0; pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    border: 1px solid var(--border);
    padding-bottom: 10px;
  }
  .sheet.open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
  .sheet-handle { display: none; }
  .sheet-title { padding-top: 6px; }
  .sheet-backdrop { background: transparent; }
}

/* ---------- Content ---------- */
.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 18px 36px;
}

.hero { text-align: center; margin-bottom: 22px; }
.name {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.02;
}
.tagline {
  margin-top: 8px;
  font-size: clamp(15px, 4.2vw, 18px);
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px;
  padding: 0 16px 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 15px; font-weight: 600;
  transition: transform .15s ease, background .15s ease;
}
.pill:active { transform: scale(.97); }
.pill img { border-radius: 7px; }
.pill-empty { padding: 0 10px; opacity: .45; }

.cards { display: flex; flex-direction: column; gap: 14px; }

.card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
a.card:hover { border-color: #D9C08A; box-shadow: 0 4px 18px rgba(184,137,43,.12); }
a.card:active { transform: scale(.985); }
.card.featured { border-color: #D9C08A; box-shadow: 0 0 0 3px var(--accent-soft); }

.card-icon {
  flex: 0 0 auto;
  width: 60px; height: 60px;
  border-radius: 16px;
  display: grid; place-items: center;
}
.card-icon img { width: 60px; height: 60px; border-radius: 16px; display: block; }

.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.25; margin-bottom: 4px; }
.card-desc { font-size: 14px; line-height: 1.45; color: var(--muted); }

.card-go {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--accent);
}
.card-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Empty placeholder cards (7, 8, 9) */
.card.empty .card-go { border-color: #E3D6BC; color: #E3D6BC; }
.skel { height: 12px; border-radius: 6px; background: #F1E8D6; }
.skel.t { width: 55%; height: 15px; margin-bottom: 9px; }
.skel.d { width: 85%; }

.foot {
  margin-top: 30px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 360px) {
  .card { padding: 14px; gap: 12px; }
  .card-icon, .card-icon img { width: 50px; height: 50px; border-radius: 14px; }
  .card-title { font-size: 16px; }
  .card-desc { font-size: 13px; }
  .card-go { width: 38px; height: 38px; }
}
