/* =========================================================
   杉村商会 — top page
   和紙の地・墨の文字・朱の差し色。帳簿（台帳）の罫線が全体のモチーフ。
   ========================================================= */

:root {
  --paper: #FCFBF8;   /* 白に近い和紙 */
  --paper-2: #F6F3ED;
  --paper-3: #EAE5DA;
  --washi: url("../img/washi.webp");
  --ink: #15130F;
  --ink-2: #38342C;
  --muted: #6A6354;
  --rule: rgba(21, 19, 15, .14);
  --rule-strong: rgba(21, 19, 15, .42);
  --shu: #B5311A;
  --shu-bright: #E2532E;
  --night: #121110;
  --night-2: #1B1916;
  --on-night: #ECE7DC;
  --on-night-muted: #A29A89;
  --rule-night: rgba(236, 231, 220, .14);

  --f-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --f-latin: "Instrument Serif", "Times New Roman", serif;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --header-h: 72px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--paper) var(--washi) repeat;
  background-size: 512px 512px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .02em;
  font-feature-settings: "palt" 1;
  word-break: auto-phrase; /* 日本語を文節で改行する（対応ブラウザのみ・未対応でも通常の改行） */
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
::selection { background: var(--shu); color: var(--paper); }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 4px; border-radius: 2px; }

.mono { font-family: var(--f-mono); letter-spacing: .04em; }
.latin { font-family: var(--f-latin); font-style: italic; letter-spacing: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.br-sp { display: none; }
@media (max-width: 767px) { .br-sp { display: inline; } .br-pc { display: none; } }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  transform: translateY(-160%); transition: transform .3s var(--ease-out);
}
.skip:focus { transform: none; }

/* 紙の粒子 */
.grain {
  position: fixed; inset: 0; z-index: 150; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- 文字の分割（04 テキストリビール） ---------- */
.char-wrap { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.char { display: inline-block; will-change: transform; }

/* ---------- ボタン ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; gap: .7em;
  min-height: 48px; padding: 12px 26px;
  border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bg); color: var(--fg);
  font: 500 15px/1 var(--f-body); letter-spacing: .08em;
  transition: background-color .35s var(--ease-out), transform .35s var(--ease-out);
}
.btn__arrow { display: inline-block; transition: transform .45s var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(5px); }
.btn:hover { --bg: var(--shu); }
.btn--small { min-height: 44px; padding: 10px 20px; font-size: 14px; }
.btn--shu { --bg: var(--shu); }
.btn--shu:hover { --bg: var(--ink); }

/* ---------- ヘッダー（23 隠れるヘッダー） ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; gap: 32px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: transform .5s var(--ease-out), border-color .4s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__logo { width: 44px; height: 44px; flex-shrink: 0; }
.brand__name { font: 800 20px/1 var(--f-display); letter-spacing: .14em; }
.brand__latin { font: italic 15px/1 var(--f-latin); color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; gap: 28px; font-size: 14px; letter-spacing: .14em; }
.nav a { position: relative; padding: 10px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 1023px) { .brand__latin { display: none; } }
@media (max-width: 767px) {
  :root { --header-h: 60px; }
  .nav { display: none; }
  .brand__logo { width: 38px; height: 38px; }
  .brand__name { font-size: 18px; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; }
.hero__stage {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--header-h) + clamp(20px, 4vh, 48px)) var(--gutter) clamp(36px, 7vh, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas:
    "eyebrow ."
    "lead    ."
    ".       ."
    "title   title";
  column-gap: clamp(32px, 5vw, 96px);
  max-width: var(--maxw); margin: 0 auto;
  overflow: hidden;
}
/* 帳簿の罫線 */
.hero__stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0 55px, rgba(21, 19, 15, .055) 55px 56px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.hero__stage::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) - 14px); z-index: 0;
  width: 4px; border-left: 1px solid rgba(181, 49, 26, .35); border-right: 1px solid rgba(181, 49, 26, .35);
  pointer-events: none;
}
.hero__eyebrow {
  grid-area: eyebrow; position: relative; z-index: 3; display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--muted); text-transform: uppercase;
}
.hero__eyebrow-sep { width: 40px; height: 1px; background: var(--rule-strong); }
.hero__title {
  grid-area: title; align-self: end; position: relative; z-index: 3;
  margin-top: clamp(24px, 4vh, 48px);
  font: 800 clamp(40px, 7vw, 120px)/1.16 var(--f-display);
  letter-spacing: .01em;
  pointer-events: none;
}
.hero__line { display: block; white-space: nowrap; }
.hero__title em { font-style: normal; color: var(--shu); }
.hero__lead {
  grid-area: lead; position: relative; z-index: 3;
  margin-top: clamp(20px, 3.4vh, 36px);
  font-size: clamp(15px, 1.25vw, 18px); line-height: 2; color: var(--ink-2); letter-spacing: .1em;
}

/* 3D（hero3d.js）: 和紙の地に墨の線で描いた9つの時代 */
.hero__canvas { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease-out); }
.hero__canvas.is-ready { opacity: 1; }
.hero__canvas canvas { display: block; width: 100%; height: 100%; }

/* いまの時代の名前を、背景に大きく薄く */
.eras-ghost {
  position: absolute; z-index: 1; left: var(--gutter); top: 47%; translate: 0 -50%;
  font: 800 160px/1 var(--f-display); letter-spacing: .02em; white-space: nowrap;
  color: rgba(21, 19, 15, .06); pointer-events: none; user-select: none;
}
.eras-ghost.is-ai { color: rgba(181, 49, 26, .1); }
html:not(.has-3d) .eras-ghost { display: none; }

/* 年表（24 スクロールスパイの考え方: いまの時代を強調） */
.eras {
  position: absolute; z-index: 3; right: var(--gutter); top: 50%; translate: 0 -50%;
  display: flex; gap: 16px; align-items: stretch;
}
/* 年表の後ろだけ和紙色でぼかし、立体の線と重なっても読めるようにする */
.eras::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -48px calc(-1 * var(--gutter)) -48px -72px;
  background: linear-gradient(90deg, rgba(252, 251, 248, 0), rgba(252, 251, 248, .8) 42%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}
.eras__bar { position: relative; width: 1px; background: var(--rule-strong); }
.eras__bar i { position: absolute; inset: 0; background: var(--shu); transform-origin: top; transform: scaleY(0); }
.eras__rail { display: grid; gap: 2px; }
.eras__item {
  display: grid; grid-template-columns: 24px auto; column-gap: 10px; align-items: baseline;
  color: var(--muted); opacity: .55; transition: opacity .4s var(--ease-out), color .4s;
}
.eras__no { font-size: 10px; letter-spacing: .06em; }
.eras__name { font: 700 14px/1.8 var(--f-display); letter-spacing: .12em; }
.eras__when {
  grid-column: 2; max-width: 11em; font-size: 11px; line-height: 1.6; letter-spacing: .08em; color: var(--muted);
  max-height: 0; overflow: hidden; opacity: 0; transition: max-height .45s var(--ease-out), opacity .45s;
}
.eras__item.is-active { opacity: 1; color: var(--ink); }
.eras__item.is-active .eras__no { color: var(--shu); }
.eras__item.is-active .eras__when { max-height: 5.2em; opacity: 1; }
.eras__item:last-child.is-active .eras__name { color: var(--shu); }
/* 3Dが出ない環境（動きを減らす設定・WebGL非対応）では、年表をすべて文字で見せる */
html:not(.has-3d) .eras__bar { display: none; }
html:not(.has-3d) .eras__item { grid-template-columns: 24px 9.5em auto; opacity: 1; color: var(--ink-2); }
html:not(.has-3d) .eras__item .eras__no { color: var(--muted); }
html:not(.has-3d) .eras__when { grid-column: auto; max-width: none; max-height: none; opacity: 1; }
html:not(.has-3d) .eras__item:last-child .eras__name { color: var(--shu); }

.hero__cue {
  position: absolute; left: 50%; bottom: 18px; z-index: 3; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 10px; text-transform: uppercase; color: var(--muted);
}
.hero__cue i { width: 1px; height: 36px; background: var(--rule-strong); transform-origin: top; animation: cue 2.2s var(--ease-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 50.01% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* 読み込み中のちらつき防止（JSが準備できたら .ready が付く） */
html.js:not(.ready) .hero__title,
html.js:not(.ready) .hero__lead { opacity: 0; }

@media (max-width: 1023px) {
  .hero__stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "eyebrow" "title" "lead" ".";
    row-gap: 0;
  }
  .hero__title { align-self: start; margin-top: clamp(24px, 5vh, 56px); font-size: clamp(34px, 8.6vw, 76px); }
  .eras-ghost { top: 62%; }
}
@media (max-width: 767px) {
  .hero__eyebrow { font-size: 10.5px; gap: 10px; }
  .hero__eyebrow-sep { width: 20px; }
  .hero__stage::after { left: 6px; }
  .hero__cue { display: none; }
  .eras { top: auto; bottom: clamp(20px, 4vh, 36px); left: var(--gutter); right: auto; translate: none; }
  html.has-3d .eras__bar, html.has-3d .eras__item:not(.is-active) { display: none; }
  html.has-3d .eras__name { font-size: 18px; }
  .eras-ghost { top: 64%; }
  .eras::before { inset: -40px calc(-1 * var(--gutter)) -24px; background: linear-gradient(to top, rgba(252, 251, 248, .96) 55%, rgba(252, 251, 248, 0)); }
}

/* =========================================================
   STATEMENT（14 テキストフィル）
   ========================================================= */
.statement {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(110px, 16vw, 240px) var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
}
/* 17 スティッキー: 読んでいる間、ラベルが上に付いてくる */
.statement .label { grid-column: 1 / 4; align-self: start; position: sticky; top: calc(var(--header-h) + 32px); padding-top: .9em; }
.statement__text {
  grid-column: 4 / 13;
  font: 700 clamp(21px, 2.6vw, 40px)/1.8 var(--f-display);
  letter-spacing: .04em; text-wrap: pretty;
}
.statement__text p + p { margin-top: 1.1em; }
/* 時代を変えた技術の列挙: 小さく並べ、最後の「AI」だけ朱で大きく */
.statement__text .statement__eras {
  margin: 1.6em 0 1.5em; padding: 1.1em 0;
  border-block: 1px solid var(--rule-strong);
  font-size: .62em; line-height: 2.1; letter-spacing: .14em; color: var(--ink-2);
}
.statement__eras em { font-style: normal; font-size: 1.9em; line-height: 1; color: var(--shu); letter-spacing: .04em; }
/* inline のままにして、句読点の禁則（行頭の「、」を避ける）を効かせる */
.statement__text .char { display: inline; will-change: opacity; }
@media (max-width: 1023px) {
  .statement .label, .statement__text { grid-column: 1 / -1; }
  .statement .label { position: static; margin-bottom: 28px; }
}

/* =========================================================
   SECTION 共通
   ========================================================= */
.section {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(96px, 12vw, 180px) var(--gutter);
}
.section--night {
  max-width: none;
  background: var(--night); color: var(--on-night);
  --rule: var(--rule-night);
}
.section--night > * { max-width: calc(var(--maxw) - var(--gutter) * 2); margin-left: auto; margin-right: auto; }

.label {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; text-transform: uppercase; color: var(--muted);
}
.section--night .label { color: var(--on-night-muted); }
.label__no { color: var(--shu); }
.section--night .label__no { color: var(--shu-bright); }
.label__line { width: 40px; height: 1px; background: currentColor; }

.section__head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  align-items: end;
  margin-bottom: clamp(56px, 8vw, 120px);
}
.section__head .label { grid-column: 1 / -1; margin-bottom: clamp(16px, 2vw, 28px); }
.h2 {
  grid-column: 1 / 7;
  font: 800 clamp(56px, 9.5vw, 156px)/1 var(--f-display);
  letter-spacing: .02em; white-space: nowrap;
}
.section__lead {
  grid-column: 7 / 13; padding-bottom: .6em;
  font-size: clamp(15px, 1.2vw, 18px); color: var(--ink-2); letter-spacing: .08em;
  text-wrap: pretty;
}
.section__head--compact { margin-bottom: clamp(32px, 4vw, 56px); }
.section__head--compact .h2 { font-size: clamp(40px, 5vw, 80px); }
.section--night .section__lead { color: var(--on-night-muted); }
@media (max-width: 1023px) {
  .h2, .section__lead { grid-column: 1 / -1; }
  .section__lead { margin-top: 24px; }
}

/* ---------- 事業 ---------- */
.svc__item {
  position: relative;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding: clamp(36px, 5vw, 64px) 0 clamp(44px, 6vw, 80px);
}
.svc__item:last-child { border-bottom: 1px solid var(--rule-strong); }
.rule { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink); transform-origin: left; }
.svc__num {
  grid-column: 1 / 4;
  font-size: clamp(72px, 10vw, 160px); line-height: .82; color: var(--shu);
}
.svc__body { grid-column: 5 / 12; }
.svc__title { font: 700 clamp(26px, 2.8vw, 42px)/1.4 var(--f-display); letter-spacing: .06em; }
.svc__text { margin-top: 18px; max-width: 36em; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tags li {
  padding: 5px 12px; border: 1px solid var(--rule-strong); border-radius: 999px;
  font-size: 12px; line-height: 1.4; color: var(--ink-2);
}
@media (max-width: 767px) {
  .svc__num { grid-column: 1 / -1; margin-bottom: 20px; font-size: 64px; }
  .svc__body { grid-column: 1 / -1; }
}

/* ---------- 想定事例（帳簿のマス目） ---------- */
.cases { margin-top: clamp(72px, 9vw, 140px); }
.cases__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 10px 32px; margin-bottom: clamp(24px, 3vw, 40px);
}
.cases__title { font: 700 clamp(24px, 2.4vw, 36px)/1.4 var(--f-display); letter-spacing: .06em; }
.cases__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong);
}
.case {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(22px, 2.4vw, 36px);
  border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
  transition: background-color .5s var(--ease-out);
}
.case:hover { background-color: rgba(255, 255, 255, .6); }
.case__who { display: flex; align-items: baseline; gap: 12px; font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }
.case__no { color: var(--shu); }
.case__pain { font: 700 clamp(17px, 1.35vw, 20px)/1.7 var(--f-display); letter-spacing: .04em; text-wrap: pretty; }
.case__make { padding-top: 14px; border-top: 1px dashed var(--rule-strong); font-size: 14.5px; color: var(--ink-2); }
.case__arrow { margin-right: .45em; color: var(--shu); }
.case .tags { margin-top: auto; padding-top: 4px; }
@media (max-width: 1023px) { .cases__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .cases__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 進め方 ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 40px); counter-reset: s; }
.step { position: relative; padding-top: 28px; border-top: 1px solid var(--ink); }
.step__no { display: block; font-size: 12px; color: var(--shu); text-transform: uppercase; }
.step__title { margin: 18px 0 14px; font: 800 clamp(40px, 4.4vw, 68px)/1 var(--f-display); letter-spacing: .06em; }
.step p { color: var(--ink-2); font-size: 15px; }
.section--night .step { border-top-color: var(--on-night); }
.section--night .step__no { color: var(--shu-bright); }
.section--night .step p { color: var(--on-night-muted); }
@media (max-width: 1023px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; } }
@media (max-width: 559px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 会社概要 ---------- */
.profile { border-bottom: 1px solid var(--rule-strong); }
.profile__row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding: 26px 0; border-top: 1px solid var(--rule-strong);
}
.profile dt { grid-column: 1 / 4; font-size: 13px; color: var(--muted); letter-spacing: .14em; }
.profile dd { grid-column: 4 / 13; font-size: clamp(16px, 1.3vw, 19px); }
.profile__latin { margin-left: 1em; color: var(--muted); font-size: 1.05em; }
@media (max-width: 767px) {
  .profile dt, .profile dd { grid-column: 1 / -1; }
  .profile dd { margin-top: 4px; }
}

/* ---------- 問い合わせ ---------- */
.contact { max-width: none; background: var(--paper-2) var(--washi) repeat; background-size: 512px 512px; }
.contact__grid {
  max-width: calc(var(--maxw) - var(--gutter) * 2); margin: 0 auto;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 56px;
}
.contact__copy { grid-column: 1 / 8; }
.contact__title {
  margin-top: clamp(20px, 2.4vw, 32px);
  font: 800 clamp(26px, 3.7vw, 58px)/1.45 var(--f-display); letter-spacing: .03em;
}
.nowrap { display: inline-block; white-space: nowrap; }
.contact__text { margin-top: 28px; max-width: 26em; color: var(--ink-2); }
.form { grid-column: 8 / 13; display: grid; gap: 28px; align-self: end; }
.field { display: grid; gap: 8px; }
.field label { display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: .1em; }
.req, .opt { font: 500 10.5px/1 var(--f-mono); padding: 4px 7px; border-radius: 2px; letter-spacing: .04em; }
.req { background: var(--ink); color: var(--paper); }
.opt { border: 1px solid var(--rule-strong); color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 12px 0 13px;
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-2); border-radius: 0;
  font: 400 17px/1.6 var(--f-body); color: var(--ink);
  transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 128px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--shu); box-shadow: 0 1px 0 0 var(--shu); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--shu); outline-offset: 6px; }
.field textarea::placeholder { color: var(--muted); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 8px; }
.form__status { font-size: 14px; color: var(--ink-2); }
.form__status.is-error { color: var(--shu); }
@media (max-width: 1023px) {
  .contact__copy, .form { grid-column: 1 / -1; }
}

/* ---------- フッター ---------- */
.site-footer { background: var(--night); color: var(--on-night); overflow: hidden; }
.site-footer__inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 8vw, 120px) var(--gutter) 32px; }
.site-footer__word {
  font: 800 clamp(72px, 21vw, 330px)/.9 var(--f-display);
  letter-spacing: .02em; color: #2B2824; white-space: nowrap;
  margin-left: -.04em;
}
.site-footer__meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px;
  margin-top: clamp(32px, 4vw, 56px); padding-top: 24px; border-top: 1px solid var(--rule-night);
}
.site-footer__logo { width: 72px; height: 72px; }
.site-footer__latin { font-size: 18px; color: var(--on-night-muted); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 13px; letter-spacing: .12em; }
.site-footer__nav a { padding: 8px 0; }
.site-footer__nav a:hover { color: var(--shu-bright); }
.site-footer__copy { font-size: 11.5px; color: var(--on-night-muted); }

/* =========================================================
   動きを減らす設定
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero__cue i { animation: none; }
}

/* 所在地: 住所の書体を本文と同じにする（address の斜体を消す） */
.profile__addr { font-style: normal; line-height: 1.8; }

/* =========================================================
   言語の切り替えボタン（日本語 ⇄ English）
   ========================================================= */
.lang-switch {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  font: 500 12px/1 var(--f-mono); letter-spacing: .06em; color: var(--ink-2);
  transition: border-color .3s, color .3s;
}
.lang-switch:hover { border-color: var(--shu); color: var(--shu); }
@media (max-width: 767px) { .site-header { gap: 10px; } .lang-switch { padding: 6px 10px; } }

/* 英語の見出しを単語の途中で改行しない（main.js が単語ごとにまとめる） */
.word { white-space: nowrap; }

/* =========================================================
   英語版（/en/）: 見出しは Instrument Serif、本文は IBM Plex Sans。字間は英語向けに詰める
   ========================================================= */
html[lang="en"] {
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}
html[lang="en"] body { letter-spacing: 0; line-height: 1.7; font-feature-settings: normal; word-break: normal; }
html[lang="en"] .brand__name { font-weight: 400; font-size: 23px; letter-spacing: 0; }
html[lang="en"] .brand__latin { font-style: normal; font-family: "Shippori Mincho B1", serif; font-size: 13px; }
html[lang="en"] .nav, html[lang="en"] .site-footer__nav { letter-spacing: .04em; }
html[lang="en"] .hero__title { font-weight: 400; font-size: clamp(46px, 7.8vw, 132px); line-height: 1.02; letter-spacing: -.015em; }
html[lang="en"] .hero__title em { font-style: italic; }
html[lang="en"] .hero__lead { max-width: 30em; line-height: 1.7; letter-spacing: .01em; }
html[lang="en"] .eras__name { font-weight: 400; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
html[lang="en"] .eras__when { letter-spacing: .02em; max-width: 14em; }
html[lang="en"] .eras-ghost { font-weight: 400; font-style: italic; }
html[lang="en"] .statement__text { font-weight: 400; font-size: clamp(26px, 3vw, 46px); line-height: 1.4; letter-spacing: -.005em; }
html[lang="en"] .statement__text .statement__eras { font-family: var(--f-body); font-size: .44em; line-height: 1.9; letter-spacing: .02em; }
html[lang="en"] .statement__eras em { font-family: var(--f-display); font-style: italic; font-size: 2.4em; }
html[lang="en"] .h2 { font-weight: 400; letter-spacing: -.02em; }
html[lang="en"] .section__lead { letter-spacing: .01em; }
html[lang="en"] .svc__title, html[lang="en"] .cases__title, html[lang="en"] .step__title, html[lang="en"] .contact__title { font-weight: 400; letter-spacing: -.005em; }
html[lang="en"] .svc__title { font-size: clamp(28px, 3vw, 46px); }
html[lang="en"] .case__pain { font-weight: 400; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.45; letter-spacing: 0; }
html[lang="en"] .step__title { font-style: italic; }
html[lang="en"] .contact__title { font-size: clamp(34px, 4.4vw, 70px); line-height: 1.15; }
html[lang="en"] .profile dt { letter-spacing: .04em; }
html[lang="en"] .profile__ja { font-family: "Shippori Mincho B1", serif; font-style: normal; font-size: .95em; }
html[lang="en"] .req, html[lang="en"] .opt { letter-spacing: .02em; }
html[lang="en"] .field label { letter-spacing: .02em; }
html[lang="en"] .site-footer__word { font-family: "Shippori Mincho B1", serif; font-weight: 800; }

/* 英語版のスマホ: ヘッダーを1行に収める */
@media (max-width: 767px) {
  html[lang="en"] .brand__name { font-size: 19px; white-space: nowrap; }
  html[lang="en"] .site-header .btn--small { padding: 10px 14px; font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
  html[lang="en"] .site-header .btn--small .btn__arrow { display: none; }
  html[lang="en"] .lang-switch { white-space: nowrap; }
}
/* とても狭い画面（〜359px）では屋号の文字を隠し、ロゴだけにする（ロゴに屋号が入っている） */
@media (max-width: 359px) { .brand__name { display: none; } .site-header { gap: 8px; } }
html[lang="en"] .statement__eras em { vertical-align: -.08em; line-height: 0; }
