/* ── 深緑と生成り。銅色を1点だけ差す ────────────────────────── */
:root {
  /* Meiryo UI 優先。無い環境は OS 標準の日本語 UI 書体へ落とす */
  --ui: "Meiryo UI", Meiryo, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", sans-serif;
  --bg:      #F1F0EA;
  --panel:   #FFFFFF;
  --panel-2: #E5E3DB;
  --ink:     #17201B;
  --ink-2:   #4C554F;
  --ink-3:   #7C847E;
  --moss:    #23503C;
  --moss-2:  #2F6B4F;
  --moss-w:  #E2EAE4;
  --copper:  #B5643C;
  --line:    #D8D6CE;
  --line-2:  #C2C0B7;
  --shadow:  0 1px 2px rgba(23,32,27,.05), 0 12px 34px rgba(23,32,27,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12160F; --panel: #191E17; --panel-2: #222820;
    --ink: #EAEBE4; --ink-2: #B0B5AE; --ink-3: #838A83;
    --moss: #7CC0A0; --moss-2: #A2D6BC; --moss-w: #14291F;
    --copper: #E08F63; --line: #29302A; --line-2: #384038;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 36px rgba(0,0,0,.42);
  }
}
:root[data-theme="dark"] {
  --bg: #12160F; --panel: #191E17; --panel-2: #222820;
  --ink: #EAEBE4; --ink-2: #B0B5AE; --ink-3: #838A83;
  --moss: #7CC0A0; --moss-2: #A2D6BC; --moss-w: #14291F;
  --copper: #E08F63; --line: #29302A; --line-2: #384038;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 36px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--ui);
  font-size: 15px; line-height: 1.92; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 800; text-wrap: balance; letter-spacing: .01em; }
.ser { font-family: var(--ui); font-weight: 400; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }

.band { background: var(--moss); color: #F1F0EA; font-size: 11.5px; letter-spacing: .05em; padding: 8px 20px; text-align: center; }

/* ── 上部の社名 ───────────────────────────────────────────── */
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 16px clamp(20px, 4vw, 44px); border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.top .nm { font-size: 19px; font-weight: 800; letter-spacing: .06em; }
.top .nm small { display: block; font-size: 10.5px; letter-spacing: .24em; color: var(--ink-3); font-weight: 400; }
.top .rg { font-size: 11.5px; color: var(--ink-3); text-align: right; line-height: 1.8; }

/* ── 左固定ステージ＋右スクロール ─────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 54%); }

.stage {
  position: sticky; top: 0; height: 100vh;
  background: var(--panel-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 34px clamp(18px, 3vw, 40px);
}
.stagehead { width: 100%; max-width: 520px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.stagehead .rm { font-size: 15px; font-weight: 700; letter-spacing: .08em; }
.stagehead .tg { font-size: 10.5px; letter-spacing: .16em; color: var(--copper); }

/* ビフォーアフター */
.ba { position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; border: 1px solid var(--line-2); background: var(--panel); overflow: hidden; touch-action: pan-y; cursor: ew-resize; }
/* 2枚を同じ位置に重ねる。clip-path を効かせるため層自体に大きさを持たせる */
.ba .lyr { position: absolute; inset: 0; }
.ba .lyr svg { width: 100%; height: 100%; display: block; }
.ba .after { clip-path: inset(0 0 0 var(--split, 50%)); }
.ba .divider {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%);
  width: 2px; background: var(--copper); cursor: ew-resize; z-index: 3;
}
.ba .divider::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 38px; height: 38px; border-radius: 50%; background: var(--copper);
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.ba .divider::after {
  content: "◀ ▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  color: #fff; font-size: 9px; letter-spacing: -.02em; white-space: nowrap; z-index: 1;
}
.ba .tagba {
  position: absolute; top: 10px; z-index: 4;
  font-size: 10.5px; letter-spacing: .16em; padding: 3px 10px;
  background: var(--ink); color: var(--bg);
}
.ba .tagba.b { left: 10px; }
.ba .tagba.a { right: 10px; background: var(--moss); }

.slider { width: 100%; max-width: 520px; margin-top: 14px; }
.slider input { width: 100%; accent-color: var(--copper); }
.slider p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-3); }

.rooms { display: flex; gap: 1px; margin-top: 16px; width: 100%; max-width: 520px; background: var(--line); border: 1px solid var(--line); }
.rooms button {
  flex: 1; font: inherit; font-size: 12.5px; padding: 9px 0; cursor: pointer;
  background: var(--panel); color: var(--ink-2); border: none; transition: background .2s, color .2s;
}
.rooms button[aria-pressed="true"] { background: var(--moss); color: #fff; }

/* ── 右の本文 ─────────────────────────────────────────────── */
.flow { min-width: 0; }
.sec { padding: 56px clamp(22px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.sec.hero { padding-top: 64px; }
.kick { font-size: 10.5px; letter-spacing: .28em; color: var(--copper); margin: 0 0 16px; }
h1 { font-size: clamp(27px, 3.4vw, 44px); line-height: 1.44; }
h1 em { font-style: normal; color: var(--moss); }
.lede { color: var(--ink-2); margin: 20px 0 0; max-width: 46ch; }
.sec h2 { font-size: 24px; margin-bottom: 8px; }
.sec .lead { color: var(--ink-2); font-size: 14px; margin: 0 0 22px; max-width: 52ch; }

.rise { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.3,1); }
.rise.seen { opacity: 1; transform: none; }

.pts { list-style: none; margin: 0; padding: 0; }
.pts li { padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 14px; }
.pts li::before { content: ""; width: 10px; height: 10px; margin-top: 12px; background: var(--moss); }
.pts h3 { font-size: 16px; margin-bottom: 3px; }
.pts p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* 見積の読み方 */
.quote { background: var(--panel); border: 1px solid var(--line); }
.qrow { display: grid; grid-template-columns: minmax(0,1fr) 96px; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: center; }
.qrow:last-child { border-bottom: none; }
.qrow.head { background: var(--panel-2); font-size: 11.5px; letter-spacing: .06em; color: var(--ink-2); }
.qrow .v { text-align: right; font-variant-numeric: tabular-nums; }
.qrow.warn { background: var(--moss-w); }
.qrow.warn .v { color: var(--copper); font-weight: 700; }
.qnote { font-size: 12.5px; color: var(--ink-3); margin: 14px 0 0; }

/* 概算 */
.calc { background: var(--panel); border: 1px solid var(--line); padding: 22px; }
.opts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.opt { display: flex; gap: 11px; align-items: center; background: var(--panel); padding: 11px 13px; font-size: 13.5px; cursor: pointer; }
.opt:hover { background: var(--panel-2); }
.opt input { accent-color: var(--moss); margin: 0; }
.opt b { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.est { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px,1fr)); gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.est .k { font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); }
.est .v { font-size: 27px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.est .v small { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 2px; }
.est .v.g { color: var(--moss); }

/* 工期 */
.gantt { background: var(--panel); border: 1px solid var(--line); padding: 20px 18px; }
.grow { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 14px; align-items: center; padding: 7px 0; font-size: 13px; }
.gbar { height: 16px; background: var(--panel-2); position: relative; }
.gbar i { position: absolute; top: 0; height: 100%; background: var(--moss); width: 0; transition: width .8s cubic-bezier(.2,.8,.3,1); }
.gscale { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 14px; font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }
.gscale span { display: flex; justify-content: space-between; }

/* 注意 */
.warns { list-style: none; margin: 0; padding: 0; }
.warns li { padding: 14px 16px; border-left: 3px solid var(--copper); background: var(--panel); margin-bottom: 10px; font-size: 13.5px; }
.warns b { display: block; margin-bottom: 3px; }

/* ── 実装メモ ──────────────────────────────────────────────── */
.techgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 22px 28px; }
.techgrid dt { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.techgrid dd { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }
.techgrid .m { font-family: var(--ui); font-size: 11.5px; color: var(--copper); }

/* ── 問い合わせ ────────────────────────────────────────────── */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 16px 20px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f > label { font-size: 11px; letter-spacing: .14em; color: var(--ink-3); }
.f .req { color: var(--copper); }
.f input[type="text"], .f input[type="email"], .f input[type="tel"], .f textarea, .f select {
  font: inherit; font-size: 14px; padding: 10px 11px; width: 100%;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 3px;
}
.f textarea { min-height: 112px; resize: vertical; }
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--moss); }
.f .err { font-size: 11.5px; color: var(--copper); min-height: 1.15em; }
.f.bad input, .f.bad textarea, .f.bad select { border-color: var(--copper); }
.consent { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.consent input { accent-color: var(--moss); margin-top: 5px; }
.submit {
  font: inherit; font-size: 15px; font-weight: 700; padding: 14px 42px; margin-top: 4px;
  background: var(--moss); color: #fff; border: none; border-radius: 3px; cursor: pointer;
  transition: background .2s, transform .16s;
}
.submit:hover { background: var(--moss-2); transform: translateY(-1px); }
.sent { display: none; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--moss); background: var(--moss-w); font-size: 13px; }
.sent.on { display: block; }

.pagetop {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--moss); color: #fff; text-decoration: none; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .2s;
}
.pagetop.on { opacity: 1; pointer-events: auto; transform: none; }
.pagetop:hover { background: var(--copper); }
.pagetop b { font-size: 15px; line-height: 1; }
.pagetop span { font-size: 7.5px; letter-spacing: .1em; margin-top: 3px; }

footer { padding: 30px clamp(22px, 4vw, 56px) 62px; font-size: 12.5px; color: var(--ink-3); }
footer p { margin: 0 0 8px; text-wrap: pretty; word-break: auto-phrase; }

@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .stage { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 26px 20px 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1 !important; transform: none !important; }
  .gbar i { transition: none; }
  .submit:hover, .pagetop:hover { transform: none; }
}
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
