/* 文字の大きさは最低16px（注釈・ボタン・表の中も含む） */
:root {
  --bg: #f4dc9a;
  --bg-deep: #dcbf70;
  --ink: #3b2616;
  --ink-soft: #6a4f3a;
  --white: #fffdf7;
  --accent: #e4572e;
  --accent-dark: #c2431f;
  --sun: #f2a900;
  --sun-dark: #b87a00;
  --green: #1f8a7a;
  --line: #eadfc6;
  /* 端末に最初から入っている書体だけを使う（読み込み途中で書体が混ざらないようにするため） */
  --font: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Yu Gothic", Meiryo, sans-serif;
  --en: "Unbounded", "Helvetica Neue", Arial, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 2.1;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white); padding: 12px 20px; z-index: 100; }
.skip:focus { left: 0; }

/* ページを開いたとき・移るときの幕 */
.wipe { position: fixed; inset: 0; z-index: 90; background: var(--sun); pointer-events: none; transform: translateY(-101%); animation: wipe-out .7s var(--smooth) .15s backwards; }
.wipe.in { animation: wipe-in .4s var(--smooth) forwards; pointer-events: auto; }
@keyframes wipe-out { from { transform: translateY(0); } to { transform: translateY(-101%); } }
@keyframes wipe-in { from { transform: translateY(101%); } to { transform: translateY(0); } }

/* 背景をゆっくり流れる雲 */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky span { position: absolute; left: -260px; width: 220px; height: 56px; border-radius: 999px; background: rgba(255, 253, 247, .5); animation: drift 60s linear infinite; }
.sky span::before { content: ""; position: absolute; left: 44px; top: -26px; width: 110px; height: 60px; border-radius: 999px; background: inherit; }
.sky span:nth-child(1) { top: 16%; animation-delay: -12s; }
.sky span:nth-child(2) { top: 62%; animation-duration: 85s; animation-delay: -50s; scale: .7; }
.sky span:nth-child(3) { top: 84%; animation-duration: 72s; animation-delay: -30s; }
@keyframes drift { to { left: 100%; } }

/* ヘッダー（浮いたメニュー） */
.header { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px; pointer-events: none; animation: drop .7s var(--spring) .55s backwards; }
.header > * { pointer-events: auto; }
@keyframes drop { from { transform: translateY(-120%); } }
.logo { display: inline-flex; align-items: baseline; gap: 10px; background: var(--white); border-radius: 999px; padding: 8px 18px; white-space: nowrap; text-decoration: none; font-weight: 900; font-size: 22px; letter-spacing: .14em; line-height: 1.6; transition: transform .3s var(--spring); }
.logo:hover { transform: scale(1.05) rotate(-2deg); }
.logo span { font-size: 16px; font-weight: 700; letter-spacing: .04em; color: var(--ink-soft); }
.menu-btn { font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: var(--white); border: 0; border-radius: 999px; padding: 10px 20px; white-space: nowrap; cursor: pointer; line-height: 1.6; transition: transform .3s var(--spring); }
.menu-btn:active { transform: scale(.92); }
.nav { display: none; position: absolute; top: 68px; right: 12px; background: var(--white); border-radius: 24px; padding: 12px; box-shadow: 0 8px 0 var(--bg-deep); min-width: 240px; }
.nav.open { display: block; animation: pop-in .35s var(--spring); transform-origin: top right; }
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } }
.nav a { position: relative; display: block; padding: 10px 18px; text-decoration: none; font-weight: 700; font-size: 16px; line-height: 1.6; transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 4px; height: 3px; border-radius: 3px; background: var(--sun); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--smooth); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--accent-dark); }
@media (max-width: 379px) { .logo span { display: none; } }

/* 街のイラスト */
.town { width: min(100% - 24px, 500px); margin: 0 auto; pointer-events: none; }
.town .stage { position: relative; transition: transform 1.2s cubic-bezier(.65, 0, .35, 1); }
.town svg { display: block; width: 100%; height: auto; overflow: visible; }
.town g { transform-box: fill-box; transform-origin: 50% 100%; }
.town .b { animation: build .75s var(--spring) backwards; animation-delay: calc(var(--i) * 80ms + 650ms); }
@keyframes build { from { transform: translateY(-46px) scale(.2); opacity: 0; } 60% { opacity: 1; } }
.town .sway { animation: sway 3.4s ease-in-out infinite; }
.town .b:nth-of-type(odd) .sway { animation-delay: -1.6s; }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg) scaleY(1); } 50% { transform: rotate(2.5deg) scaleY(1.05); } }
.town .drive { animation: drive 9s linear infinite; }
@keyframes drive { 0% { transform: translate(0, 0); opacity: 0; } 6%, 92% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

/* 津幡（黄色い帽子の人）：読んでいる建物まで跳んでいく */
.town .me { transition: transform .9s cubic-bezier(.45, 0, .3, 1); }
.town .jump.go { animation: jump .9s cubic-bezier(.3, 0, .4, 1); }
@keyframes jump { 0% { transform: translateY(0) scale(1, 1); } 12% { transform: translateY(0) scale(1.15, .8); } 50% { transform: translateY(-70px) scale(.94, 1.1); } 88% { transform: translateY(0) scale(1.15, .82); } 100% { transform: translateY(0) scale(1, 1); } }
.town .idle { animation: idle 1.1s ease-in-out infinite alternate; }
@keyframes idle { from { transform: translateY(0) scale(1, 1); } to { transform: translateY(-4px) scale(.98, 1.04); } }

/* 建物の名札（どの建物がどのページか） */
.town .place { --k: 1%; position: absolute; z-index: 2; transform: translate(-50%, -100%); pointer-events: auto; text-decoration: none; animation: place-in .6s var(--spring) backwards; animation-delay: calc(var(--i) * 110ms + 1700ms); }
@keyframes place-in { from { opacity: 0; transform: translate(-50%, -60%) scale(.4); } }
.town .place span { position: relative; display: block; white-space: nowrap; background: var(--white); color: var(--ink); border-radius: 999px; padding: 2px 14px 2px 30px; font-size: 16px; font-weight: 700; line-height: 1.75; box-shadow: 0 4px 0 rgba(59, 38, 22, .18); transition: transform .4s var(--spring), background .3s, color .3s; transform-origin: 50% 100%; }
.town .place span::before { content: ""; position: absolute; left: 11px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 3px; background: var(--c); }
.town .place span::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; margin-left: -7px; background: inherit; transform: rotate(45deg); border-radius: 0 0 3px 0; z-index: -1; }
.town .place:hover span { transform: scale(1.08) translateY(-3px); }
.town .place.is-active span { background: var(--ink); color: var(--white); transform: scale(1.12) translateY(-4px); }
[data-b="arch"], [data-focus="arch"] { --c: #b98b56; }
[data-b="paint"], [data-focus="paint"] { --c: #e4572e; }
[data-b="salon"], [data-focus="salon"] { --c: #e99a94; }
[data-b="auto"], [data-focus="auto"] { --c: #6aa6d2; }
[data-b="clinic"], [data-focus="clinic"] { --c: #4fa596; }
/* カードの見出しにも、建物と同じ色の印を付ける */
.card[data-focus] .card-label::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--c); margin-right: 10px; vertical-align: -1px; }
.town .flag { transform: scale(0); transition: transform .6s var(--spring) .5s; }
.town .done .flag { transform: scale(1); }
.town .is-active > .in { animation: hop .7s var(--spring) 2; }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16px) scale(.96, 1.06); } 60% { transform: translateY(0) scale(1.05, .94); } }
body:not(.home) .town { display: none; }

/* 本文の列 */
main { position: relative; z-index: 1; padding: 96px 0 40px; }
.col { width: min(100% - 32px, 620px); margin: 0 auto; }

.rise { animation: rise .9s var(--smooth) backwards; animation-delay: calc(var(--d, 0) * 130ms + 900ms); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.hero { padding: 16px 4px 40px; }
.hero h1 { font-size: clamp(25px, 6.6vw, 38px); font-weight: 700; line-height: 1.8; letter-spacing: .1em; }
.hero h1 span { display: inline-block; }
.hero p { margin-top: 20px; }
.scroll-hint { display: none; }

.page-head { padding: 24px 4px 28px; }
.page-head h1 { font-size: clamp(28px, 7vw, 40px); font-weight: 700; line-height: 1.6; letter-spacing: .1em; }
.page-head p { margin-top: 14px; }
.en { display: block; font-family: var(--en); font-weight: 700; font-size: 16px; letter-spacing: .06em; line-height: 1.6; color: var(--ink); }

/* 白いカード */
.card { position: relative; background: var(--white); border-radius: 28px; padding: 30px 24px 34px; box-shadow: 0 10px 0 var(--bg-deep); margin-bottom: 34px; }
.card-label { color: var(--sun-dark); font-weight: 700; font-size: 17px; letter-spacing: .06em; line-height: 1.6; margin-bottom: 10px; }
.card-label:has(+ .en) { margin-bottom: 0; }
.card-label + .en { margin-bottom: 14px; }
.card h2 { font-size: 20px; font-weight: 700; line-height: 1.9; letter-spacing: .04em; margin-bottom: 12px; }
.card h3 { font-size: 18px; font-weight: 700; line-height: 1.8; margin: 26px 0 4px; }
.card p + p { margin-top: 1em; }
.card .btn { margin-top: 22px; }
.plain { padding: 0 4px; margin-bottom: 34px; }

.js .reveal { opacity: 0; transform: translateY(48px) scale(.97); transition: opacity .7s var(--smooth), transform .8s var(--spring), box-shadow .3s; }
.js .reveal.show { opacity: 1; transform: none; }

.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-width: 190px; min-height: 52px; padding: 8px 22px 8px 28px; border-radius: 999px; background: var(--sun); color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .06em; text-decoration: none; text-shadow: 0 1px 0 rgba(120, 70, 0, .45); box-shadow: 0 5px 0 #c98700; transition: transform .2s var(--spring), box-shadow .2s, background .2s; }
.btn::after { content: "›"; font-size: 24px; line-height: 1; transition: transform .3s var(--spring); }
.btn:hover { background: var(--accent); box-shadow: 0 7px 0 var(--accent-dark); transform: translateY(-2px); }
.btn:hover::after { transform: translateX(8px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-dark); }
.link { font-weight: 700; color: var(--accent-dark); text-underline-offset: 6px; }

/* 一覧 */
.rows > div, .rows > li { padding: 16px 0; border-top: 2px dotted var(--line); }
.rows > div:first-child, .rows > li:first-child { border-top: 0; padding-top: 4px; }
.rows dt, .rows .row-title { font-weight: 700; font-size: 17px; line-height: 1.8; }
.rows dd { line-height: 2; }
.data div { display: grid; grid-template-columns: 5em 1fr; gap: 12px; padding: 10px 0; border-top: 2px dotted var(--line); line-height: 1.9; }
.data div:first-child { border-top: 0; }
.data dt { font-weight: 700; color: var(--green); }

.no dt { padding-left: 34px; position: relative; }
.no dt::before { content: "×"; position: absolute; left: 4px; top: 0; color: var(--ink-soft); }
.no dd { padding-left: 34px; }

.steps { counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 22px 58px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--en); font-weight: 700; font-size: 16px; display: grid; place-items: center; line-height: 1; transition: transform .5s var(--spring); }
.js .reveal .steps li::before { transform: scale(0); }
.js .reveal.show .steps li::before { transform: scale(1); }
.show .steps li:nth-child(2)::before { transition-delay: .15s; }
.show .steps li:nth-child(3)::before { transition-delay: .3s; }
.show .steps li:nth-child(4)::before { transition-delay: .45s; }
.steps .row-title { line-height: 40px; }
.steps p { line-height: 2; }

.price div { display: grid; gap: 2px 16px; padding: 16px 0; border-top: 2px dotted var(--line); line-height: 1.9; }
.price div:first-child { border-top: 0; padding-top: 4px; }
.price dt { font-weight: 700; font-size: 17px; }
.price .yen { font-weight: 900; font-size: 22px; color: var(--accent-dark); }
.note { font-size: 16px; color: var(--ink-soft); line-height: 2; }

/* 実績 */
.shot { position: relative; margin: 0 0 22px; }
.shot .pc { border-radius: 14px; border: 2px solid var(--line); }
.shot .sp { position: absolute; right: -6px; bottom: -14px; width: 24%; border-radius: 12px; border: 3px solid var(--white); box-shadow: 0 4px 0 var(--bg-deep); transition: transform .7s var(--spring) .35s, opacity .4s .35s; }
.js .reveal:not(.show) .shot .sp { transform: translateY(30px) rotate(6deg); opacity: 0; }
.card:hover .shot .sp { transform: translateY(-6px) rotate(-3deg); transition-delay: 0s; }
.tag { display: inline-block; background: var(--bg); border-radius: 999px; padding: 2px 16px; font-size: 16px; font-weight: 700; line-height: 1.8; margin-bottom: 8px; }

/* 相談 */
.mail { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mail-address { font-weight: 700; word-break: break-all; }
.copy-btn { font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: var(--bg); border: 0; border-radius: 999px; padding: 4px 18px; cursor: pointer; transition: transform .2s var(--spring), background .2s; }
.copy-btn:hover { background: var(--bg-deep); transform: scale(1.06); }
.copy-btn:active { transform: scale(.92); }
.copy-status { min-height: 2em; font-size: 16px; }

/* フッター */
.footer { position: relative; z-index: 1; padding: 8px 0 48px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 12px; }
.footer-nav a { font-weight: 700; font-size: 16px; text-underline-offset: 5px; }
.footer p { font-size: 16px; color: var(--ink-soft); }

.dots { display: none; }

/* パソコンなど広い画面：左に文章、右に街 */
@media (min-width: 1000px) {
  .header { padding: 26px 36px; }
  .menu-btn { display: none; }
  .nav, .nav.open { display: flex; position: static; gap: 2px; padding: 8px 14px; border-radius: 999px; box-shadow: none; min-width: 0; animation: none; }
  .nav a { padding: 8px 14px; }
  .nav a::after { left: 14px; right: 14px; bottom: 2px; }
  .town .place { --k: .45%; }
  .town, body:not(.home) .town { display: block; position: fixed; z-index: 0; right: 1vw; top: 54%; transform: translateY(-50%); width: min(50vw, 780px); margin: 0; }
  main { padding-top: 150px; }
  .col { width: min(44vw, 580px); margin: 0 0 0 max(36px, 5vw); }
  .hero { min-height: calc(100vh - 150px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 120px; }
  .hero h1 { font-size: clamp(24px, 2.5vw, 34px); }
  .card { padding: 38px 40px 42px; }
  .card:hover { box-shadow: 0 14px 0 var(--bg-deep); }

  .scroll-hint { display: flex; align-items: center; gap: 12px; margin-top: 48px; font-family: var(--en); font-weight: 700; font-size: 16px; letter-spacing: .08em; }
  .scroll-hint::before { content: ""; width: 3px; height: 44px; border-radius: 3px; background: linear-gradient(var(--ink) 50%, transparent 50%) 0 0 / 100% 200%; animation: hint 1.8s ease-in-out infinite; }
  @keyframes hint { from { background-position: 0 100%; } to { background-position: 0 -100%; } }

  /* トップページ：カードを1枚ずつ読ませる */
  .home.scrolly .card { margin-bottom: 46vh; transform-origin: left center; }
  .home.scrolly .card.show:not(.active) { opacity: .35; transform: scale(.92); }
  .home.scrolly .card:last-child { margin-bottom: 30vh; }

  .dots { position: fixed; z-index: 5; right: 0; top: 50%; transform: translateY(-50%); display: grid; gap: 6px; justify-items: end; }
  .dots span { width: 10px; height: 38px; border-radius: 6px 0 0 6px; background: rgba(255, 253, 247, .7); transform-origin: right; transition: transform .5s var(--spring), background .3s; }
  .dots span.on { background: var(--accent); transform: scaleX(2.2); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wipe, .sky { display: none; }
}
