/* DOGS TALK CARD — UNDERDOGS design kit (260529): 3 brand colors, white ground, radius 0 */

@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "NanumHuman"; src: url("fonts/NanumHuman-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NanumHuman"; src: url("fonts/NanumHuman-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "NanumHuman"; src: url("fonts/NanumHuman-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
/* Japanese UI text — Pretendard JP (OFL), the same family as the printed JP deck. Subset to the UI strings. */
@font-face { font-family: "PretendardJPUI"; src: url("fonts/PretendardJPUI-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PretendardJPUI"; src: url("fonts/PretendardJPUI-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --accent: #F05519;
  --ink: #373938;
  --soft-ink: #4B4D4C;
  --muted: #878888;
  --muted-2: #A5A6A5;
  --line: #D9D9D9;
  --line-soft: #E4E4E4;
  --paper: #FFFFFF;
  --bg: #FBFBFB;

  --font-ko: "NanumHuman", system-ui, sans-serif;
  --font-en: "Poppins", "NanumHuman", sans-serif;
  --font-ja: "PretendardJPUI", "Hiragino Sans", "Yu Gothic", "Meiryo", "NanumHuman", system-ui, sans-serif;

  --card-h: min(60vh, 520px);
  --card-w: calc(var(--card-h) * 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ko);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: var(--font-en); }
html[lang="ja"] body { font-family: var(--font-ja); }

img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 8px 14px; z-index: 20;
}
.skip:focus { left: 8px; top: 8px; }

/* ── header ─────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.head-in {
  max-width: 1120px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 108px; height: auto; }
.brand-div { width: 1px; height: 16px; background: var(--line); }
.brand-name {
  font-family: var(--font-en); font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; color: var(--ink);
}
.langs { display: flex; gap: 2px; }
.langs a {
  font-size: 13px; line-height: 1; padding: 9px 12px;
  text-decoration: none; color: var(--muted);
  border: 1px solid transparent;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current="page"] {
  color: var(--paper); background: var(--ink); font-weight: 700;
}

/* ── intro ──────────────────────────────────────────── */
main { max-width: 1120px; margin: 0 auto; padding: 0 20px 64px; }
.intro { padding: 44px 0 26px; text-align: center; }
.kicker {
  margin: 0 0 12px;
  font-family: var(--font-en); font-weight: 600; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.intro h1 {
  margin: 0 0 10px;
  font-weight: 800; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.25;
  letter-spacing: -0.01em;
}
html[lang="en"] .intro h1 { font-weight: 600; }
.lede { margin: 0; color: var(--muted); font-size: 15px; }

/* ── card stage ─────────────────────────────────────── */
.deck { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.card {
  width: var(--card-w); height: var(--card-h);
  padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 1600px;
  -webkit-tap-highlight-color: transparent;
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.card-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.2, 0.72, 0.15, 1);
  will-change: transform;
}
.card.is-flipped .card-inner { transform: rotateY(180deg); }
.card.is-dealing .card-inner { transition: none; }

/* Deal motion lives on the outer .card so it never fights the inner rotateY flip. */
.card.is-out-next, .card.is-out-prev, .card.is-shuffling { pointer-events: none; }
.card.is-out-next  { animation: out-next 170ms ease-in forwards; }
.card.is-out-prev  { animation: out-prev 170ms ease-in forwards; }
.card.is-shuffling { animation: riffle 420ms ease-in-out forwards; }
.card.is-in-next   { animation: in-next 260ms cubic-bezier(0.2, 0.72, 0.15, 1); }
.card.is-in-prev   { animation: in-prev 260ms cubic-bezier(0.2, 0.72, 0.15, 1); }

@keyframes out-next { to { transform: translate3d(-64px, -10px, 0) rotate(-6deg); opacity: 0; } }
@keyframes out-prev { to { transform: translate3d(64px, -10px, 0) rotate(6deg); opacity: 0; } }
@keyframes in-next {
  from { transform: translate3d(58px, 16px, 0) rotate(5deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes in-prev {
  from { transform: translate3d(-58px, 16px, 0) rotate(-5deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes riffle {
  0%   { transform: none; opacity: 1; }
  18%  { transform: translate3d(-17px, -9px, 0) rotate(-6deg); }
  36%  { transform: translate3d(15px, -5px, 0) rotate(5deg); }
  54%  { transform: translate3d(-11px, -7px, 0) rotate(-4deg); }
  72%  { transform: translate3d(8px, -3px, 0) rotate(3deg); }
  100% { transform: translate3d(0, 8px, 0) scale(0.97); opacity: 0; }
}
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(55, 57, 56, 0.10), 0 10px 26px rgba(55, 57, 56, 0.10);
  overflow: hidden;
  contain: paint;
}
.face img { width: 100%; height: 100%; object-fit: cover; }
.face-front { transform: rotateY(180deg); }
.card:hover .face { box-shadow: 0 2px 4px rgba(55,57,56,.12), 0 16px 34px rgba(55,57,56,.14); }

.hint { margin: 0; font-size: 13px; color: var(--muted-2); min-height: 1.6em; }

/* ── controls ───────────────────────────────────────── */
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 14px; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--ink); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-accent:hover { background: #d94a14; border-color: #d94a14; }
.btn-ghost { background: transparent; }
.counter {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-family: var(--font-en); font-size: 14px; color: var(--muted);
  min-width: 74px; justify-content: center;
}
.counter b { font-weight: 600; font-size: 17px; color: var(--ink); }
.counter .sep { color: var(--line); }

/* ── all cards ──────────────────────────────────────── */
.all { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 22px; }
.all-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.all-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.grid {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
}
.grid li { margin: 0; }
.thumb {
  display: block; width: 100%; aspect-ratio: 70 / 100;
  padding: 0; border: 1px solid var(--line-soft); background: var(--paper);
  cursor: pointer; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { border-color: var(--ink); transform: translateY(-2px); }
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb[aria-current="true"] { border-color: var(--accent); }

/* ── footer ─────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--line); background: var(--paper);
  padding: 26px 20px 34px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.site-foot p { margin: 0; font-size: 12px; color: var(--muted); }

@media (max-width: 560px) {
  :root { --card-h: min(56vh, 440px); }
  .head-in { padding: 12px 16px; flex-wrap: wrap; }
  main { padding: 0 16px 48px; }
  .intro { padding: 30px 0 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .card-inner { transition-duration: 1ms; }
  .card.is-out-next, .card.is-out-prev, .card.is-shuffling,
  .card.is-in-next, .card.is-in-prev { animation: none; }
  .thumb { transition: none; }
}
