/* หน้าแรก: แฟ้มผลงานสองคน วางเหมือนรูปโพลารอยด์ติดเทปบนกระดาษสมุดจุด */
:root {
  --ink: #16142e;
  --muted: #5f5c78;
  --paper: #f8f6ff;
  --dot: #dcd6f3;
  --him: #6c4cf1;
  --her: #e8459b;
  --gold: #f2a900;
  --display: "Prompt", "IBM Plex Sans Thai", system-ui, sans-serif;
  font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; line-height: 1.6;
  background: radial-gradient(var(--dot) 1.2px, transparent 1.4px) 0 0 / 22px 22px, var(--paper);
}
.landing { max-width: 980px; margin: 0 auto; padding: clamp(32px, 7vh, 72px) 20px 56px; }
.intro { text-align: center; margin-bottom: clamp(28px, 6vh, 56px); }
.intro h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.intro p { margin: 10px 0 0; color: var(--muted); font-size: 1.05rem; }

.pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: clamp(12px, 3vw, 32px); }

/* การ์ดโพลารอยด์ */
.card {
  --c: var(--him);
  position: relative; display: block; text-decoration: none; color: inherit;
  background: #fff; border-radius: 22px; padding: 14px 14px 22px;
  box-shadow: 0 2px 0 rgba(22, 20, 46, .05), 0 22px 40px -22px rgba(40, 30, 110, .45);
  transform: rotate(var(--tilt, -2.5deg)); transition: transform .25s ease, box-shadow .25s ease;
}
.card.her { --c: var(--her); --tilt: 2.5deg; }
.card::before { /* เทปกาว */
  content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--c) 35%, #fff); opacity: .9; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.card:hover, .card:focus-visible { transform: rotate(0deg) translateY(-6px); box-shadow: 0 2px 0 rgba(22, 20, 46, .05), 0 30px 50px -24px rgba(40, 30, 110, .5); }
.card:focus-visible { outline: 3px solid var(--c); outline-offset: 4px; }

.photo {
  aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 85%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 60%, var(--gold)) 100%);
  color: #fff; font-family: var(--display); font-weight: 600; font-size: clamp(4rem, 12vw, 6.5rem);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.who { padding: 16px 6px 0; text-align: center; }
.card { display: flex; flex-direction: column; }
.card .who { flex: 1; display: flex; flex-direction: column; align-items: center; }
.card .who > :last-child { margin-top: auto; }
.card .who > :nth-last-child(2) { margin-bottom: 16px; }
.who h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 2.6vw, 1.55rem); margin: 0; line-height: 1.3; }
.role { color: var(--c); font-weight: 600; margin-top: 2px; }
.school { color: var(--muted); font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.chips span { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 60%, #14112b); }
.open {
  display: inline-block; margin-top: 16px; padding: 10px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  background: color-mix(in srgb, var(--c) 62%, #14112b); color: #fff;
}
.soon { display: inline-block; margin-top: 16px; padding: 8px 18px; border-radius: 999px; background: #f0eef6; color: var(--muted); font-size: .9rem; }

/* หัวใจตรงกลาง */
.heart { align-self: center; width: 54px; height: 54px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -12px rgba(232, 69, 155, .7); }
.heart::before {
  content: ""; width: 24px; height: 24px; background: var(--her);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.1C.9 8.6 3 5 6.5 5c2 0 3.5 1.1 4.3 2.4h2.4C14 6.1 15.5 5 17.5 5 21 5 23.1 8.6 21.6 11.9 19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.1C.9 8.6 3 5 6.5 5c2 0 3.5 1.1 4.3 2.4h2.4C14 6.1 15.5 5 17.5 5 21 5 23.1 8.6 21.6 11.9 19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.skeleton { min-height: 460px; background: #fff; }
.error { grid-column: 1 / -1; text-align: center; color: var(--muted); }

/* เข้าหน้า: การ์ดลอยขึ้นพร้อมกัน แล้วหัวใจเด้ง (ครั้งเดียว) */
@media (prefers-reduced-motion: no-preference) {
  .pair.ready .card { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
  .pair.ready .card.her { animation-delay: .08s; }
  .pair.ready .heart { animation: pop .5s .45s cubic-bezier(.2, .9, .3, 1.5) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(28px) rotate(0deg); } }
  @keyframes pop { from { opacity: 0; transform: scale(.3); } }
}

@media (max-width: 720px) {
  .pair { grid-template-columns: 1fr; justify-items: center; gap: 22px; }
  .card { width: min(360px, 100%); }
  .heart { width: 46px; height: 46px; margin: -4px 0; }
  .skeleton { min-height: 380px; width: min(360px, 100%); }
}
