/* 空き巣の入り口帖：漆喰の白・墨・鍵の真鍮・夜の藍。共通の base.css は読まない（look: own） */
:root {
  --bg: #f7f6f2;
  --ink: #1c1b19;
  --sub: #4d4a44;
  --line: #d8d2c4;
  --brass: #9c7a2f;
  --brass-t: #74581c;
  --pale: #efe5cf;
  --night: #23345c;
  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --r1: 2px;
  --r2: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.8;
  font-feature-settings: "palt"; letter-spacing: .03em;
}
a { color: var(--brass-t); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: var(--r1); }
b, strong { font-weight: 700; }
.num { font-family: var(--mincho); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
svg { max-width: 100%; }

/* ---------- 枠：表札のヘッダー ---------- */
.hd { max-width: 1040px; margin: 0 auto; padding: 8px 20px 0; }
.pr-notice { margin: 0; font-size: 13px; color: var(--sub); line-height: 1.6; }
.hd-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 8px 0 12px; border-bottom: 1px solid var(--ink); }
.plate {
  view-transition-name: plate;
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 14px;
  border: 1px solid var(--ink); background: #fffdf8;
  font-family: var(--mincho); font-weight: 700; font-size: 18px; letter-spacing: .14em; color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 0 var(--line), 0 3px 0 -1px var(--pale);
}
.rivet { width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e5cf98, var(--brass) 60%, #6b521c); }
.rooms ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.rm { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--sub); text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: .12em; }
.rm::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--brass); transform: scaleX(0); transition: transform .25s var(--ease); }
.rm:hover { color: var(--ink); }
.rm:hover::after { transform: scaleX(.4); }
.rm:active { transform: translateY(1px); }
.rm.is-here { color: var(--ink); }
.rm.is-here::after { transform: none; view-transition-name: room-line; }

.site-main { max-width: 1040px; margin: 0 auto; padding: 0 20px 64px; }
.site-main > section, .site-main > nav { max-width: 680px; }
.site-main > section.hero { max-width: none; }

/* ---------- 枠：夜の街並みのフッター ---------- */
.ft { margin-top: 48px; background: var(--night); color: #e9e6dd; }
.ft-row { display: flex; justify-content: center; gap: 10px; padding: 24px 20px 0; max-width: 1040px; margin: 0 auto; overflow: hidden; }
.w { width: 14px; height: 18px; border: 1px solid rgba(233, 230, 221, .45); flex: none; }
.w.on { background: #e5cf98; border-color: #e5cf98; box-shadow: 0 0 12px rgba(229, 207, 152, .55); }
.ft-in { max-width: 1040px; margin: 0 auto; padding: 24px 20px 48px; font-size: 14px; }
.ft-name { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: 17px; letter-spacing: .14em; color: #fff; }
.ft-promise { margin: 8px 0 16px; font-size: 15px; line-height: 1.8; max-width: 640px; }
.ft-nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.ft-nav a { color: #e9e6dd; display: inline-flex; align-items: center; min-height: 44px; }
.ft-copy { margin: 8px 0 0; color: #cfcabd; }

/* ---------- 入口 ---------- */
.hero { padding: 40px 0 8px; display: grid; gap: 0 48px; }
.kicker { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--brass-t); letter-spacing: .16em; }
.hero-title, .page-title {
  view-transition-name: page-title;
  margin: 0; font-family: var(--mincho); font-weight: 700; color: var(--ink);
  font-size: clamp(32px, 9vw, 56px); line-height: 1.35; letter-spacing: .04em;
  word-break: auto-phrase; text-wrap: balance;
}
.page-title { font-size: clamp(28px, 7vw, 44px); }
.lead { margin: 20px 0 0; font-size: 17px; line-height: 1.85; max-width: 34em; }
.page-head { padding: 40px 0 8px; }

.scene { margin: 32px 0 0; padding: 16px 12px 12px; background: var(--night); border-radius: var(--r2); color: #e9e6dd; }
.bldg-svg { display: block; width: 100%; height: auto; }
.bldg-svg .ln { fill: none; stroke: rgba(233, 230, 221, .78); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.bldg-svg .ground { stroke: rgba(233, 230, 221, .5); stroke-width: 1.5; }
.bldg { opacity: 0; transition: opacity .35s var(--ease); }
.bldg.is-on { opacity: 1; }
.lamp .halo { fill: rgba(229, 207, 152, .22); transform: scale(var(--s, 1)); transform-box: fill-box; transform-origin: center; }
.lamp .dot { fill: #e5cf98; }
.lamp .lbl { fill: #fff; font: 700 14px var(--sans); text-anchor: middle; letter-spacing: .04em; paint-order: stroke; stroke: var(--night); stroke-width: 4px; }
.lamp.is-small .halo { display: none; }
.scene-key { list-style: none; margin: 8px 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.scene-key li { display: inline-flex; align-items: baseline; gap: 6px; }
.scene-key .num { font-size: 16px; color: #fff; }
.scene-key .kd { width: 8px; height: 8px; border-radius: 50%; background: #e5cf98; align-self: center; }
.scene-cap { margin: 8px 4px 0; font-size: 15px; line-height: 1.7; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1.05fr; align-items: end; padding-top: 64px; }
  .hero .scene { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
}

/* ---------- 節の見出し：鍵の形の線 ---------- */
.sh2 { display: flex; align-items: baseline; gap: 12px; margin: 56px 0 20px; padding-bottom: 10px; position: relative; }
.sh2::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform-origin: left; }
.sh2::before { content: ""; position: absolute; left: 0; bottom: -3px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--brass); background: var(--bg); z-index: 1; }
.sh2.pre::after { transform: scaleX(0); transition: transform .7s var(--ease); }
.sh2.pre.seen::after { transform: none; }
.sh2-k { font-family: var(--mincho); font-weight: 700; font-size: 26px; color: var(--brass-t); line-height: 1; }
.sh2 h2 { margin: 0; font-family: var(--mincho); font-weight: 700; font-size: 24px; letter-spacing: .06em; line-height: 1.4; }
.note { margin: 0 0 16px; font-size: 15px; color: var(--sub); line-height: 1.75; }

/* ---------- 住まいの種類 ---------- */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ty {
  display: grid; justify-items: center; gap: 6px; min-height: 104px; padding: 12px 4px;
  border: 1px solid var(--line); border-radius: var(--r1); background: #fffdf8; color: var(--sub);
  font: 700 14px/1.45 var(--sans); letter-spacing: .02em; cursor: pointer; text-align: center;
  transition: border-color .2s, color .2s, transform .12s;
}
.ty svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.ty:hover { border-color: var(--brass); color: var(--ink); }
.ty:active { transform: translateY(1px); }
.ty[aria-checked="true"] { border: 2px solid var(--ink); color: var(--ink); background: var(--pale); padding: 11px 3px; }
.ty[aria-checked="true"] svg { stroke: var(--brass-t); }

/* ---------- いまある対策：押すと錠が閉まる ---------- */
.ms { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.m { border-bottom: 1px solid var(--line); }
.m[hidden] { display: none; }
.m-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 4px; cursor: pointer; }
.m-row:hover .m-t { color: var(--ink); }
.m-in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-in:focus-visible + .lock { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: var(--r1); }
.lock svg { width: 28px; height: 28px; display: block; }
.lock .l-body { fill: none; stroke: var(--sub); stroke-width: 1.6; }
.lock .l-shackle { fill: none; stroke: var(--sub); stroke-width: 1.6; stroke-linecap: round; transform-origin: 15.5px 10.5px; transform: rotate(32deg) translateY(-2px); transition: transform .2s var(--ease); }
.m-in:checked + .lock .l-body { fill: var(--brass); stroke: var(--brass-t); }
.m-in:checked + .lock .l-shackle { stroke: var(--brass-t); transform: none; }
.m-t { font-size: 16px; line-height: 1.6; color: var(--sub); }
.m-in:checked ~ .m-t { color: var(--ink); font-weight: 700; }
.m-cost { font-size: 13px; color: var(--brass-t); white-space: nowrap; border: 1px solid var(--line); padding: 0 8px; border-radius: var(--r1); }
.m.click .lock { animation: clack .2s steps(2, end); }
@keyframes clack { 50% { transform: translateY(1px) scale(.94); } }

/* ---------- 結果 ---------- */
.res { margin-top: 40px; padding: 24px 0 8px; border-top: 2px solid var(--ink); }
.res-t { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.7; }
.res-big { margin: 4px 0 12px; display: flex; align-items: baseline; gap: 4px; }
.res-big .num { font-size: clamp(64px, 20vw, 96px); line-height: 1; color: var(--ink); }
.res-big .unit { font-family: var(--mincho); font-size: 26px; font-weight: 700; }
.strip { display: flex; height: 28px; border: 1px solid var(--ink); overflow: hidden; }
.sg { display: block; width: calc(var(--w) * 1%); height: 100%; transition: width .4s var(--ease), background-color .3s; border-right: 1px solid var(--bg); }
.sg.is-open { background: var(--ink); }
.sg.is-shut { background: repeating-linear-gradient(135deg, var(--brass) 0 3px, var(--pale) 3px 7px); }
.sg.is-rest { background: var(--line); border-right: 0; flex: 1; }
.strip-key { list-style: none; margin: 12px 0 0; padding: 0; }
.strip-key li { display: grid; grid-template-columns: 1fr auto 4.5em; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 15px; }
.strip-key .k-v .num { font-size: 18px; }
.strip-key .k-s { font-size: 13px; text-align: right; color: var(--sub); }
.strip-key .is-open .k-s { color: var(--ink); font-weight: 700; }
.strip-key .is-shut .k-s { color: var(--brass-t); font-weight: 700; }
.strip-key .is-rest { color: var(--sub); }
.res-sub { margin: 12px 0 0; font-size: 14px; color: var(--sub); line-height: 1.7; }
.next-t { margin: 28px 0 8px; font-family: var(--mincho); font-size: 20px; letter-spacing: .06em; }
.next { list-style: none; counter-reset: nx; margin: 0; padding: 0; }
.nx { counter-increment: nx; position: relative; display: grid; gap: 2px; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); }
.nx::before { content: counter(nx); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--ink); font-family: var(--mincho); font-weight: 700; font-size: 16px; }
.nx-h { font-weight: 700; font-size: 16px; }
.nx-h .num { margin-left: 8px; font-size: 18px; }
.nx-m { font-size: 15px; line-height: 1.7; color: var(--sub); }
.nx-m small { margin-left: 8px; font-size: 13px; color: var(--brass-t); border: 1px solid var(--line); padding: 0 6px; white-space: nowrap; }
.nx.ok { padding-left: 0; }
.nx.ok::before { display: none; }
.basis { margin: 20px 0 0; font-size: 15px; color: var(--sub); line-height: 1.8; }

.plain { margin: 0; padding-left: 1.2em; }
.plain li { margin: 6px 0; }
.plain li::marker { color: var(--brass); }

/* ---------- ほかのページへ ---------- */
.more { margin-top: 56px; border-top: 1px solid var(--ink); }
.mo { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 44px; transition: padding .2s var(--ease); }
.mo:hover { padding-left: 6px; }
.mo-k { font-size: 14px; font-weight: 700; color: var(--brass-t); letter-spacing: .12em; }
.mo-t { font-family: var(--mincho); font-weight: 700; font-size: 18px; line-height: 1.6; }
.arrow { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.arrow::after { content: ""; width: 24px; height: 1px; background: currentColor; transition: width .2s var(--ease); }
.arrow:hover::after { width: 36px; }
.more-link { margin: 16px 0 0; }

/* ---------- 統計 ---------- */
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0 0 16px; }
.figs > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.figs dt { font-size: 14px; color: var(--sub); line-height: 1.6; }
.figs dd { margin: 4px 0 0; font-size: 15px; }
.figs dd .num { font-size: 30px; }
.table-wrap { margin: 16px 0; overflow-x: auto; }
.st { width: 100%; border-collapse: collapse; font-size: 15px; }
.st th, .st td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.5; }
.st thead th { font-size: 13px; color: var(--sub); border-bottom: 1px solid var(--ink); font-weight: 700; }
.st th small, .st td small { display: block; font-size: 13px; color: var(--sub); font-weight: 400; }
.st tbody th { font-weight: 700; }
.st td { position: relative; white-space: nowrap; }
.st td .num { font-size: 20px; }
.st td.top .num { color: var(--brass-t); }
.st .bar { display: block; height: 4px; width: calc(var(--w) * 1%); background: var(--brass); margin-bottom: 6px; transform-origin: left; }
.st.pre .bar { transform: scaleX(0); }
.st.pre.seen .bar { transform: none; transition: transform .6s var(--ease); }
.st .rest { color: var(--sub); }
@media (max-width: 639px) {
  .st { font-size: 14px; }
  .st th, .st td { padding: 8px 4px; }
  .st td .num { font-size: 18px; }
  .st thead th { font-size: 13px; }
}

/* ---------- 対策の段 ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st var(--start, 0); }
.steps[start="4"] { counter-reset: st 3; }
.step { counter-increment: st; position: relative; padding: 16px 0 16px 48px; border-bottom: 1px solid var(--line); }
.step::before { content: counter(st); position: absolute; left: 0; top: 18px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--ink); background: #fffdf8; font-family: var(--mincho); font-weight: 700; }
.step h3 { margin: 0; font-family: var(--mincho); font-size: 19px; line-height: 1.55; letter-spacing: .04em; }
.step p { margin: 6px 0 0; font-size: 16px; }

/* ---------- 出どころ ---------- */
.sources { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); }
.src-t { margin: 0 0 8px; font-size: 16px; }
.cite { margin: 6px 0; font-size: 15px; color: var(--sub); line-height: 1.75; }

/* 共通ページ（運営者情報など） */
.site-main > h1 { font-family: var(--mincho); font-size: 32px; margin: 40px 0 16px; letter-spacing: .06em; }
.site-main dl { margin: 16px 0 24px; display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; }
.site-main dt { font-weight: 700; color: var(--sub); font-size: 14px; padding-top: 2px; }
.site-main dd { margin: 0; }
@media (max-width: 479px) { .site-main dl { grid-template-columns: 1fr; gap: 4px; } .site-main dd { margin-bottom: 12px; } .figs { grid-template-columns: 1fr; } }

/* ---------- ページ遷移 ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease-in both; }
::view-transition-new(root) { animation: vt-in .4s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 見せ場：灯りが多い順にともる・まだの手口は 2 回だけ明滅 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .scene .bldg.is-on .ln { stroke-dasharray: 600; animation: draw 1s var(--ease) both; }
  .scene.lit .lamp { animation: lamp .5s var(--ease) calc(.5s + var(--d) * .28s) both; }
  .nx.blink { animation: blink .36s steps(1) 2; }
  .ft-row .w.on { animation: lamp .6s var(--ease) calc(var(--i) * 80ms) both; }
}
@keyframes draw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
@keyframes lamp { 0% { opacity: 0; } 40% { opacity: 1; } 55% { opacity: .35; } 100% { opacity: 1; } }
@keyframes blink { 0% { background: var(--pale); } 50% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sh2.pre::after, .st.pre .bar { transform: none !important; }
  @view-transition { navigation: none; }
}
