/* 全体（作り手のサイト）は、やわらかい生成り色。作品のページは body のクラスで世界観を切り替える */
:root {
  --bg: #fbf6ec;
  --bg-2: #f3ecdf;
  --ink: #3b3330;
  --ink-2: rgba(59, 51, 48, 0.66);
  --line: rgba(59, 51, 48, 0.14);
  --accent: #c7783a;
  --glow: rgba(255, 226, 160, 0);
}

/* 星空パズル：夜空 */
body.night {
  --bg: #070b18;
  --bg-2: #0d1428;
  --ink: #f3ecd8;
  --ink-2: rgba(243, 236, 216, 0.68);
  --line: rgba(243, 236, 216, 0.18);
  --accent: #f0cf8a;
  --glow: rgba(255, 226, 160, 0.28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Kaku Gothic Antique", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

/* 言語の切り替え：<html data-lang="ja|en"> で、合わない方を隠す */
html[data-lang="ja"] [lang="en"]:not(html),
html[data-lang="en"] [lang="ja"]:not(html) { display: none !important; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img { max-width: 100%; display: block; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー（どのページも、羊と名前で同じ作り手だとわかるように） */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 15px; letter-spacing: 0.1em; margin-right: auto; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.top nav { display: flex; gap: 16px; font-size: 14px; }
.top nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }
@media (max-width: 480px) {
  .top .wrap { gap: 12px; }
  .top nav { gap: 12px; font-size: 13px; }
  html[data-lang="en"] .top nav { display: none; } /* 英語は長いので、狭い画面ではフッターのリンクにまかせる */
}
.lang {
  background: none; border: 1px solid var(--line); color: var(--ink-2);
  font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; letter-spacing: 0.08em;
}
.lang:hover { color: var(--ink); border-color: var(--ink-2); }

/* トップ：羊の行進 */
.hello { text-align: center; padding: 72px 16px 56px; }
.flock { display: flex; justify-content: center; gap: clamp(8px, 4vw, 40px); margin-bottom: 32px; }
.flock img { width: clamp(72px, 16vw, 128px); animation: hop 2.4s ease-in-out infinite; }
.flock img:nth-child(2) { animation-delay: .3s; }
.flock img:nth-child(3) { animation-delay: .6s; }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.hello h1 { margin: 0; font-size: clamp(26px, 5.5vw, 40px); letter-spacing: 0.14em; font-weight: 500; }
.hello .tagline { margin: 8px 0 0; font-size: clamp(12px, 2.6vw, 18px); color: var(--ink-2); }

/* トップ：作品ごとのカード（それぞれの世界観の色） */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 720px) { .works { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; border-radius: 4px; overflow: hidden; box-shadow: 0 14px 40px rgba(59, 51, 48, .12); }
.card .art { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .body { padding: 20px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.card .tag { font-size: 12px; letter-spacing: 0.12em; }
.card h3 { margin: 2px 0 8px; font-size: 21px; }
.card p { font-size: 15px; }
.card .links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.card .links a { border: 1px solid currentColor; padding: 4px 14px; font-size: 13px; text-decoration: none; color: inherit; opacity: .85; }
.card .links a:hover { opacity: 1; }

.card.starry { background: #070b18; color: #f3ecd8; }
.card.starry .art { background: url("home-sky.jpg") center 40% / cover; position: relative; }
.card.starry .art img { width: 62%; filter: drop-shadow(0 0 20px rgba(255, 226, 160, .3)); }
.card.starry .tag { color: #f0cf8a; }
.card.starry p { color: rgba(243, 236, 216, .75); }

.card.tamago { background: #fff6f8; color: #5a4148; }
.card.tamago .art {
  background-color: #fde7ee;
  background-image: linear-gradient(rgba(232, 150, 175, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(232, 150, 175, .22) 1px, transparent 1px);
  background-size: 20px 20px;
}
.card.tamago .art img { width: min(38%, 180px); border-radius: 22%; box-shadow: 0 10px 30px rgba(200, 110, 140, .25); }
.card.tamago .tag { color: #d7708f; }
.card.tamago p { color: rgba(90, 65, 72, .78); }

.stat { font-size: 13px; opacity: .8; margin: -4px 0 12px; }

/* 星空パズル：ファーストビュー（夜空とキャンプ） */
.hero {
  position: relative; overflow: hidden;
  min-height: min(92vh, 860px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; padding: 12vh 16px 0;
  background: url("home-sky.jpg") center 30% / cover no-repeat, var(--bg);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: url("home-camp-landscape.png") center bottom / 100% auto no-repeat;
  pointer-events: none;
}
@media (max-aspect-ratio: 4/5) { .hero::after { background: url("home-camp.png") center bottom / 100% auto no-repeat; } }
.hero > * { position: relative; z-index: 1; }
.hero .title { width: min(560px, 86vw); }
.hero .lead { margin: 8px 0 0; font-size: clamp(15px, 3.6vw, 19px); text-shadow: 0 0 30px var(--glow), 0 2px 10px rgba(0,0,0,.6); }
.hero .balloon { position: absolute; width: clamp(64px, 12vw, 110px); top: 18%; right: 9%; animation: drift 9s ease-in-out infinite; }
@media (max-width: 640px) { .hero .balloon { top: 36%; right: 10%; } }
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(4deg); } 50% { transform: translateY(-14px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .hero .balloon, .flock img { animation: none; } }

/* セクション */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
h1, h2, h3 { font-weight: 500; letter-spacing: 0.1em; line-height: 1.5; }
h1 { font-size: clamp(24px, 5vw, 32px); margin: 0 0 24px; }
h2 { font-size: clamp(20px, 4vw, 24px); margin: 0 0 24px; }
h3 { font-size: 17px; margin: 32px 0 8px; }
p { margin: 0 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; line-height: 1.8; }

/* 紙の手ざわり（オープニングの絵） */
.paper { background: linear-gradient(#cdb6d8 0%, #f0cfc4 45%, #f6ead2 100%); color: #3c3026; }
.paper h2 { color: #3c3026; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.cards img { box-shadow: 0 20px 50px rgba(60, 30, 40, .28); }
.cards img:first-child { transform: rotate(-1.5deg); }
.cards img:last-child { transform: rotate(1.5deg); }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

/* 特徴 */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.features img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: 16px; }
.features h3 { margin-top: 0; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.wide { width: 100%; max-width: 720px; height: auto; margin: 0 auto; }

.button {
  display: inline-block; border: 1px solid var(--ink-2); color: var(--ink); text-decoration: none;
  padding: 10px 28px; letter-spacing: 0.12em;
}
.button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.button[aria-disabled="true"] { opacity: .55; pointer-events: none; }

.credits { list-style: none; padding: 0; margin: 0; }
.credits li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* 文書ページ（プライバシーポリシー・サポート） */
.doc { max-width: 720px; }
.doc ul { padding-left: 1.4em; }
.doc li { margin-bottom: 6px; }
.faq dt { margin-top: 24px; font-weight: 500; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }

/* フッター：1 段目に羊と署名、2 段目にリンク。どちらも中央そろえ */
footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 13px; color: var(--ink-2); }
footer .wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
footer .sign { display: flex; align-items: center; justify-content: center; gap: 10px; letter-spacing: 0.08em; }
footer .sheep { width: 32px; }
footer .footlinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
footer a { color: var(--ink-2); }

/* 作品ページの中のリンク（サポート・プライバシーポリシーなど） */
.applinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 14px; margin-top: 24px; }
.crumb { padding-top: 24px; font-size: 13px; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb + section { padding-top: 32px; }

/* たまご育成記録：パステルピンクの方眼ノート */
body.tamago {
  --bg: #fff6f8;
  --bg-2: #fde7ee;
  --ink: #5a4148;
  --ink-2: rgba(90, 65, 72, 0.72);
  --line: rgba(215, 112, 143, 0.22);
  --accent: #d7708f;
}
.grid-hero {
  text-align: center; padding: 72px 16px 56px;
  background-color: #fde7ee;
  background-image: linear-gradient(rgba(232, 150, 175, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(232, 150, 175, .22) 1px, transparent 1px);
  background-size: 20px 20px;
}
.grid-hero .appicon { width: 160px; height: 160px; border-radius: 22%; margin: 0 auto 24px; box-shadow: 0 10px 30px rgba(200, 110, 140, .25); }
.grid-hero h1 { margin: 0 0 8px; }
.grid-hero .lead { margin: 0 0 8px; }
.grid-hero .applinks a { border: 1px solid currentColor; padding: 6px 18px; text-decoration: none; }
