:root {
  --works: 0;
  --services: 0;
  --about: 0;
  --contact: 0;
  --terms: 1;
}

body { min-height: 760vh; }

.chapter--works,
.chapter--services,
.chapter--about {
  align-items: center;
  opacity: 0;
  pointer-events: none;
}

.chapter--works {
  opacity: var(--works);
  transform: translateX(calc((1 - var(--works)) * -34px));
  background: linear-gradient(90deg, rgba(233, 237, 235, 0.92) 0%, rgba(233, 237, 235, 0.58) 56%, transparent 86%);
}

.chapter--works.is-active { pointer-events: auto; }

.chapter--services {
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  opacity: var(--services);
  transform: translateX(calc((1 - var(--services)) * 34px));
  background: linear-gradient(270deg, rgba(233, 237, 235, 0.94) 0%, rgba(233, 237, 235, 0.75) 68%, transparent 100%);
}

.chapter--services .eyebrow { justify-content: flex-end; }
.chapter--services .eyebrow::before { order: 2; }
.chapter--services p { margin-left: auto; }

.product__inner { width: min(980px, 82vw); }
.product__inner h2 { max-width: 900px; font-size: clamp(46px, 6.2vw, 90px); }
.product__body { display: grid; grid-template-columns: minmax(0, 620px) auto; gap: 12px 38px; align-items: end; }
.chapter--works .product__body > p { margin-top: 20px; }
.chapter--works .product__flow {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  max-width: none;
  margin-top: 8px;
  color: rgba(63, 70, 67, 0.68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.6;
}
.product__flow i { color: rgba(63, 70, 67, 0.28); font-style: normal; }
.product__link {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-width: 184px;
  padding: 10px 0;
  border-top: 1px solid rgba(63, 70, 67, 0.38);
  border-bottom: 1px solid rgba(63, 70, 67, 0.38);
  color: var(--headline);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: padding 180ms ease, border-color 180ms ease;
}
.product__link:hover,
.product__link:focus-visible { padding-left: 8px; border-color: var(--headline); outline: none; }

.projects__inner { width: min(1080px, 85vw); }
.projects__inner h2 { font-size: clamp(48px, 6.2vw, 90px); }
.chapter--services .projects__axis {
  max-width: 680px;
  margin-top: 17px;
  color: rgba(63, 70, 67, 0.72);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.8;
  text-align: right; /* 見出しと同じ右端揃え（語尾を揃える） */
}
.project-ledger {
  width: min(950px, 76vw);
  margin: 17px 0 0 auto;
  border-top: 1px solid rgba(63, 70, 67, 0.3);
  text-align: left;
}
.project-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 76px;
  gap: 22px;
  align-items: start;
  padding: 13px 0 14px;
  border-bottom: 1px solid rgba(63, 70, 67, 0.22);
}
.project-row h3 {
  margin: 0;
  color: var(--headline);
  font-size: clamp(15px, 1.45vw, 20px);
  font-weight: 750;
  line-height: 1.45;
  letter-spacing: -0.025em;
}
.chapter--services .project-row p { margin: 0; text-shadow: none; }
.chapter--services .project-row div p {
  max-width: 610px;
  margin-top: 4px;
  color: rgba(63, 70, 67, 0.64);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.65;
}
.chapter--services .project-row__field,
.chapter--services .project-row__state {
  padding-top: 4px;
  color: rgba(63, 70, 67, 0.52);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.5;
}
.chapter--services .project-row__state { text-align: right; }

.chapter--about {
  opacity: var(--about);
  transform: translateY(calc((1 - var(--about)) * 34px));
  background: linear-gradient(90deg, rgba(233, 237, 235, 0.9) 0%, rgba(233, 237, 235, 0.7) 54%, transparent 82%);
}

@media (min-width: 701px) {
  .chapter--intro .chapter__inner { width: min(1100px, 85vw); }
  .chapter--intro h1 span { white-space: nowrap; }
}

.about__inner { width: min(820px, 66vw); }
.chapter--about h2 {
  max-width: 820px;
  font-size: clamp(48px, 6.2vw, 90px);
  line-height: 1.06;
}

.chapter--about .about__lead {
  max-width: 700px;
  margin-top: 21px;
  color: rgba(63, 70, 67, 0.78);
  line-height: 1.9;
}

.chapter--about .about__lead + .about__lead { margin-top: 9px; }

.chapter--about .about__process {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  max-width: 720px;
  margin-top: 18px;
  color: var(--headline);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.about__process i {
  color: rgba(63, 70, 67, 0.3);
  font-style: normal;
}

.chapter--about .about__signature {
  margin-top: 16px;
  color: rgba(63, 70, 67, 0.62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.about__signature span { margin: 0 5px; color: rgba(63, 70, 67, 0.28); }

/* 改行制御: 句読点で区切ったスパンの途中では折り返さない（読点・句点でだけ改行） */
h1 span,
h2 span,
.chapter p span { display: inline-block; }

.chapter--contact {
  z-index: 4;
  align-items: flex-start;
  overflow-y: auto; /* 画面全体でスクロール可能（右側でホイールしても反応する） */
  overflow-x: hidden; /* 全幅コピーライト（100vw）で横スクロールが出ないようにクリップ */
  padding-top: 96px;
  padding-bottom: 64px;
  opacity: var(--contact);
  transform: translateY(calc((1 - var(--contact)) * 36px));
  pointer-events: none;
  background: linear-gradient(90deg, rgba(233, 237, 235, 0.96) 0%, rgba(233, 237, 235, 0.85) 48%, rgba(233, 237, 235, 0.18) 76%, transparent 100%);
}

.chapter--contact.is-active { pointer-events: auto; }

.contact__inner {
  width: min(650px, 52vw);
  margin: auto 0; /* 収まる時は上下中央、収まらない時は全体スクロールで下まで届く */
}

.chapter--contact h2 {
  max-width: none;
  width: max-content; /* 「まだ言葉になっていなくても、」を読点まで1行に収める（左列の幅制限を超えてよい） */
  font-size: clamp(48px, 6.2vw, 90px);
  line-height: 1.08;
}

.chapter--contact .contact__lead {
  max-width: 560px;
  margin-top: 20px;
  color: rgba(63, 70, 67, 0.76);
  line-height: 1.8;
}

.contact-form {
  display: grid;
  gap: 15px;
  margin-top: 25px;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.contact-field {
  display: grid;
  gap: 6px;
  color: rgba(63, 70, 67, 0.68);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.contact-field span { display: flex; align-items: center; gap: 7px; }

.contact-field i {
  color: rgba(63, 70, 67, 0.42);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 7px 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(63, 70, 67, 0.36);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  transition: border-color 180ms ease;
}

.contact-field textarea {
  min-height: 54px;
  resize: vertical;
  line-height: 1.65;
}

.contact-field input:focus,
.contact-field textarea:focus { border-color: var(--headline); }

.contact-field input:-webkit-autofill,
.contact-field input:-webkit-autofill:hover,
.contact-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0px 1000px transparent inset;
  box-shadow: 0 0 0px 1000px transparent inset;
  transition: background-color 9999s ease-in-out 0s, border-color 180ms ease;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder { color: rgba(63, 70, 67, 0.36); }

.contact-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 164px;
  padding: 13px 22px;
  border: 1px solid var(--headline);
  color: var(--headline);
  background: rgba(233, 237, 235, 0.25);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.contact-submit:hover,
.contact-submit:focus-visible {
  color: var(--paper);
  background: var(--headline);
  outline: none;
}

.contact-status {
  margin: 0;
  color: rgba(63, 70, 67, 0.62);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.7;
}

.site-copyright {
  position: absolute;
  right: auto;
  bottom: clamp(12px, 2vw, 20px);
  left: 50vw;
  width: 100vw;
  max-width: none !important; /* .chapter p の max-width:620px を打ち消して画面全幅に */
  margin: 0 !important;
  transform: translateX(-50%);
  text-align: center;
  color: rgba(63, 70, 67, 0.54);
  font-size: 8px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
}

@media (max-width: 700px) {
  body { min-height: 710vh; }
  html,
  body { overflow-x: hidden; }
  .chapter--middle h2 { font-size: clamp(40px, 11.5vw, 46px); }
  .chapter--middle h2 wbr { display: block; }
  .chapter--works,
  .chapter--services,
  .chapter--about { padding: 88px 18px 74px; }
  .chapter--services {
    align-items: flex-end;
    justify-content: flex-start;
    text-align: left;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(233, 237, 235, 0.95) 0%, rgba(233, 237, 235, 0.78) 78%, transparent 100%);
  }
  .chapter--services .eyebrow { justify-content: flex-start; }
  .chapter--services .eyebrow::before { order: 0; }
  .chapter--services p { margin-left: 0; }
  .product__inner,
  .projects__inner,
  .about__inner { width: 100%; }
  .product__inner h2 { font-size: clamp(30px, 9.4vw, 51px); }
  .product__body { display: block; }
  .chapter--works { align-items: flex-start; overflow-y: auto; padding-top: 96px; background: linear-gradient(180deg, rgba(233, 237, 235, 0.95) 0%, rgba(233, 237, 235, 0.7) 78%, transparent 100%); }
  .chapter--works .product__body > p { margin-top: 14px; font-size: 11px; line-height: 1.7; }
  .product__link { width: 100%; margin-top: 13px; }
  .projects__inner h2 { font-size: clamp(34px, 9.5vw, 46px); }
  .chapter--services .projects__axis { margin-top: 11px; font-size: 12px; line-height: 1.75; text-align: left; }
  .project-ledger { width: 100%; margin-top: 17px; }
  .project-row { grid-template-columns: 1fr auto; gap: 5px 12px; padding: 10px 0 11px; }
  .project-row > div { grid-column: 1 / -1; grid-row: 2; }
  .chapter--services .project-row__state { grid-column: 2; grid-row: 1; }
  .project-row h3 { font-size: 15px; }
  .chapter--services .project-row div p { margin-top: 3px; font-size: 12px; line-height: 1.65; }
  .chapter--services .project-row__state { font-size: 11px; }
  .chapter--about {
    align-items: flex-start;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(233, 237, 235, 0.94) 0%, rgba(233, 237, 235, 0.72) 76%, transparent 100%);
  }
  .chapter--about h2 { font-size: clamp(32px, 10.2vw, 49px); }
  .chapter--about .about__lead { margin-top: 15px; font-size: 13px; line-height: 1.85; }
  .chapter--about .about__process { margin-top: 14px; font-size: 13px; line-height: 1.7; }
  .chapter--about .about__signature { margin-top: 14px; font-size: 13px; letter-spacing: 0.1em; }
  .chapter--contact {
    align-items: flex-start;
    padding: 92px 18px 58px;
    background: linear-gradient(180deg, rgba(233, 237, 235, 0.94) 0%, rgba(233, 237, 235, 0.8) 68%, rgba(233, 237, 235, 0.38) 100%);
  }
  .chapter--contact,
  .contact__inner,
  .contact-form { width: 100%; max-width: 100%; min-width: 0; }
  .contact-field { min-width: 0; }
  .contact-field input,
  .contact-field textarea {
    min-width: 0;
    background-color: transparent !important;
    -webkit-appearance: none;
  }
  .contact-field input:-webkit-autofill,
  .contact-field input:-webkit-autofill:hover,
  .contact-field input:-webkit-autofill:focus {
    background-color: transparent !important;
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
  }
  .chapter--contact h2 { width: auto; max-width: 100%; font-size: clamp(32px, 10.4vw, 50px); }
  .chapter--contact .contact__lead { margin-top: 15px; font-size: 13px; line-height: 1.8; }
  .contact-form { gap: 12px; margin-top: 18px; }
  .contact-form__row { grid-template-columns: 1fr; gap: 12px; }
  .contact-field textarea { min-height: 48px; }
  .contact-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .contact-submit { width: 100%; }
  .site-copyright { bottom: 12px; font-size: 10px !important; letter-spacing: 0.08em !important; }
}

@media (max-height: 700px) {
  .site-copyright {
    position: static;
    left: auto;
    width: 100vw;
    margin: 24px 0 0 calc(-1 * clamp(18px, 5vw, 70px)) !important;
    transform: none;
  }
}

@media (max-width: 700px) and (max-height: 700px) {
  .site-copyright { margin-left: -18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-submit,
  .contact-field input,
  .contact-field textarea { transition: none; }
}
