/* NNiNN renewal — ページ固有スタイル A（トップ / 下層共通 / スマートホーム / 事業サポート） */
@layer pages {

  /* ================= TOP ================= */
  .hero { padding-block: 40px 48px; }
  .hero__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); align-items: stretch; }
  .hero__text { grid-column: 1 / 7; grid-row: 1; display: flex; flex-direction: column; gap: var(--sp-3); padding-top: 72px; padding-bottom: var(--sp-2); position: relative; z-index: 1; }
  .hero__label { letter-spacing: .24em; }
  /* モック実測: トップ H1 は約 100px（ガイドの 76px より大きい）。モック優先で 100px を上限にする */
  .hero__title { font-size: clamp(40px, 7.2vw, 100px); font-feature-settings: "palt"; line-height: 1.15; white-space: nowrap; margin-top: 22px; text-shadow: 0 0 18px var(--c-bg), 0 0 36px var(--c-bg), 0 0 60px var(--c-bg); }
  .hero__br { display: none; }
  @media (max-width: 1200px) { .hero__lead br { display: none; } }
  .hero__lead { color: var(--c-ink-2); font-size: var(--fs-body); margin-top: 6px; }
  .hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-top: var(--sp-2); }
  .hero__tagline { margin-top: auto; padding-top: var(--sp-4); font-size: 17px; color: var(--c-ink-2); position: relative; width: max-content; }
  .hero__tagline::after { content: ""; position: absolute; left: 0; bottom: -8px; width: 24px; height: 1px; background: var(--c-ink-2); }
  .hero__scroll { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-3); font-size: 10px; }
  .hero__media { grid-column: 6 / -1; grid-row: 1; position: relative; border-radius: var(--r-img); overflow: hidden; aspect-ratio: 864 / 914; align-self: start; }
  .hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
  .hero__line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  /* 写真の明るさ・色味を CSS 変数で制御（--light 0〜1 / --warm, --cool 0〜1。JS がカード操作で更新） */
  .hero__media img { filter: brightness(calc(.38 + var(--light, .7) * .72)) saturate(calc(.85 + var(--light, .7) * .2)); transition: filter .5s var(--ease-out); }
  .hero__fx { position: absolute; inset: 0; pointer-events: none; }
  .hero__fx > span { position: absolute; inset: 0; transition: opacity .5s var(--ease-out); }
  .hero__fx-cool { background: rgb(80 130 255); mix-blend-mode: soft-light; opacity: var(--cool, 0); }
  .hero__fx-warm { background: rgb(255 150 60); mix-blend-mode: soft-light; opacity: var(--warm, 0); }
  /* ペンダントライトの位置（仮画像の 67% / 10%）に光をにじませる */
  .hero__fx-glow { background: radial-gradient(circle at 67% 10%, rgb(255 210 140 / .95) 0, rgb(255 190 110 / .45) 9%, rgb(255 180 100 / .12) 22%, transparent 42%); mix-blend-mode: screen; opacity: var(--light, .7); }
  @media (prefers-reduced-motion: reduce) { .hero__media img, .hero__fx > span { transition: none; } }

  /* 操作パネル。仮画像に焼き込まれた UI カードの位置に重ねる（% 指定）。本番写真では自由に置ける */
  .hero__ui { position: absolute; left: 4.6%; bottom: 7.5%; width: 38.2%; min-height: 26.2%; padding: 22px 24px; border-radius: 16px; background: var(--c-paper); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .08); z-index: 2; }
  .hero__ui-head { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--c-ink); text-align: left; min-height: 36px; border-radius: 8px; }
  .hero__ui-head:hover { color: var(--c-blue); }
  .hero__ui-icon { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: var(--c-blue); color: #fff; align-items: center; justify-content: center; flex-shrink: 0; }
  .hero__ui-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--c-ink-2); }
  .hero__ui-row output { font-variant-numeric: tabular-nums; }
  .hero__ui-range { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; margin: 6px 0; border-radius: 2px; background: linear-gradient(var(--c-blue) 0 0) 0 / var(--pct, 70%) 100% no-repeat, var(--c-line); cursor: pointer; }
  .hero__ui-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c-blue); border: 2px solid var(--c-paper); box-shadow: 0 0 0 1px var(--c-blue); transition: transform .2s var(--ease-out); }
  .hero__ui-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--c-blue); border: 2px solid var(--c-paper); box-shadow: 0 0 0 1px var(--c-blue); }
  .hero__ui-range:hover::-webkit-slider-thumb, .hero__ui-range:focus-visible::-webkit-slider-thumb { transform: scale(1.25); }
  .hero__ui-range:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 6px; }
  .hero__ui-stepper { display: inline-flex; align-items: center; gap: 4px; }
  .hero__ui-stepper button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--c-line); color: var(--c-ink); font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
  .hero__ui-stepper button:hover { background: var(--c-blue-tint); border-color: var(--c-blue); color: var(--c-blue); }
  .hero__ui-stepper output { min-width: 3.2em; text-align: center; color: var(--c-ink); }
  .hero__caption { position: absolute; right: 28px; bottom: 24px; text-align: right; color: #fff; font-size: 10px; letter-spacing: .2em; opacity: .9; text-shadow: 0 1px 8px rgb(0 0 0 / .4); }
  /* モック実測: トップ限定の文字サイズ（PC 1080〜） */
  @media (min-width: 1080px) {
    .hero__lead { font-size: clamp(16px, 1.55vw, 22px); line-height: 1.7; }
    .hero__lead { max-width: 82.5%; } /* 画像と重ならない5カラム分 */
    .approach { padding-block: 88px; }
    .approach__text, .stay__text .lead { font-size: 18px; font-feature-settings: "palt"; }
  }
  body[data-page="top"] .section-head h2, body[data-page="top"] .stay__text h2 { font-size: clamp(28px, 4.2vw, 56px); font-feature-settings: "palt"; } /* モック実測 */
  body[data-page="top"] .cta__title { font-size: clamp(30px, 4.25vw, 64px); } /* モック実測 */
  /* 768〜1079: SP と同じ積み順（ラベル → H1 → リード → 画像 → ボタン → タグライン） */
  @media (max-width: 1079px) {
    .hero__inner { display: flex; flex-direction: column; gap: 22px; }
    .hero__text { display: contents; }
    .hero__title { white-space: normal; text-shadow: none; margin-top: 0; }
    .hero__lead { order: 3; margin-top: 0; }
    .hero__media { order: 4; margin-top: 0; width: 100%; align-self: stretch; aspect-ratio: 4 / 3; }
    /* 4/3 クロップ後の焼き込みカード位置に合わせる（768〜1079。SP は下で上書き） */
    .hero__media img { object-position: center bottom; }
    .hero__ui { bottom: 10.6%; min-height: 37%; }
    .hero__actions { order: 5; padding-top: 0; }
    .hero__tagline { order: 6; margin-top: 0; padding-top: var(--sp-2); }
    .hero__scroll { display: none; }
  }
  @media (max-width: 767px) {
    .hero { padding-block: var(--sp-4) var(--sp-7); }
    .hero__br { display: inline; }
    .hero__label { font-size: 10px; }
    .hero__media { aspect-ratio: 350 / 320; }
    .hero__ui { left: 4%; bottom: 4%; width: 52%; min-height: 34%; padding: 12px 14px; border-radius: 14px; gap: 6px; }
    .hero__ui-stepper button { width: 24px; height: 24px; font-size: 12px; }
    .hero__ui-range { margin: 4px 0; }
    .hero__ui-icon { width: 26px; height: 26px; }
    .hero__ui-icon svg { width: 14px; height: 14px; }
    .hero__ui-head { font-size: 12px; gap: 8px; }
    .hero__ui-row { font-size: 11px; }
    .hero__caption { display: none; }
    .hero__actions { flex-direction: column; align-items: stretch; gap: 4px; }
    .hero__actions .textlink { justify-content: center; }
    .hero__tagline { font-size: 15px; padding-top: var(--sp-1); }
    .hero__tagline::after { display: none; }
  }

  /* 01 approach */
  .approach__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: var(--sp-3); align-items: start; }
  .approach__inner .section-head { grid-column: span 5; }
  .approach__text { grid-column: 6 / span 5; padding-left: var(--sp-4); border-left: 1px solid var(--c-line); align-self: center; }
  .approach__deco { grid-column: 11 / span 2; justify-self: end; width: 120px; color: var(--c-ink); }
  @media (min-width: 1080px) and (max-width: 1200px) {
    .approach__deco { display: none; }
    .approach__inner .section-head { grid-column: span 6; }
    .approach__text { grid-column: 7 / span 6; }
    .approach__text { font-size: 17px; }
    .approach__text br { display: none; }
  }
  @media (max-width: 1079px) {
    .approach__inner .section-head { grid-column: 1 / -1; }
    .approach__text { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
    .approach__deco { display: none; }
  }

  /* 02 what we do */
  .whatwedo__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: var(--sp-4); }
  .whatwedo__main { grid-column: span 6; }
  .whatwedo__side { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: var(--sp-4); border-left: 1px solid var(--c-line); padding-left: var(--sp-4); }
  .whatwedo__media { display: block; overflow: hidden; border-radius: var(--r-img); margin-bottom: var(--sp-1); }
  .whatwedo__main .whatwedo__media img { aspect-ratio: 3 / 2; }
  .whatwedo__item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
  .whatwedo__item .whatwedo__media { margin: 0; }
  .whatwedo__item .whatwedo__media img { aspect-ratio: 13 / 10; }
  .whatwedo__item-text { display: flex; flex-direction: column; gap: var(--sp-2); }
  .whatwedo__item .feature__head { flex-direction: column; gap: 6px; }
  .feature__body { padding-left: 36px; }
  .whatwedo__item .feature__body { padding-left: 0; }
  @media (max-width: 1079px) {
    .whatwedo__main { grid-column: 1 / -1; }
    .whatwedo__side { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
    .whatwedo__side { flex-direction: row; }
    .whatwedo__item { flex: 1; grid-template-columns: 1fr; }
  }
  @media (max-width: 767px) {
    .whatwedo__side { flex-direction: column; gap: var(--sp-4); }
    .whatwedo__item .feature__head { flex-direction: row; gap: 14px; }
    .whatwedo__item .feature__body { padding-left: 36px; }
    .whatwedo__media img, .whatwedo__main .whatwedo__media img, .whatwedo__item .whatwedo__media img { aspect-ratio: 5 / 3; }
  }

  /* 03 stay */
  .stay__inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: var(--sp-3); align-items: center; }
  .stay__media { grid-column: span 7; margin: 0; margin-left: calc(var(--gutter) * -1 + 36px); }
  .stay__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-img); }
  .stay__note { font-size: 10px; color: var(--c-muted); margin-top: 10px; }
  .stay__text { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: var(--sp-3); }
  .stay__text .btn { margin-top: var(--sp-1); }
  @media (min-width: 1080px) and (max-width: 1200px) {
    .stay__media { grid-column: span 6; }
    .stay__text { grid-column: 7 / span 6; }
  }
  @media (max-width: 1079px) {
    .stay__media { grid-column: 1 / -1; margin-left: 0; }
    .stay__text { grid-column: 1 / -1; }
  }
  @media (max-width: 767px) {
    .stay { padding-block: 56px 64px; }
    .stay__media img { aspect-ratio: 350 / 240; }
    .stay__note { margin-top: 8px; }
  }
}

@layer pages {
  /* ================= 下層共通 ================= */
  .split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: var(--sp-4); align-items: start; }
  .split > :first-child { grid-column: span 5; }
  .split > :last-child { grid-column: 6 / span 7; }
  .faq-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: var(--sp-4); align-items: start; }
  .faq-layout > .section-head { grid-column: span 4; position: sticky; top: calc(var(--header-h) + var(--sp-3)); }
  .faq-layout > :last-child { grid-column: 5 / span 8; }
  @media (max-width: 1079px) {
    .split > :first-child, .split > :last-child, .faq-layout > .section-head, .faq-layout > :last-child { grid-column: 1 / -1; }
    .faq-layout > .section-head { position: static; }
  }

  /* ================= SMART HOME ================= */
  .functions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--grid-gap); }
  .functions__item { padding: 32px 28px; }
  .functions__text { display: flex; flex-direction: column; gap: 10px; }
  @media (max-width: 1079px) { .functions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 767px) {
    .functions { grid-template-columns: 1fr; gap: 0; }
    .functions__item { flex-direction: row; align-items: flex-start; gap: var(--sp-2); padding: 22px 0; border: 0; border-bottom: 1px solid var(--c-line); border-radius: 0; background: transparent; }
  }

  .owners { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: var(--sp-4); align-items: start; }
  .owners__head { grid-column: span 5; display: flex; flex-direction: column; gap: 28px; }
  .owners__list { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .owners__item { display: flex; flex-direction: column; gap: 10px; padding-top: var(--sp-3); border-top: 1px solid var(--c-sage-line); }
  .owners__num { font-size: 20px; line-height: 1; color: var(--c-blue); }
  .owners__item h3 { font-size: var(--fs-h3); }
  .owners__item p { font-size: 14px; }
  @media (max-width: 1079px) { .owners__head, .owners__list { grid-column: 1 / -1; } }
  @media (max-width: 767px) { .owners__list { grid-template-columns: 1fr; gap: var(--sp-3); } }

  /* ================= SUPPORT ================= */
  .strengths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .strength { display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--c-ink); padding-top: 28px; }
  .strength__num { font-size: 44px; line-height: 1; color: var(--c-blue); }
  .strength h3 { font-size: clamp(18px, 1.5vw, 22px); }
  .strength p { font-size: 14px; }
  @media (max-width: 767px) {
    .strengths { grid-template-columns: 1fr; gap: 0; }
    /* 番号と h3 を同じ行に baseline 揃え、p は2列目 */
    .strength { display: grid; grid-template-columns: auto 1fr; column-gap: var(--sp-2); row-gap: 12px; align-items: baseline; padding-block: var(--sp-3); border-top: 1px solid var(--c-ink); }
    .strength__num { font-size: 30px; }
    .strength p { grid-column: 2; }
  }
}
