
:root {
  --ink: #1C1D1A;
  --ground: #E8E8E3;
  --muted: #5E605A;
  --moss: #4E6B2C;
  --moss-d: #415A24;
  --paper: #FFFFFF;
  --line: rgba(28, 29, 26, .16);
  --m: clamp(16px, 4.45vw, 64px);
  --r: 6px;
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
  --sans: "M PLUS 2", "Hiragino Sans", sans-serif;
  --ease: cubic-bezier(.7, 0, .2, 1);
}
html { background: var(--ground); }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: .02em;
  word-break: keep-all;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[lang="ja"] { letter-spacing: .08em; font-feature-settings: "palt"; }
h1, h2, h3 { font-feature-settings: "palt"; }
::selection { background: var(--moss); color: #fff; }
.wrap { width: min(calc(100% - 2 * var(--m)), 1312px); margin-inline: auto; }
.label { font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0; }
.label [lang="ja"] { letter-spacing: .14em; margin-right: .9em; color: var(--ink); }

/* Buttons and links: arrow swap with a slow opacity change */
.btn {
  display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 28px;
  border-radius: 999px; background: var(--moss); color: #fff; text-decoration: none; border: 0;
  font-size: 15px; font-weight: 500; letter-spacing: .05em; white-space: nowrap;
  transition: background-color .9s cubic-bezier(.2, .6, .2, 1), transform .25s var(--ease);
}
.btn:hover { background: var(--moss-d); }
.link {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--moss);
  text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: .05em;
  transition: opacity .9s cubic-bezier(.2, .6, .2, 1), transform .25s var(--ease);
}
.link:hover { opacity: .6; }
.btn:active, .link:active { transform: scale(.97); }
.btn:focus-visible, .link:focus-visible, .nav-links a:focus-visible, .brand:focus-visible { outline: 2px solid var(--moss); outline-offset: 4px; border-radius: 999px; }
.k-arrow svg { width: 15px; height: 15px; }
.k-arrow > * { transition: transform .75s var(--ease), opacity .9s ease; }
.k-arrow > :last-child { opacity: 0; }
:is(:hover, :focus-visible) > .k-arrow > :first-child { opacity: 0; }
:is(:hover, :focus-visible) > .k-arrow > :last-child { opacity: 1; }

/* Fusuma reveal: frames open from the centre outwards */
.kit-js:not(.is-static) [data-fusuma] { clip-path: inset(0% 50% 0% 50%); }

/* Nav */
.nav { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 92px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand svg { width: 22px; height: 22px; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: .02em; }
.brand-ja { font-family: var(--serif); font-size: 13px; color: var(--muted); }
.nav-links { display: flex; gap: 36px; }
.nav-links a { font-size: 14px; text-decoration: none; letter-spacing: .04em; transition: opacity .9s cubic-bezier(.2, .6, .2, 1); }
.nav-links a:hover { opacity: .55; }

/* 1. Hero */
.hero { padding-top: clamp(132px, 12.2vw, 176px); }
.hero-text { text-align: center; }
.h-display { font-family: var(--serif); font-weight: 500; font-size: clamp(42px, 6.3vw, 94px); line-height: 1.08; letter-spacing: -.015em; margin: 0 auto; max-width: 12em; }
.hero-ja { font-family: var(--serif); font-size: clamp(15px, 1.2vw, 18px); letter-spacing: .16em; margin: 26px 0 0; }
.hero-sub { max-width: 38em; margin: 26px auto 0; color: var(--muted); font-size: clamp(16px, 1.2vw, 18px); }
.hero-cta { margin-top: 34px; display: flex; gap: 36px; justify-content: center; align-items: center; flex-wrap: wrap; }
.stage { position: relative; margin: clamp(56px, 5.6vw, 84px) 0 0; aspect-ratio: 21 / 9; border-radius: var(--r); overflow: hidden; background: #D8D8D2; }
.stage video { position: absolute; inset: 0; }
.plate { position: absolute; left: 0; bottom: 0; background: var(--ground); padding: 12px 22px 0 0; border-top-right-radius: var(--r); font-size: 12px; letter-spacing: .06em; color: var(--muted); line-height: 1.5; }
.plate [lang="ja"] { color: var(--ink); margin-right: .8em; }

/* 2. One number */
.count { padding: clamp(128px, 15vw, 232px) 0; }
.count-num { font-family: var(--serif); font-weight: 400; font-size: clamp(74px, 15.4vw, 228px); line-height: .92; letter-spacing: -.035em; margin: 0 0 0 -.04em; }
.count-foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; margin-top: clamp(32px, 3.4vw, 52px); }
.count-line { grid-column: 7 / 12; font-family: var(--serif); font-size: clamp(21px, 1.9vw, 28px); line-height: 1.6; margin: 0; }
.count-src { grid-column: 7 / 13; margin-top: 26px; }

/* 3. The house */
.house { padding: 0 0 clamp(120px, 14vw, 220px); }
.house-head { margin-bottom: clamp(40px, 4.4vw, 64px); }
.h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.4vw, 50px); line-height: 1.24; letter-spacing: -.01em; margin: 20px 0 0; }
.house-grid { display: grid; grid-template-columns: minmax(0, 7.6fr) minmax(0, 4fr); gap: clamp(40px, 5.2vw, 84px); align-items: start; }
.plan-panel { background: var(--paper); border-radius: var(--r); padding: clamp(14px, 3vw, 44px) clamp(14px, 3vw, 44px) clamp(14px, 2.4vw, 32px); }
.plan { position: relative; }
.plan-svg { width: 100%; height: auto; overflow: visible; }
.plan-svg * { vector-effect: non-scaling-stroke; }
.f-tatami { fill: #F4F5EE; }
.f-board { fill: #fff; }
.f-doma { fill: url(#hatch); }
.hatch { stroke: #BABCB3; stroke-width: 1; }
.board { stroke: #DCDDD6; stroke-width: .6; }
.tile { stroke: #E0E1DA; stroke-width: .6; }
.mat { fill: none; stroke: #8E9088; stroke-width: .8; }
.heri { stroke: #C6C8BF; stroke-width: .6; }
.fx { fill: #fff; stroke: #7A7C75; stroke-width: .8; }
.fx-l { stroke: #7A7C75; stroke-width: .8; }
.fx-dash { stroke: #9A9C94; stroke-width: .7; stroke-dasharray: 3 3; }
.stone { fill: #fff; stroke: #8E9088; stroke-width: .8; }
.post-round { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.w-out { stroke: var(--ink); stroke-width: 1.8; stroke-linecap: square; }
.w-in { stroke: var(--ink); stroke-width: 1.15; }
.w-edge { stroke: var(--ink); stroke-width: .9; }
.d-fusuma { fill: #C7C9C0; stroke: var(--ink); stroke-width: .7; }
.d-shoji { fill: #fff; stroke: var(--ink); stroke-width: .7; }
.d-glass { fill: #fff; stroke: #55574F; stroke-width: .6; }
.d-wood { fill: #fff; stroke: var(--ink); stroke-width: .8; }
.win { fill: #fff; stroke: var(--ink); stroke-width: .8; }
.win-l { stroke: var(--ink); stroke-width: .6; }
.track { stroke: #8E9088; stroke-width: .6; }
.tobukuro { fill: #fff; stroke: var(--ink); stroke-width: .8; }
.post { fill: var(--ink); }
.hi { fill: var(--moss); opacity: 0; transition: opacity .7s ease; }
.hi.is-hover { opacity: .06; }
.hi.is-on { opacity: .12; }
.room { position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; background: none; border: 0; border-radius: 0; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.room:focus-visible { outline: 2px solid var(--moss); outline-offset: -3px; }
.room-lab { display: inline-flex; flex-direction: column; align-items: center; padding: 5px 10px 6px; background: #fff; border-radius: 2px; line-height: 1.3; transition: color .7s ease, background-color .7s ease; }
.room-ja { font-family: var(--serif); font-weight: 500; font-size: clamp(12px, 1.1vw, 16px); }
.room-en { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 9.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.room.is-seen .room-en::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--moss); }
.room[aria-pressed="true"] .room-lab { color: var(--moss); background: #ECEFE7; }
.room[aria-pressed="true"] .room-en { color: var(--moss); }
.plan-garden { position: absolute; transform: translate(-50%, -50%); font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); white-space: nowrap; pointer-events: none; }
.plan-garden [lang="ja"] { font-family: var(--serif); font-size: 13px; color: var(--ink); margin-right: .5em; letter-spacing: 0; }
.plan-legend { container-type: inline-size; display: flex; align-items: center; gap: 26px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.lg [lang="ja"] { font-family: var(--serif); font-size: 12px; color: var(--ink); letter-spacing: .04em; }
.lg svg { width: 22px; height: 11px; flex: none; }
.lg-right { margin-left: auto; display: inline-flex; align-items: center; gap: 22px; }
.lg-scale { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.lg-bar { width: 11.83cqw; height: 5px; border: 1px solid var(--ink); border-top: 0; }
.lg-north svg { width: 12px; height: 18px; }

.detail { display: grid; grid-template-areas: "photo" "body" "tally"; row-gap: 30px; }
.detail-photo { grid-area: photo; margin: 0; }
.ph-stack { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: #D8D8D2; }
.ph-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-cap { margin-top: 12px; font-size: 12px; letter-spacing: .06em; color: var(--muted); line-height: 1.5; }
.ph-cap [lang="ja"] { color: var(--ink); margin-right: .8em; }
.detail-body { grid-area: body; }
.d-name { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.2vw, 33px); line-height: 1.25; margin: 12px 0 0; }
.d-name [lang="ja"] { margin-right: .45em; }
.d-note { margin: 12px 0 0; max-width: 27em; color: var(--muted); font-size: 16px; }
.d-cost { margin: 20px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 14px; }
.d-val { font-family: var(--serif); font-size: clamp(28px, 2.4vw, 36px); letter-spacing: -.01em; }
.d-unit { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.tally { grid-area: tally; border-top: 1px solid var(--line); padding-top: 22px; }
.tally-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.tally-label { font-size: 14px; color: var(--muted); }
.tally-val { font-family: var(--serif); font-size: 24px; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; padding: 6px 0; background: none; border: 0; font-size: 15px; color: var(--ink); }
.switch:focus-visible { outline: 2px solid var(--moss); outline-offset: 4px; border-radius: 4px; }
.sw { position: relative; width: 40px; height: 22px; border-radius: 999px; border: 1px solid rgba(28, 29, 26, .45); transition: background-color .7s ease, border-color .7s ease; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform .7s var(--ease), background-color .7s ease; }
.switch[aria-checked="true"] .sw { background: var(--moss); border-color: var(--moss); }
.switch[aria-checked="true"] .sw::after { transform: translateX(18px); background: #fff; }
.tally-note { margin: 8px 0 0; font-size: 12px; letter-spacing: .03em; color: var(--muted); line-height: 1.7; }

/* 4. After */
.after { padding: 0 0 clamp(120px, 14vw, 220px); }
.after-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; }
.after-photo { grid-column: 5 / 13; grid-row: 1; margin: 0; aspect-ratio: 3 / 2; border-radius: var(--r); overflow: hidden; background: #D8D8D2; }
.after-photo img, .carp-photo img { width: 100%; height: 100%; object-fit: cover; }
.after-text { grid-column: 1 / 5; grid-row: 1; display: flex; align-items: flex-end; gap: 22px; padding-right: 12px; }
.after-ja { writing-mode: vertical-rl; text-orientation: mixed; font-family: var(--serif); font-size: 15px; letter-spacing: .32em; color: var(--muted); margin: 0; }
.after-line { font-family: var(--serif); font-size: clamp(20px, 1.75vw, 26px); line-height: 1.6; margin: 0; }

/* 5. The carpenter and the limit */
.carp { padding: 0 0 clamp(120px, 14vw, 220px); }
.carp-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.carp-photo { grid-column: 1 / 6; margin: 0; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: #D8D8D2; }
.carp-photo img { object-position: 57% 40%; }
.carp-text { grid-column: 7 / 12; }
.carp-line { font-family: var(--serif); font-size: clamp(24px, 2.45vw, 36px); line-height: 1.55; margin: 24px 0 0; }
.carp-limit { margin: 44px 0 0; padding-top: 22px; border-top: 1px solid var(--line); max-width: 30em; color: var(--muted); font-size: 16px; }

/* 6. Close */
.find { padding: clamp(40px, 5vw, 80px) 0 clamp(128px, 15vw, 232px); text-align: center; }
.find-row { margin-top: 44px; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.select { position: relative; text-align: left; }
.select-btn { display: flex; align-items: center; gap: 16px; height: 52px; min-width: 310px; padding: 0 22px 0 24px; background: var(--paper); border: 1px solid rgba(28, 29, 26, .18); border-radius: 999px; font-size: 15px; color: var(--ink); transition: border-color .9s ease, transform .25s var(--ease); }
.select-btn:hover { border-color: rgba(28, 29, 26, .5); }
.select-btn:active { transform: scale(.97); }
.select-btn:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; }
.select-lab { font-size: 10.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.select-val { flex: 1; text-align: left; }
.select-btn svg { width: 12px; height: 12px; transition: transform .6s var(--ease); }
.select-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.select-list { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 6; margin: 0; padding: 8px; list-style: none; background: var(--paper); border: 1px solid rgba(28, 29, 26, .14); border-radius: 20px; max-height: 312px; overflow: auto; outline: none; }
.select-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 16px; border-radius: 12px; font-size: 15px; cursor: pointer; transition: background-color .4s ease; }
.select-list li [lang="ja"] { font-family: var(--serif); font-size: 13px; color: var(--muted); }
.select-list li.is-active { background: #EEF1EA; }
.select-list li[aria-selected="true"] { color: var(--moss); }
.select-list:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 44px 0 52px; }
.foot-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 48px; align-items: start; font-size: 13px; color: var(--muted); line-height: 1.8; }
.foot-note { margin: 0; max-width: 48em; }
.foot-copy { margin: 0; white-space: nowrap; }

@media (max-width: 1100px) {
  .house-grid { grid-template-columns: 1fr; }
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "photo body" "photo tally"; column-gap: 40px; row-gap: 24px; align-items: start; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-in { height: 76px; }
  .hero-sub { font-size: 16px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .stage { aspect-ratio: 4 / 5; }
  .count-line, .count-src { grid-column: 1 / -1; }
  .heri, .room-en { display: none; }
  .room-lab { padding: 3px 6px; }
  .plan-legend { flex-wrap: wrap; gap: 12px 18px; }
  .lg-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .detail { grid-template-columns: 1fr; grid-template-areas: "body" "photo" "tally"; row-gap: 26px; }
  .after-photo { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .after-text { grid-column: 1 / -1; grid-row: 2; margin-top: 28px; align-items: flex-start; }
  .carp-photo { grid-column: 1 / -1; }
  .carp-text { grid-column: 1 / -1; margin-top: 44px; }
  .carp-limit { margin-top: 32px; }
  .find-row { flex-direction: column; align-items: stretch; }
  .select-btn { min-width: 0; width: 100%; }
  .find-row .btn { justify-content: center; }
  .foot-grid { grid-template-columns: 1fr; gap: 20px; }
}
