/* デモ7 — 「考える仕事の現場を歩く」没入型コーポレートサイト
   地＝紙の白、文字＝インク、マーカーの青は線と注釈だけに使う */

:root {
  --paper: #faf8f3;
  --paper-2: #f1ede3;
  --ink: #22262d;
  --muted: #6f747b;
  --blue: #1e4fd6;
  --line: #ddd6c6;
  --card: #fffdf8;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --hand: "Zen Kurenaido", var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  background: rgba(250, 248, 243, .92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--line);
}
.site-header__inner {
  width: min(1240px, 100% - 3rem); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0;
}
.brand { text-decoration: none; display: flex; align-items: baseline; gap: .7rem; }
.brand__word { font-weight: 700; letter-spacing: .34em; font-size: 1.05rem; }
.brand__company { font-size: .72rem; color: var(--muted); letter-spacing: .12em; }
.site-header__consult {
  text-decoration: none; font-size: .85rem; font-weight: 500;
  border: 1px solid var(--ink); border-radius: 999px; padding: .42rem 1.2rem;
  background: rgba(250, 248, 243, .85);
}
.site-header__consult:hover { background: var(--ink); color: var(--paper); }

/* ---------- シーン共通（スクロール＝カメラ） ---------- */
.scene { position: relative; }
.scene__stage {
  position: relative; height: 100svh; overflow: hidden; background: var(--paper-2);
}
.scene__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#contact { scroll-margin-top: 64px; }
.scene__caption {
  position: absolute; left: clamp(1.2rem, 5vw, 4.5rem); bottom: clamp(4.5rem, 10vh, 6.5rem);
  background: var(--card); border: 1px solid var(--line);
  padding: 1.4rem 1.8rem 1.5rem; max-width: min(30rem, calc(100vw - 2.4rem));
  box-shadow: 0 18px 40px rgba(34, 38, 45, .14);
}
.scene__verb {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 6.5vw, 4.2rem); line-height: 1.15; margin: 0 0 .5rem;
}
.scene__line { margin: 0; font-size: .95rem; color: #3c4149; }
.note {
  position: absolute; z-index: 3;
  font-family: var(--hand); color: var(--blue);
  font-size: clamp(1.05rem, 2.6vw, 1.5rem); letter-spacing: .04em;
  transform: rotate(-3deg); margin: 0; pointer-events: none;
  text-shadow: 0 1px 0 rgba(250, 248, 243, .65);
}

/* 1. 入口 */
.gate-copy {
  position: absolute; left: clamp(1.2rem, 5vw, 4.5rem); bottom: clamp(5rem, 12vh, 7.5rem);
  color: var(--ink); z-index: 2;
}
.gate-copy__en {
  margin: 0 0 .8rem; font-size: .78rem; letter-spacing: .42em; font-weight: 700; color: var(--blue);
}
.gate-copy__main {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.5rem, 7.5vw, 5.2rem); line-height: 1.3; margin: 0;
  text-shadow: 0 2px 24px rgba(250, 248, 243, .9), 0 0 4px rgba(250, 248, 243, .9);
}
.gate-copy__sub { margin: 1.1rem 0 0; font-size: .9rem; color: #3c4149; letter-spacing: .06em; }
.scene__veil {
  position: absolute; inset: 0; background: linear-gradient(180deg, rgba(250,248,243,0) 55%, rgba(250,248,243,.55));
  opacity: .35; pointer-events: none;
}
.scene__scroll {
  position: absolute; right: clamp(1.2rem, 4vw, 3rem); bottom: 2rem; z-index: 2;
  font-size: .72rem; letter-spacing: .4em; color: var(--muted); margin: 0;
  writing-mode: vertical-rl;
}

/* 2. ガラスに描く */
.glass-draw { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.glass-draw .draw {
  stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; opacity: .6;
}
.note--glass { top: 16%; right: 8%; }

/* 3. 対話のテーブル */
.note--talk { top: 14%; left: 6%; transform: rotate(-4deg); color: #fff; text-shadow: 0 1px 10px rgba(34,38,45,.45); }

/* 4. 分析の壁 */
.board-notes { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bnote {
  position: absolute; display: inline-block;
  font-family: var(--hand); font-size: clamp(.95rem, 2.2vw, 1.25rem);
  background: #fff7ae; color: #4a4436; padding: .35rem .8rem .45rem;
  box-shadow: 0 6px 14px rgba(34, 38, 45, .18);
}
.bnote--1 { top: 12%; left: 6%; transform: rotate(-4deg); }
.bnote--2 { top: 20%; right: 7%; transform: rotate(3deg); background: #ffd9e2; }
.bnote--3 { bottom: 30%; left: 4%; transform: rotate(2deg); background: #d8ecff; }
.bnote--4 { bottom: 36%; right: 5%; transform: rotate(-3deg); background: #dcf3d8; }
.note--board { top: 8%; left: 50%; transform: translateX(-50%) rotate(-2deg); white-space: nowrap; }

/* 5. 提案の机 */
.desk-sheets { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sheet {
  position: absolute; right: 7%; bottom: 24%;
  width: clamp(120px, 20vw, 230px); aspect-ratio: 1.414;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(34, 38, 45, .18);
}
.sheet::after {
  content: ""; position: absolute; left: 12%; right: 12%; top: 20%; height: 46%;
  background:
    linear-gradient(var(--blue), var(--blue)) 0 0 / 62% 3px no-repeat,
    linear-gradient(#b9c6ea, #b9c6ea) 0 34% / 88% 2px no-repeat,
    linear-gradient(#b9c6ea, #b9c6ea) 0 62% / 74% 2px no-repeat,
    linear-gradient(#b9c6ea, #b9c6ea) 0 90% / 82% 2px no-repeat;
  opacity: .8;
}
.sheet--1 { transform: rotate(-7deg); }
.sheet--2 { right: calc(7% + clamp(30px, 4vw, 54px)); bottom: calc(24% + 12px); transform: rotate(-2deg); }
.sheet--3 { right: calc(7% + clamp(60px, 8vw, 108px)); bottom: calc(24% + 24px); transform: rotate(2deg); }
.note--desk { top: 13%; right: 9%; }

/* 6. 伴走の廊下 */
.scene__img--pan { width: 135%; max-width: none; }

/* ---------- 静かなセクション ---------- */
.section-label {
  font-size: .72rem; letter-spacing: .42em; font-weight: 700; color: var(--blue); margin: 0 0 .6rem;
}
.section-title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 2.4rem;
}
.services { padding: clamp(4.5rem, 10vw, 7.5rem) 0; }
.services__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
}
.service { background: var(--card); padding: 1.8rem 1.5rem 2rem; position: relative; }
.service__num {
  position: absolute; top: 1.1rem; right: 1.2rem; font-size: .78rem; color: var(--muted); letter-spacing: .2em;
}
.service__en { font-size: .68rem; letter-spacing: .34em; color: var(--blue); font-weight: 700; margin: 0 0 .5rem; }
.service h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: 0 0 1rem; }
.service__tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.service__tags li {
  font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: .18rem .7rem; color: #3c4149;
  background: var(--paper);
}
.flow { padding: 0 0 clamp(4.5rem, 10vw, 7.5rem); }
.flow__line {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem;
  border-top: 2px solid var(--blue); padding-top: 1.4rem;
}
.flow__line li { display: flex; flex-direction: column; gap: .3rem; }
.flow__num { font-size: .72rem; color: var(--blue); letter-spacing: .24em; font-weight: 700; }
.flow__word { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }

/* ---------- 締め・会社概要・フッター ---------- */
.cta { position: relative; min-height: 92svh; display: grid; place-items: center; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 24, .18), rgba(10, 14, 24, .42));
}
.cta__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta__inner { position: relative; text-align: center; color: #f5f1e8; padding: 2rem 1.2rem; }
.cta__title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.6rem); margin: 0 0 2rem;
  text-shadow: 0 2px 26px rgba(10, 14, 24, .55);
}
.cta__button {
  display: inline-block; text-decoration: none; font-weight: 500;
  border: 1px solid #f5f1e8; border-radius: 999px; padding: .9rem 3rem;
  background: rgba(16, 20, 30, .35); backdrop-filter: blur(4px);
}
.cta__button:hover { background: #f5f1e8; color: var(--ink); }
.company { padding: clamp(4rem, 9vw, 6.5rem) 0; background: var(--paper-2); }
.company__layout { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; }
.company__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 0; }
.company__facts { margin: 0; }
.company__facts > div {
  display: grid; grid-template-columns: 130px 1fr; gap: 1rem;
  padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.company__facts dt { color: var(--muted); font-size: .88rem; }
.company__facts dd { margin: 0; }
.site-footer { padding: 3rem 0 5.5rem; }
.site-footer__top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer__top p { margin: 0; font-weight: 500; }
.site-footer__address { color: var(--muted); font-size: .88rem; }
.site-footer__copyright { color: var(--muted); margin-top: 2rem; }
.mobile-bar {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 60;
  background: var(--ink); color: var(--paper); text-align: center;
  text-decoration: none; padding: .95rem; font-weight: 500;
  padding-bottom: calc(.95rem + env(safe-area-inset-bottom));
}

/* ---------- モーション（JS有効時のみ） ---------- */
html.motion .scene--gate { height: 320svh; }
html.motion .scene--glass { height: 280svh; }
html.motion .scene--talk { height: 250svh; }
html.motion .scene--board { height: 300svh; }
html.motion .scene--desk { height: 270svh; }
html.motion .scene--walk { height: 330svh; }
html.motion .scene__stage { position: sticky; top: 0; }

html.motion .scene--gate .scene__img { transform: scale(calc(1 + var(--p, 0) * .3)); }
html.motion .scene--gate .gate-copy { transform: translateY(calc(var(--p, 0) * -46px)); opacity: calc(1 - var(--p, 0) * .55); }
html.motion .scene--gate .scene__veil { opacity: calc(.35 + var(--p, 0) * .4); }
html.motion .scene--gate .scene__scroll { opacity: calc(1 - var(--p, 0) * 3); }

html.motion .scene--glass .scene__img { transform: scale(calc(1.14 + var(--p, 0) * .12)); }
html.motion .scene--glass .scene__caption {
  opacity: clamp(0, calc((var(--p, 0) - .55) * 4), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - .55) * 4), 1)) * 26px));
}
html.motion .note--glass { opacity: clamp(0, calc((var(--p, 0) - .6) * 5), 1); }

html.motion .scene--talk .scene__img { transform: scale(calc(1.05 + var(--p, 0) * .13)) translateY(calc(var(--p, 0) * -1.5%)); }
html.motion .scene--talk .scene__caption {
  opacity: clamp(0, calc((var(--p, 0) - .3) * 4), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - .3) * 4), 1)) * 26px));
}
html.motion .note--talk { opacity: clamp(0, calc((var(--p, 0) - .15) * 5), 1); }

html.motion .scene--board .scene__img { transform: scale(calc(1.04 + var(--p, 0) * .14)); }
html.motion .bnote { opacity: 0; }
html.motion .bnote--1 { opacity: clamp(0, calc((var(--p, 0) - .18) * 7), 1); }
html.motion .bnote--2 { opacity: clamp(0, calc((var(--p, 0) - .34) * 7), 1); }
html.motion .bnote--3 { opacity: clamp(0, calc((var(--p, 0) - .5) * 7), 1); }
html.motion .bnote--4 { opacity: clamp(0, calc((var(--p, 0) - .66) * 7), 1); }
html.motion .note--board { opacity: clamp(0, calc((var(--p, 0) - .78) * 6), 1); }
html.motion .scene--board .scene__caption {
  opacity: clamp(0, calc((var(--p, 0) - .45) * 4), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - .45) * 4), 1)) * 26px));
}

html.motion .scene--desk .scene__img { transform: scale(calc(1.03 + var(--p, 0) * .12)); }
html.motion .sheet { opacity: 0; }
html.motion .sheet--1 {
  opacity: clamp(0, calc((var(--p, 0) - .2) * 7), 1);
  transform: translate(calc((1 - clamp(0, calc((var(--p, 0) - .2) * 7), 1)) * 60px), calc((1 - clamp(0, calc((var(--p, 0) - .2) * 7), 1)) * -30px)) rotate(-7deg);
}
html.motion .sheet--2 {
  opacity: clamp(0, calc((var(--p, 0) - .42) * 7), 1);
  transform: translate(calc((1 - clamp(0, calc((var(--p, 0) - .42) * 7), 1)) * -14px), calc((1 - clamp(0, calc((var(--p, 0) - .42) * 7), 1)) * -46px)) rotate(-2deg);
  right: calc(7% + clamp(30px, 4vw, 54px)); bottom: calc(24% + 12px);
}
html.motion .sheet--3 {
  opacity: clamp(0, calc((var(--p, 0) - .64) * 7), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - .64) * 7), 1)) * -52px)) rotate(2deg);
  right: calc(7% + clamp(60px, 8vw, 108px)); bottom: calc(24% + 24px);
}
html.motion .note--desk { opacity: clamp(0, calc((var(--p, 0) - .8) * 6), 1); }
html.motion .scene--desk .scene__caption {
  opacity: clamp(0, calc((var(--p, 0) - .4) * 4), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - .4) * 4), 1)) * 26px));
}

html.motion .scene--walk .scene__img--pan {
  transform: translateX(calc(var(--p, 0) * -21%)) scale(1.06);
}
html.motion .scene--walk .scene__caption {
  opacity: clamp(0, calc((var(--p, 0) - .35) * 4), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--p, 0) - .35) * 4), 1)) * 26px));
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .flow__line { grid-template-columns: repeat(3, 1fr); row-gap: 1.6rem; }
  .company__layout { grid-template-columns: 1fr; gap: 1.2rem; }
}
@media (max-width: 640px) {
  .brand__company { display: none; }
  .services__grid { grid-template-columns: 1fr; }
  .flow__line { grid-template-columns: repeat(2, 1fr); }
  .company__facts > div { grid-template-columns: 96px 1fr; }
  .mobile-bar { display: block; }
  .scene__caption { left: 1rem; right: 1rem; bottom: 5.2rem; padding: 1.1rem 1.2rem 1.2rem; }
  .gate-copy { left: 1.2rem; right: 1.2rem; bottom: 6.5rem; }
  .site-footer { padding-bottom: 7.5rem; }
}

/* 低い画面（横向き等）では文字を小さくし、潰れを防ぐ */
@media (max-height: 540px) {
  .scene__verb { font-size: 1.9rem; }
  .gate-copy__main { font-size: 2rem; }
  .scene__caption { bottom: 1rem; padding: .9rem 1.1rem; }
  .gate-copy { bottom: 1.2rem; }
  .scene__scroll { display: none; }
}

/* 動きを減らす設定：ピン留めと連動を止め、静止レイアウトで全情報を出す */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.motion .scene { height: auto; }
  html.motion .scene__stage { position: relative; }
  html.motion .scene__caption,
  html.motion .note,
  html.motion .bnote,
  html.motion .sheet { opacity: 1 !important; transform: none !important; }
  html.motion .gate-copy { opacity: 1 !important; transform: none !important; }
  .site-header { transition: none; }
}
