:root {
  --bg: #f7f4ee;
  --ink: #0f172a;
  --muted: #475569;
  --card-bg: #efe0b7;
  --panel-border: #0f172a;
  --max-width: 1024px;
  --radius-xl: 28px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.04) 2.08%, rgba(15, 23, 42, 0) 2.08%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 2.08%, rgba(15, 23, 42, 0) 2.08%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto;
  font-family: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(2px);
  background: rgba(247, 244, 238, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  width: 130px;
  height: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 700;
}

.hero {
  padding-top: 48px;
}

.hero-inner h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(40px, 6vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hero-inner p {
  margin: 24px 0 0;
  text-align: center;
  font-size: 18px;
  line-height: 1.7;
  color: #1e293b;
  font-weight: 600;
}

.hero-visual {
  --merge-progress: 0;
  --cards-opacity: 1;
  position: relative;
  margin: 0px auto 0;
  width: min(100%, 840px);
  height: 1060px;
}

.line-circle {
  position: absolute;
  top: 60px;
  left: 50%;
  width: min(92%, 640px);
  transform: translateX(-50%);
}

.floating-cards {
  position: absolute;
  top: 65px;
  left: 50%;
  width: 640px;
  height: 230px;
  transform: translateX(-50%);
  pointer-events: none;
}

.card {
  position: absolute;
  width: 112px;
  height: auto;
  --base-rotate: 0deg;
  --merge-x: 0px;
  --merge-y: 0px;
  --merge-scale: 0.42;
  transform:
    translate(
      calc(var(--merge-x) * var(--merge-progress)),
      calc(var(--merge-y) * var(--merge-progress))
    )
    rotate(calc(var(--base-rotate) - (var(--base-rotate) * var(--merge-progress))))
    scale(calc(1 - (var(--merge-scale) * var(--merge-progress))));
  transform-origin: center center;
  opacity: calc(var(--cards-opacity) * (1 - (0.12 * var(--merge-progress))));
  will-change: transform, opacity;
}

.card-1 {
  left: 42px;
  top: 44px;
  --base-rotate: -8deg;
}

.card-2 {
  left: 122px;
  top: 52px;
  --base-rotate: -11deg;
}

.card-3 {
  left: 213px;
  top: 20px;
  --base-rotate: 5deg;
}

.card-4 {
  left: 318px;
  top: 8px;
  --base-rotate: 2deg;
}

.card-5 {
  left: 420px;
  top: 26px;
  --base-rotate: 7deg;
}

.card-6 {
  left: 522px;
  top: 44px;
  --base-rotate: 11deg;
}

.line-arrow {
  position: absolute;
  top: 300px;
  left: 50%;
  width: 68px;
  transform: translateX(-50%);
}

.phone-mock {
  position: absolute;
  top: 430px;
  left: 50%;
  width: min(320px, 54vw);
  aspect-ratio: 269 / 504;
  transform: translateX(-50%) scale(calc(1 + (0.05 * var(--merge-progress))));
  transform-origin: center top;
  filter: drop-shadow(0 8px 12px rgba(15, 23, 42, calc(0.08 * var(--merge-progress))));
  will-change: transform, filter;
}

.phone-shell {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.phone-cards-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  /* スマホ内のカード表示領域だけを切り出す */
  clip-path: inset(52% 12% 4.5% 12% round 14px);
  will-change: transform, opacity;
}

.phone-cards-layer.bounce {
  animation: phone-bounce 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes phone-bounce {
  0% {
    transform: translateY(10px) scale(0.94);
  }
  45% {
    transform: translateY(-8px) scale(1.04);
  }
  72% {
    transform: translateY(2px) scale(0.99);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.steps {
  padding: 120px 0 80px;
}

.steps h2 {
  margin: 0;
  font-size: clamp(38px, 4.4vw, 56px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.step-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.step-card {
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  padding: 24px;
}

.step-illust {
  position: relative;
  height: 170px;
  border-radius: 20px;
  overflow: hidden;
}

.step-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.step-no {
  font-size: 40px;
  margin: 18px 0 0;
  /* font-size: 62px; */
  font-weight: 900;
  letter-spacing: 0.01em;
}

.step-card h3 {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
}

.step-card p {
  margin: 16px 0 0;
  /* font-size: 24px; */
  line-height: 1.8;
}

.step-card > .step-no + h3 + p {
  color: var(--muted);
  font-size: 16px;
}

.blob-coral {
  position: absolute;
  right: 22px;
  top: 30px;
  width: 96px;
  height: 120px;
  background: #ed6651;
  border-radius: 45% 55% 54% 46% / 52% 40% 60% 48%;
}

.mini-ui {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 126px;
  height: 106px;
  border-radius: 18px;
  background: #e2e8f0;
  box-shadow: inset 0 8px 0 #cbd5e1;
}

.mini-ui::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 36px;
  width: 92px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
}

.mini-ui::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 15px;
  width: 56px;
  height: 10px;
  border-radius: 6px;
  background: #f8fafc;
}

.eyes,
.eyes-small {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
}

.eyes::before,
.eyes::after,
.eyes-small::before,
.eyes-small::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 6px #111827;
}

.eyes {
  right: 50px;
  bottom: 46px;
}

.eyes-small {
  right: 41px;
  top: 64px;
}

.eyes-small::before,
.eyes-small::after {
  width: 16px;
  height: 16px;
  box-shadow: inset 0 0 0 5px #111827;
}

.blob-blue {
  position: absolute;
  left: 16px;
  top: 26px;
  width: 86px;
  height: 96px;
  background: #59b3ec;
  border-radius: 52% 48% 55% 45% / 60% 45% 55% 40%;
}

.tag-list {
  position: absolute;
  right: 8px;
  top: 20px;
  display: grid;
  gap: 10px;
}

.tag-list span {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid #111827;
  border-radius: 999px;
  background: #f6efcf;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  transform: rotate(-9deg);
}

.tag-list span:nth-child(2) {
  transform: rotate(8deg);
}

.search-box {
  position: absolute;
  top: 24px;
  left: 14px;
  right: 14px;
  padding: 8px 12px;
  border: 2px solid #111827;
  border-radius: 999px;
  background: #f6efcf;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.half-blob {
  position: absolute;
  right: 16px;
  bottom: 0;
  width: 130px;
  height: 82px;
  border-radius: 82px 82px 0 0;
  background: #eb67be;
}

.download {
  padding: 70px 0 84px;
}

.download-panel {
  position: relative;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 76px 30px 42px;
  text-align: center;
}

.download-panel h2 {
  margin: 0;
  font-size: clamp(40px, 5.6vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.download-panel p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
}

.app-icon {
  display: block;
  width: 160px;
  margin: 34px auto 18px;
}

.store-link {
  display: inline-block;
  /* width: 200px; */
}

.store-link img {
  width: min(200px, 72vw);
  height: auto;
}

.download-chara {
  position: absolute;
  right: -10px;
  bottom: -18px;
  width: 126px;
}

.site-footer {
  border-top: 1px solid rgb(15 23 42);
  padding: 54px 0 64px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer-logo {
  width: 140px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .container {
    padding: 0 24px;
  }

  .header-inner {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .hero {
    padding-top: 100px;
  }

  .hero-inner h1 {
    font-size: clamp(36px, 10.8vw, 32px);
  }

  .hero-inner p {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.7;
    font-weight: 600;
  }

  .hero-visual {
    margin-top: 46px;
    height: 702px;
  }

  .line-circle {
    top: 12px;
    width: min(100%, 100%);
  }

  .floating-cards {
    width: 100%;
    height: 100%;
    top: 34px;
  }

  .card {
    width: 30%;
    --merge-scale: 0.34;
  }

  .card-1 {
    left: 5%;
    top: -66px;
  }

  .card-2 {
    left: 16%;
    top: -60px;
  }

  .card-3 {
    left: 25%;
    top: -90px;
  }

  .card-4 {
    left: 41%;
    top: -66px;
  }

  .card-5 {
    left: 54%;
    top: -86px;
  }

  .card-6 {
    left: 68%;
    top: -42px;
  }

  .line-arrow {
    top: 212px;
    width: 44px;
  }

  .phone-mock {
    top: 290px;
    width: 184px;
  }

  .steps {
    padding: 28px 0 52px;
  }

  .steps h2 {
    font-size: clamp(32px, 9vw, 32px);
    line-height: 1.3;
  }

  .step-grid {
    margin-top: 22px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step-card {
    padding: 14px;
    border-radius: 20px;
  }

  .step-illust {
    height: 118px;
  }

  .step-no {
    margin-top: 12px;
    font-size: 24px;
    line-height: 1;
  }

  .step-card h3 {
    font-size: 30px;
    line-height: 1.45;
  }

  .step-card p {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.6;
  }

  .blob-coral {
    width: 76px;
    height: 94px;
    right: 12px;
    top: 14px;
  }

  .mini-ui {
    width: 110px;
    height: 88px;
    left: 8px;
    top: 10px;
  }

  .mini-ui::before {
    left: 11px;
    top: 32px;
    width: 84px;
    height: 41px;
  }

  .mini-ui::after {
    top: 13px;
  }

  .eyes-small {
    right: 22px;
    top: 50px;
  }

  .blob-blue {
    left: 8px;
    top: 15px;
    width: 70px;
    height: 79px;
  }

  .tag-list {
    gap: 5px;
    top: 12px;
  }

  .tag-list span {
    font-size: 15px;
    border-width: 1.5px;
    padding: 3px 8px;
  }

  .search-box {
    top: 14px;
    left: 8px;
    right: 8px;
    font-size: 19px;
    padding: 5px 9px;
    border-width: 1.5px;
  }

  .half-blob {
    width: 106px;
    height: 66px;
    right: 8px;
  }

  .eyes {
    right: 48px;
    bottom: 25px;
  }

  .eyes::before,
  .eyes::after {
    width: 14px;
    height: 14px;
    box-shadow: inset 0 0 0 4px #111827;
  }

  .download {
    padding: 34px 0 48px;
  }

  .download-panel {
    border-width: 1.5px;
    padding: 34px 16px 18px;
  }

  .download-panel h2 {
    font-size: clamp(36px, 10vw, 32px);
    line-height: 1.2;
  }

  .download-panel p {
    margin-top: 12px;
    font-size: 14px;
  }

  .app-icon {
    width: 180px;
    margin: 32px auto 32px;
  }

  .store-link img {
    width: min(240px, 72vw);
  }

  .download-chara {
    width: 82px;
    right: -5px;
    bottom: -10px;
  }

  .site-footer {
    padding: 28px 0 38px;
  }

  .footer-logo {
    width: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .phone-mock {
    transform: none;
    opacity: 1;
    filter: none;
  }

  .phone-cards-layer.bounce {
    animation: none;
  }
}
