/* =========================================================
   Hatch Lab — ペタポン product page (/petapon)
   색·서체는 앱의 팔레트(apps/mobile/src/ui/tokens/palette.js)와
   docs/brand-guidelines.md §9.2를 따른다. 회사 크림·잉크 위에
   제품 핑크를 얹는 구조 — 법무 페이지(legal.css)와 헤더·푸터를 공유한다.
   ========================================================= */

:root {
  /* Hatch Lab */
  --cream: #FBF8F2;
  --paper: #FFFFFF;
  --sand: #F2EDE3;
  --ink: #20262E;
  --ink-soft: #5C6470;
  --ink-faint: #8A9098;
  --coral: #E96B5C;
  --coral-deep: #D2503F;
  --border: #E7E0D3;

  /* ペタポン — 앱 팔레트 그대로 */
  --pp-surface: #FFFAF5;
  --pp-ink: #1F1523;
  --pp-ink-soft: #5C4A66;
  --pp-ink-faint: #9C8BA6;
  --pp-pink-50: #FFF1F7;
  --pp-pink-100: #FFE3EF;
  --pp-pink-300: #FFA3CD;
  --pp-pink: #FF5EA8;
  --pp-pink-600: #F03D92;
  --pp-pink-700: #D21F77;
  --pp-lav-50: #F6F3FF;
  --pp-lav-300: #C9B6F6;
  --pp-lav-700: #7A50C9;
  --pp-mint-50: #EEFAF4;
  --pp-mint-300: #A3E6C8;
  --pp-mint-700: #2C9C70;

  --display: "Schibsted Grotesk", sans-serif;
  --product: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;

  --container: 1120px;
  --pad: clamp(20px, 5vw, 56px);
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--pp-surface);
  color: var(--pp-ink);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--pp-pink-600); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--pad); }

.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header (legal.css와 같은 골격) ---------- */
.doc-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 250, 245, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--pp-pink-100);
}
.doc-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-word { font-family: var(--display); font-size: 1rem; letter-spacing: -0.01em; font-weight: 500; color: var(--ink); }
.brand-word b { font-weight: 800; }
.doc-app { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--pp-pink-700); text-transform: uppercase; white-space: nowrap; }

/* ---------- typography ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.16em;
  text-transform: lowercase; color: var(--pp-pink-700); margin-bottom: 18px;
}
.h2 {
  font-family: var(--product); font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.35; letter-spacing: 0.01em;
  text-wrap: balance;
}
.h2 em { font-style: normal; color: var(--pp-pink-600); }
.lead { font-size: clamp(1rem, 1.5vw, 1.12rem); color: var(--pp-ink-soft); max-width: 40ch; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 8vh, 96px) clamp(56px, 9vh, 110px); }
.hero-glow {
  position: absolute; top: -20%; right: -10%; width: 70vw; height: 70vw; max-width: 860px; max-height: 860px;
  background: radial-gradient(circle, rgba(255, 94, 168, 0.16), rgba(255, 94, 168, 0) 62%);
  pointer-events: none;
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px); align-items: center;
}
.wordmark { width: min(340px, 78%); height: auto; margin: 6px 0 22px; }
.hero h1 {
  font-family: var(--product); font-weight: 900;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.3; letter-spacing: 0.01em;
  color: var(--pp-ink); text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--pp-pink-600); }
.hero .lead { margin-top: 18px; }
.hero-note { margin-top: 10px; font-size: 0.92rem; color: var(--pp-ink-faint); }

.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.7em 1.15em; border-radius: 100px;
  background: var(--pp-ink); color: var(--pp-surface);
  font-family: var(--display); font-weight: 600; font-size: 0.92rem;
}
.store svg { width: 18px; height: 18px; fill: currentColor; }
.store { transition: transform 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.store:hover {
  transform: translateY(-2px); background: var(--pp-pink-600);
  box-shadow: 0 14px 28px -14px rgba(240, 61, 146, 0.65);
}

/* 원본 → 화살표 → 16장: 스토어 1번 카드와 같은 구도를 HTML로 다시 짠다 */
.make { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.make-head { position: relative; width: min(260px, 60%); aspect-ratio: 1; }
.make-src {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: 0 0 0 1px rgba(31, 21, 35, 0.08), 0 24px 40px -24px rgba(31, 21, 35, 0.35);
}
.pop {
  position: absolute; width: 46%; height: auto; top: 44%;
  filter: drop-shadow(0 10px 16px rgba(31, 21, 35, 0.22));
}
.pop-l { right: 84%; transform: rotate(-11deg); }
.pop-r { left: 84%; transform: rotate(9deg); }
.make-arrow {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pp-pink); color: #fff;
  box-shadow: 0 6px 16px rgba(240, 61, 146, 0.3);
}
.make-arrow svg { width: 20px; height: 20px; }
.make-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 520px; }
.make-grid li {
  aspect-ratio: 370 / 320; border-radius: 16px; padding: 4px;
  background: #fff; border: 2px solid var(--pp-pink-100);
  display: grid; place-items: center;
  animation: popin 0.55s var(--ease) both;
  animation-delay: calc(0.35s + var(--i) * 55ms);
}
.make-grid img { width: 100%; height: 100%; object-fit: contain; }
@keyframes popin {
  from { opacity: 0; transform: scale(0.78) translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 9vh, 110px); }
.section-head { max-width: 680px; margin-bottom: clamp(30px, 5vh, 52px); }
.section-head .lead { margin-top: 14px; }
.section.alt { background: var(--pp-lav-50); }
.section.mint { background: var(--pp-mint-50); }

/* 3열 화면 카드 — 순서(1·2·3)가 실제 흐름이므로 번호를 단다 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 28px); }
.step {
  background: #fff; border: 1px solid var(--pp-pink-100); border-radius: var(--radius);
  padding: clamp(20px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 18px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.step:hover { transform: translateY(-5px); box-shadow: 0 30px 50px -38px rgba(31, 21, 35, 0.45); }
.step-no { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.14em; color: var(--pp-pink-700); }
.step h3 { font-family: var(--product); font-weight: 700; font-size: 1.22rem; line-height: 1.45; letter-spacing: 0.01em; }
.step p { font-size: 0.94rem; color: var(--pp-ink-soft); }
.step-text { display: flex; flex-direction: column; gap: 6px; }

/* 화면은 창(window)으로 보여준다 — 폰 한 대를 통째로 세우면 카드가 세로로 늘어져 3열이 읽히지 않는다.
   기본은 위쪽, 시트가 아래에 뜨는 화면은 .tail로 아래쪽을 보인다. */
.shot {
  position: relative; border-radius: 24px; padding: 8px; background: var(--pp-surface);
  border: 1px solid var(--pp-pink-100); align-self: center; width: min(100%, 250px); height: 330px;
  overflow: hidden;
}
.shot img { border-radius: 17px; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot.tail img { object-position: bottom; }
.shot::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 56px; pointer-events: none;
  border-radius: 0 0 17px 17px;
  background: linear-gradient(to bottom, rgba(255, 250, 245, 0), var(--pp-surface));
}
.shot.tail::after { top: 8px; bottom: auto; border-radius: 17px 17px 0 0; background: linear-gradient(to top, rgba(255, 250, 245, 0), var(--pp-surface)); }

/* 타입 2×2 (step 1의 그림) */
.types-mini { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 250px); align-self: center; align-content: center; height: 330px; }
.types-mini li { aspect-ratio: 370 / 320; border-radius: 14px; background: var(--pp-surface); border: 1px solid var(--pp-pink-100); padding: 4px; display: grid; place-items: center; }
.types-mini img { width: 100%; height: 100%; object-fit: contain; }
.types-mini .src {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34%; height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: 0 8px 18px rgba(31, 21, 35, 0.22);
}

/* Small, playable scenes stay inside the existing step-card layout. */
.product-demo {
  position: relative;
  width: min(100%, 250px);
  height: 330px;
  align-self: center;
  flex: none;
}
.demo-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.product-demo .demo-hint {
  position: absolute;
  bottom: 0;
  left: -10px;
  right: -10px;
  text-align: center;
  font: 700 12px/1.6 var(--product);
  color: var(--pp-pink-700);
}
.demo-phone {
  position: absolute;
  top: 6px;
  right: 7%;
  width: 62%;
  height: auto;
  max-height: 294px;
  object-fit: cover;
  object-position: top;
  border: 5px solid #fff;
  border-radius: 23px;
  box-shadow: 0 0 0 1px #1f152310, 0 16px 25px -15px #1f152333;
}
.gacha-demo .pp-real-machine {
  position: absolute;
  left: -14px;
  bottom: 23px;
  width: 154px;
  height: 185px;
  z-index: 2;
}
.gacha-demo .pp-machine-canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 8px #d21f7714);
}
.gacha-demo .pp-real-crank {
  position: absolute;
  left: calc(50% - 22px);
  top: calc(55.36% - 22px);
  width: 44px;
  height: 44px;
  border: 2px solid var(--pp-pink-700);
  border-radius: 50%;
  background: #fff;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.gacha-demo .pp-real-crank::before {
  content: "";
  position: absolute;
  left: 21.43%;
  top: 41.43%;
  width: 57.14%;
  height: 17.14%;
  border-radius: 7px;
  background: var(--pp-pink-700);
}
.gacha-demo .pp-real-crank:focus-visible { outline-offset: 6px; }
.product-demo button:is(:disabled, [aria-disabled="true"]) { cursor: default; }
.gacha-demo .pp-capsule {
  position: absolute;
  z-index: 4;
  left: calc(50% - 21px);
  top: 74%;
  width: 42px;
  height: 42px;
  pointer-events: none;
}
.gacha-demo .pp-cap-top,
.gacha-demo .pp-cap-bottom {
  position: absolute;
  left: 0;
  width: 42px;
  height: 21px;
  box-shadow: 0 4px 7px #c0407920;
}
.gacha-demo .pp-cap-top { top: 0; background: #ffa3cd; border-radius: 21px 21px 0 0; }
.gacha-demo .pp-cap-top::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffffd9;
}
.gacha-demo .pp-cap-bottom { top: 21px; background: #fff6ec; border-top: 1px solid #d21f7730; border-radius: 0 0 21px 21px; }
.gacha-demo .lf-stamps { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gacha-demo .lf-stamps img {
  position: absolute;
  width: 37%;
  height: auto;
  filter: drop-shadow(0 6px 7px #1f15231c);
}
.gacha-demo [data-slot="0"] { right: -2%; top: 0; transform: rotate(8deg); }
.gacha-demo [data-slot="1"] { left: 0; top: 26%; transform: rotate(-9deg); }
.gacha-demo [data-slot="2"] { right: 0; bottom: 12%; transform: rotate(5deg); }
.gacha-demo [data-slot="3"] { left: 0; top: 0; transform: rotate(-12deg); }
.gacha-demo [data-slot="4"] { right: -2%; top: 40%; transform: rotate(10deg); }

/* ClawScene's rail, cable, mirrored prongs, capsule and lower cabinet. */
.claw-machine { position: relative; width: min(100%, 226px); margin: 0 auto; aspect-ratio: 250 / 310; }
.claw-art { display: block; width: 100%; height: 100%; filter: drop-shadow(0 8px 7px #7a50c90d); }
.claw-start {
  position: absolute;
  right: 4.8%;
  bottom: 6.8%;
  width: 44px;
  height: 44px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #8d64da;
  color: #fff;
  font: 900 12px/1 var(--product);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 0 #7a50c9;
}
.claw-start:hover { background: #7a50c9; }
.claw-start:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a50c9; }
.claw-start:is(:disabled, [aria-disabled="true"]) { background: #7a50c9; opacity: .6; }
.claw-start:focus-visible { outline-color: #7a50c9; outline-offset: 5px; }
.claw-results {
  position: absolute;
  inset: 16% 10% 27%;
  padding: 7px;
  border: 1px solid #c9b6f6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px #7a50c918;
}
.claw-results p { font: 700 11px/1.5 var(--product); color: #7a50c9; text-align: center; }
.claw-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; height: calc(100% - 18px); }
.claw-result-grid img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.claw-demo .demo-hint { color: #7a50c9; }
.claw-demo:has(.claw-reset:not([hidden])) .demo-hint { bottom: 24px; }
.claw-reset {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #7a50c9;
  font: 500 11px/1.5 var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

/* ---------- types ---------- */
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.type {
  background: #fff; border: 1px solid var(--pp-lav-300); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.type-img { padding: 16px 16px 6px; display: grid; place-items: center; }
.type-img img { width: 100%; height: auto; }
.type-body { padding: 12px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.type h3 { font-family: var(--product); font-weight: 700; font-size: 1.06rem; color: var(--pp-lav-700); }
.type p { font-size: 0.88rem; color: var(--pp-ink-soft); line-height: 1.7; }
.types-note { margin-top: 18px; font-size: 0.9rem; color: var(--pp-ink-faint); }

/* ---------- trust ---------- */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.trust li {
  background: #fff; border: 1px solid var(--pp-mint-300); border-radius: var(--radius);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 8px;
}
.trust h3 { font-family: var(--product); font-weight: 700; font-size: 1.04rem; color: var(--pp-mint-700); }
.trust p { font-size: 0.9rem; color: var(--pp-ink-soft); line-height: 1.75; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.legal-links a {
  display: inline-block; padding: 6px 14px; border-radius: 100px;
  background: #fff; border: 1px solid var(--border); font-size: 0.86rem; color: var(--pp-ink-soft);
  transition: color .2s, border-color .2s, transform .3s var(--ease);
}
.legal-links a:hover { color: var(--pp-pink-700); border-color: var(--pp-pink-300); transform: translateY(-2px); }

/* ---------- contact strip ---------- */
.ask { text-align: center; padding-block: clamp(48px, 8vh, 90px); }
.ask p { color: var(--pp-ink-soft); }
.ask a.mail {
  display: inline-block; margin-top: 12px; font-family: var(--mono); font-weight: 500;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--pp-ink);
  border-bottom: 2px solid var(--pp-pink-300); padding-bottom: 4px; transition: color .25s, border-color .25s;
}
.ask a.mail:hover { color: var(--pp-pink-700); border-color: var(--pp-pink-700); }
.sns-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.sns-links a {
  display: inline-block; padding: 6px 16px; border-radius: 100px;
  background: #fff; border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--pp-ink-soft);
  transition: color .2s, border-color .2s, transform .3s var(--ease);
}
.sns-links a:hover { color: var(--pp-pink-700); border-color: var(--pp-pink-300); transform: translateY(-2px); }

/* ---------- footer (legal.css와 동일) ---------- */
.doc-footer { background: var(--ink); color: var(--cream); padding-block: 44px 32px; }
.doc-footer a { color: var(--cream); }
.doc-footer-note { font-size: 0.86rem; color: rgba(251, 248, 242, 0.7); padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid rgba(251, 248, 242, 0.16); }
.doc-footer-biz { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px; font-size: 0.84rem; }
.doc-footer-biz dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(251, 248, 242, 0.5); margin-bottom: 3px; }
.doc-footer-biz dd { color: rgba(251, 248, 242, 0.9); line-height: 1.65; }
.doc-footer-bottom {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(251, 248, 242, 0.16);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 22px;
  font-size: 0.78rem; color: rgba(251, 248, 242, 0.6); font-family: var(--mono);
}
.doc-footer-bottom nav { display: flex; flex-wrap: wrap; gap: 16px; }
.doc-footer-bottom a:hover { color: var(--pp-pink-300); }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .make { margin-top: 12px; }
  .steps, .trust { grid-template-columns: 1fr; }
  .types { grid-template-columns: repeat(2, 1fr); }
  .step { flex-direction: row; align-items: center; }
  .step .shot, .step .types-mini, .step .product-demo { width: 40%; max-width: 250px; flex: none; }
}
@media (max-width: 560px) {
  .types { grid-template-columns: 1fr; }
  .step { flex-direction: column; align-items: stretch; }
  .step .shot, .step .types-mini, .step .product-demo { width: min(100%, 250px); }
  .doc-footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
