:root {
  --paper: #fbf6ee;
  --paper-2: #f4ebdd;
  --ink: #3a2f27;
  --ink-soft: #76675a;
  --line: #e6dac8;
  --accent: #d9773a;
  --accent-deep: #bf6229;
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --s: 1; /* the dog's scale, set from site.js by window width */
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* room at the end of the page so the last lines can scroll up above
     the dog napping in the corner */
  padding-bottom: calc(150px * var(--s));
}

img { max-width: 100%; }
a { color: inherit; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .9em;
  background: var(--paper-2);
  padding: .05em .35em;
  border-radius: 4px;
}

/* ---- touch vs pointer copy ---- */
.lead-touch { display: none; }
@media (hover: none) {
  .lead-pointer { display: none; }
  .lead-touch { display: inline; }
}

/* keep each phrase on one line; break only between phrases */
.nw { display: inline-block; }

/* ---- header ---- */
.site-head {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: .04em;
}
.head-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}
.head-link:hover { background: var(--ink); color: var(--paper); }

/* ---- hero ---- */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) 24px 0;
  text-align: center;
}
h1 {
  font-size: clamp(22px, 4.4vw, 52px);
  line-height: 1.35;
  font-weight: 900;
  margin: 0 0 16px;
  letter-spacing: .02em;
}
.lead {
  color: var(--ink-soft);
  font-size: clamp(15px, 1.7vw, 18px);
  margin: 0;
}

/* ---- download ---- */
.download {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) 24px 40px;
}
.download-card {
  text-align: center;
  background: var(--paper-2);
  border-radius: 28px;
  padding: 40px 28px 44px;
}
h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  margin: 0 0 4px;
  letter-spacing: .03em;
}
.download-lead { margin: 0 0 22px; color: var(--ink-soft); }
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 48px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: .04em;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 10px 22px -10px rgba(191, 98, 41, .8);
  transition: background .15s ease, transform .15s ease;
}
.btn small { font-size: 12px; font-weight: 500; opacity: .9; letter-spacing: .02em; }
.btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 0 52px;
  color: var(--ink-soft);
  font-size: 15px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
}
.steps strong { display: block; color: var(--ink); font-size: 16px; }
.req {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- footer ---- */
.site-foot {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 20px 24px;
  font-size: 13px;
  color: var(--ink-soft);
}
.site-foot p { margin: 0; }

/* ---- the dog ----
   Same box as the app's window (173x200, sprite bottom-aligned inside),
   fixed to the browser window the way the app sits on the real screen. */
.dog {
  --dw: calc(173px * var(--s));
  position: fixed;
  left: 0;
  bottom: 0; /* anchored to the bottom so it tracks mobile toolbars */
  width: var(--dw);
  height: calc(var(--dw) * 200 / 173);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  z-index: 100;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  visibility: hidden; /* until site.js has placed it */
}
.dog.placed { visibility: visible; }
.dog.dragging { cursor: grabbing; }
.dog .flip {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: transform .15s ease-out;
}
.dog .flip.flipped { transform: scaleX(-1); }
.dog img {
  display: block;
  max-height: 73.5%;
  max-width: 90%;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* a soft contact shadow so the dog sits on something */
.dog::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 1%;
  height: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 30, 20, .22), transparent);
  z-index: -1;
  pointer-events: none;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 66%;
  /* --nudge keeps the bubble inside the window when the dog is near an
     edge (set from site.js); the arrow stays pointing at the dog. */
  transform: translateX(calc(-50% + var(--nudge, 0px)));
  white-space: nowrap;
  font-size: clamp(12px, calc(14px * var(--s)), 14px);
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  padding: .45em 1em;
  border-radius: 999px;
  box-shadow: 0 6px 16px -6px rgba(58,47,39,.4);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
  animation: hint-bob 2.4s ease-in-out infinite;
}
.hint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: calc(-6px - var(--nudge, 0px));
  border: 6px solid transparent;
  border-top-color: #fff;
}
@media (max-width: 480px) { h1 { font-size: 6.2vw; } }

/* the bubble is for the first impression; once you're reading further
   down, it would only sit on top of the text */
.dog.petted .hint,
.dog.awake .hint,
.scrolled .dog .hint { opacity: 0; transform: translateX(calc(-50% + var(--nudge, 0px))) translateY(6px); animation: none; }
@keyframes hint-bob {
  0%, 100% { transform: translateX(calc(-50% + var(--nudge, 0px))) translateY(0); }
  50% { transform: translateX(calc(-50% + var(--nudge, 0px))) translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) { .hint { animation: none; } }

.heart {
  position: absolute;
  bottom: 55%;
  font-size: clamp(13px, calc(20px * var(--s)), 20px);
  color: #ef6b84;
  pointer-events: none;
  animation: heart-up 1.3s ease-out forwards;
}
@keyframes heart-up {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  20% { opacity: 1; transform: translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translateY(-46px) scale(.9); }
}

/* ---- 0.2.0 のかわいさ（site.js） ---- */
.bfx { position: absolute; inset: 0; pointer-events: none; }
.bfx-item { position: absolute; pointer-events: none; line-height: 1; white-space: nowrap; will-change: transform, opacity; }
.bfx-z {
  font: 900 calc(17px * var(--s)) / 1 "Zen Maru Gothic", sans-serif;
  color: #4a79c2;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff;
  animation: bfx-z 2.8s ease-out forwards;
}
@keyframes bfx-z {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15%, 70% { opacity: 1; }
  100% { transform: translate(calc(30px * var(--s)), calc(-56px * var(--s))) scale(1.3); opacity: 0; }
}
.bfx-word {
  font: 900 calc(21px * var(--s)) / 1 "Zen Maru Gothic", sans-serif;
  color: #ff8a3d;
  letter-spacing: 1px;
  -webkit-text-stroke: 4px #fff;
  paint-order: stroke fill;
  text-shadow: 0 2px 3px rgba(120, 60, 20, .25);
  transform-origin: 30% 70%;
  animation: bfx-word 1.7s ease-out forwards;
}
@keyframes bfx-word {
  0% { transform: scale(.2) rotate(-18deg); opacity: 0; }
  14% { transform: scale(1.25) rotate(-8deg); opacity: 1; }
  24% { transform: scale(.95) rotate(-12deg); }
  34% { transform: scale(1.05) rotate(-10deg); }
  75% { transform: scale(1) rotate(-10deg) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) rotate(-10deg) translateY(-10px); opacity: 0; }
}
.bfx-spark {
  font-size: calc(14px * var(--s));
  color: #ffc93c;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff;
  animation: bfx-spark 1.2s ease-out forwards;
}
@keyframes bfx-spark {
  0% { transform: scale(0) rotate(0); opacity: 0; }
  30% { transform: scale(1.2) rotate(40deg); opacity: 1; }
  100% { transform: scale(.4) rotate(90deg); opacity: 0; }
}
.bfx-soap {
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 9%, rgba(255,255,255,0) 22%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 0 52%, rgba(150,210,255,.28) 64%,
      rgba(255,170,230,.34) 76%, rgba(170,255,225,.42) 88%, rgba(255,236,150,.45) 97%);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: inset 0 0 3px rgba(140,190,255,.55), 0 0 2px rgba(90,130,190,.35);
  animation: bfx-soap 6s ease-in-out forwards;
}
@keyframes bfx-soap {
  0% { transform: translate(0, 0) scale(.5); opacity: 0; }
  10% { transform: translate(0, -8px) scale(.9); opacity: 1; }
  35% { transform: translate(var(--sway, 0), -48px) scale(1) rotate(8deg); }
  60% { transform: translate(calc(var(--sway, 0) * -.6), -92px) scale(1.04) rotate(-6deg); }
  88% { transform: translate(calc(var(--sway, 0) * .4), -128px) scale(1.06); opacity: .95; }
  100% { transform: translate(calc(var(--sway, 0) * .4), -134px) scale(1.5); opacity: 0; }
}
.bfx-fall { top: -12px; animation: bfx-fall 6.5s linear forwards; }
.bfx-snow { font-size: 6px; color: #fff; text-shadow: 0 0 2px rgba(80,110,150,.55); }
.bfx-sakura { width: 8px; height: 6px; border-radius: 60% 10% 60% 10%; background: #ffc0d2; }
@keyframes bfx-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  10% { opacity: .95; }
  50% { transform: translate(var(--sway, 0), 110px) rotate(160deg); }
  100% { transform: translate(calc(var(--sway, 0) * -.4), 215px) rotate(320deg); opacity: 0; }
}
.bfx-say {
  position: absolute;
  left: 50%;
  bottom: 84%;
  padding: .4em .9em;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(11px, calc(13px * var(--s)), 13px);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(58,47,39,.4);
  transform: translate(-50%, 4px) scale(.9);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.bfx-say::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #fff;
}
.bfx-say.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
/* 止め絵のポーズの動き */
.dog img { transform-origin: 50% 100%; }
.dog img.m-tilt { transform-origin: 50% 78%; animation: m-tilt 1.7s ease-in-out infinite alternate; }
.dog img.m-hop { animation: m-hop .5s ease-out infinite; }
.dog img.m-breathe { animation: m-breathe 1.8s ease-in-out infinite; }
.dog img.m-sway { animation: m-sway .9s ease-in-out infinite alternate; }
.dog img.m-wiggle { animation: m-wiggle .22s ease-in-out infinite alternate; }
.dog img.m-proud { animation: m-proud .6s ease-out forwards; }
.dog img.m-rock { transform-origin: 50% 88%; animation: m-rock .8s ease-in-out infinite alternate; }
@keyframes m-tilt { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes m-hop { 0% { transform: translateY(0) scale(1.03, .97); } 35% { transform: translateY(-13px) scale(.98, 1.02); } 70% { transform: translateY(0) scale(1.03, .97); } 100% { transform: none; } }
@keyframes m-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, .985); } }
@keyframes m-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-3px); } }
@keyframes m-wiggle { from { transform: translateX(-3px) rotate(-2deg); } to { transform: translateX(3px) rotate(2deg); } }
@keyframes m-proud { 0% { transform: scale(1); } 60% { transform: scale(1.07) translateY(-2px); } 100% { transform: scale(1.05) translateY(-1px); } }
@keyframes m-rock { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) {
  .bfx-soap, .bfx-fall { display: none; }
  .dog img[class*="m-"] { animation: none; }
}

/* ---- 0.2.0 で増えたこと ---- */
.news { max-width: 880px; margin: 0 auto 56px; padding: 0 24px; }
.news h2 { font-size: 22px; margin: 0 0 6px; }
.news .news-lead { margin: 0 0 18px; color: var(--ink-soft); }
.news img { display: block; width: 100%; height: auto; border-radius: 18px; background: #fbf6ef; }
.news ul { margin: 18px 0 0; padding-left: 1.2em; line-height: 1.9; }
.news li strong { color: var(--ink); }

/* ---- link to the guide page ---- */
.guide-link { max-width: 880px; margin: 0 auto; padding: 0 24px; }
.guide-link a {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px;
  padding: 18px 24px; border: 1.5px solid var(--line); border-radius: 18px;
  text-decoration: none; background: #fff8;
}
.guide-link a:hover { border-color: var(--accent); }
.guide-link span { color: var(--accent-deep); font-weight: 700; font-size: 15px; }

/* ---- guide page ---- */
.article { max-width: 720px; margin: 0 auto; padding: 8px 24px 24px; }
.article h1 { font-size: clamp(24px, 5vw, 36px); line-height: 1.4; margin: 12px 0 8px; }
.article .lead { color: var(--ink-soft); margin: 0 0 28px; }
.article h2 { margin: 44px 0 10px; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { padding-left: 1.3em; }
.article img { display: block; width: 100%; height: auto; border-radius: 18px; background: #fbf6ef; margin: 18px 0; }
.article .poses { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 18px 0; }
.article .poses figure { margin: 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.article .poses img { margin: 0 0 4px; aspect-ratio: 1; object-fit: contain; }
.article dl { margin: 0; }
.article dt { font-weight: 900; margin-top: 18px; }
.article dt::before { content: "Q. "; color: var(--accent); }
.article dd { margin: 4px 0 0; color: var(--ink-soft); }
.article .cta { text-align: center; margin: 48px 0 8px; }
.crumb { font-size: 13px; color: var(--ink-soft); }

/* 航海広場の応援バッジ（フッターの下の段に、小さめに） */
.site-foot { flex-wrap: wrap; }
.site-foot .site-badge { flex-basis: 100%; display: flex; justify-content: center; margin-top: 6px; }
.site-foot .site-badge img { display: block; width: 160px; height: auto; opacity: .92; transition: opacity .15s ease; }
.site-foot .site-badge a:hover img { opacity: 1; }
