:root {
  --green: #2b4a30;      /* สีเดียวกับหญ้าขอบล่างของรูปพื้นหลัง */
  --ink: #000;
  --card: #fff;
  --page-bg: #e3ebe7;
}

* { box-sizing: border-box; }

/* หน้าเดียวพอดีจอ ไม่ให้เลื่อน (dvh = ความสูงจอจริงบนมือถือ ไม่นับแถบ URL) */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--page-bg);
  font-family: "Prompt", system-ui, sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  /* รูปพื้นหลังยาวเต็มหน้า ชิดล่างเพื่อให้เนินหญ้าอยู่ด้านล่างเสมอ */
  background: var(--green) url("assets/bg.webp") 50% 100% / cover no-repeat;
}

@media (min-width: 520px) {
  .page {
    margin: 24px auto;
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
  }
}

/* ---------- Hero ---------- */
/* ปกยืดหดกินพื้นที่ที่เหลือ ส่วนอื่นมีขนาดคงที่ */
.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 90px;
}

.logo {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 82%;
  max-height: 85%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 10px rgba(0, 60, 30, .25));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 6px)); }
}

/* ---------- Profile ---------- */
.profile {
  flex: none;
  position: relative;
  z-index: 3;
  margin-top: 0;
  padding: 0 24px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 0 14px rgba(0, 0, 0, .3);
}

.title {
  margin: 0 0 clamp(4px, 1vh, 8px);
  font-size: clamp(24px, min(8vw, 4.2vh), 34px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.bio {
  max-width: 300px;
  margin: 0 auto clamp(8px, 2vh, 18px);
  font-size: clamp(12px, 1.8vh, 14px);
  font-weight: 600;
  line-height: 1.55;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: clamp(12px, 3.2vh, 30px);
}
.socials a {
  color: #fff;
  display: grid;
  transition: transform .15s;
}
.socials a:hover { transform: scale(1.1); }

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-direction: column;
  flex: none;
  gap: clamp(9px, 1.6vh, 14px);
  padding: 0 14px clamp(10px, 2.4vh, 24px);
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(46px, 6.6vh, 56px);
  padding: 3px 52px 3px 3px; /* ขวาเท่ากับความกว้าง thumb เพื่อให้ข้อความอยู่กลางการ์ด */
  background: var(--card);
  color: #000;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 5px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.link-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 6px 0 var(--ink);
}
.link-card:active {
  transform: translate(3px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.thumb {
  flex: none;
  width: clamp(38px, 5.6vh, 48px);
  height: clamp(38px, 5.6vh, 48px);
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.thumb--plain { background: transparent; }
.thumb--ig {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.thumb--tt { background: #000; }
.thumb--web { background: linear-gradient(135deg, #3fbf7f, #1b7a4b); }

.label {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.more {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #555;
  font-size: 16px;
  cursor: pointer;
}
.more:hover { background: #eee; }

.footer {
  flex: none;
  padding: 0 0 clamp(10px, 2.2vh, 24px);
  text-align: center;
  font-size: 12px;
  opacity: .7;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s, transform .2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
