@charset "UTF-8";
@import "style.css";

:root {
  --ratio: 3034 / 1841;
  --k: 0.8;
  --gap: 1.4vmin;
  --D-wish: 28vw;
  --D-max-safe: calc((50vmin - var(--gap)) / (3 * var(--k)));
  --D: min(var(--D-wish), var(--D-max-safe));
  --R: calc(50vmin - (var(--k) * var(--D)) - var(--gap));
  --ellipse-x: 1.35;
  --ellipse-y: 0.85;
  --inv-ellipse-x: calc(1 / var(--ellipse-x));
  --inv-ellipse-y: calc(1 / var(--ellipse-y));
}

@media (min-width: 768px) and (max-width: 960px) {
:root {
  --R: calc(40vmin - (var(--k) * var(--D)) - var(--gap));
}
}
@media screen and (max-width:764px) {
:root {
  --R: calc(40vmin - (var(--k) * var(--D)) - var(--gap));
}
}


html,body { height:100%; margin:0; }
html, body {
	overflow: hidden;
	background: #f7f8fb;
}

/* ===== Carousel stage ===== */
.carousel-stage {
  position: relative;
  width: 100vmin;
  height: 100vh;
  margin: 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-bg {
  position: absolute;
  inset: 0;
  z-index: 100;
}

/* ===== Inner / Layers ===== */
.carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform: scale(0);
  transform-origin: center;
  transition: transform 1s ease;
  z-index: 200;
}
#layer-below, #layer-above { position: absolute; inset: 0; }
#layer-below { z-index: 200; }
#layer-above { z-index: 600; pointer-events: none; }
#layer-above .panel { pointer-events: auto; }

/* ===== 中央固定画像 ===== */
.center-image {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 25vw;
  height: 27vw;
  background: transparent url(../center.png) no-repeat center top;
  background-size: contain;
  z-index: 500;
  pointer-events: none;
}
	
/* ===== 線（SVG） ===== */
.connection-lines {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: -1;
}
.connection-lines line {
  stroke: #1b94d3;
  stroke-width: 2;
  opacity: 1;
}

/* ===== パネル ===== */
.panel {
  --angle: 0deg;
  position: absolute;
  top: 50%; left: 50%;
  width: 27vw;
  aspect-ratio: var(--ratio);
  cursor: pointer;
  transform-origin: center;
  transition: transform .8s ease, opacity .3s ease;
  transform:
    translate(-50%, -50%)
    scale(var(--ellipse-x), var(--ellipse-y))
    rotate(var(--angle))
    translateX(var(--R))
    rotate(calc(-1 * var(--angle)))
    scale(var(--inv-ellipse-x), var(--inv-ellipse-y));
    -webkit-transition: 0.5s;
    -moz-transition: 0.5s;
    -o-transition: 0.5s;
    -ms-transition: 0.5s;
    transition: 0.5s;
}
.panel .bg { position: absolute; inset: 0; background: center/contain no-repeat;
    animation: mapanimation 2s ease-in-out infinite;
 }

@keyframes mapanimation {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
/* ===== ブラウザサイズ設定 ===== */
@media screen and (min-width: 1000px) {
.panel .bg {
	background-size: 95%
}
.center-image {
	background-size: 95%;
}
}
@media screen and (min-width: 1100px) {
.center-image {
  height: 23vw;
}
.panel .bg {
	background-size: 85%
}
.center-image {
	background-size: 85%;
}
}
@media screen and (min-width: 1200px) {
.center-image {
  height: 18vw;
}
.panel .bg {
	background-size: 80%
}
.center-image {
	background-size: 87.5%;
}
}
.panel .label {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  font-weight: 700; color: #fff; pointer-events: none;
}
.panel .label strong {
	position: relative;
	display: inline-block;
	background: #cee5f2;
	color: #242160;
	line-height: 1; padding: 7px 25px 10px 45px;
	border-radius: 30px;
}
.panel .label strong::after {
	content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 12px solid #cee5f2;
}
.panel .label strong::before {
	content: "";
    position: absolute;
    bottom: 0;
	top: 6px;
    left: 20px;
    width: 18px;
    height: 18px;
}
body.started .panel .label strong {
	background: #E3F2F9;
	color: #777FB1;
}
body.started .panel .label strong::before {
	opacity: .5;
}
body.started .panel .label strong::after {
    border-top: 12px solid #E3F2F9;
}
body.started .panel.bright strong {
	background: #cee5f2;
	color: #242160;
}
body.started .panel.bright strong:before {
	opacity: 1;
}
body.started .panel.bright .label strong::after {
    border-top: 12px solid #cee5f2;
}
.panel.education .label strong::before {
	background: transparent url(../panels/education.svg) no-repeat center center;
	background-size: cover;
}
.panel.service .label strong::before {
	background: transparent url(../panels/service.svg) no-repeat center center;
	background-size: cover;
}
.panel.office .label strong::before {
	background: transparent url(../panels/office.svg) no-repeat center center;
	background-size: cover;
}
.panel.manufacturing .label strong::before {
	background: transparent url(../panels/manufacturing.svg) no-repeat center center;
	background-size: cover;
}
.panel.medical .label strong::before {
	background: transparent url(../panels/medical.svg) no-repeat center center;
	background-size: cover;
}
.panel.government .label strong::before {
	background: transparent url(../panels/government.svg) no-repeat center center;
	background-size: cover;
}
body.started .panel.dim { opacity: 1 !important; }
body.started .panel.bright { opacity: 1 !important;width:40vw;z-index: 99 !important; }
#layer-above .panel.hide { opacity: 0!important; }

/* ===== コントローラー ===== */
#carousel-controller {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 999;
  pointer-events: auto;
  transition: opacity .6s ease;
  background: rgba(255,255,255,.75);
  padding: 1.75% 2.85%;
  border: solid 1px #0c0d6a;
  border-radius: 30px;
}
#carousel-controller.show {
  opacity: 1;
  pointer-events: auto;
}
#carousel-controller button {
	position:relative;
	width: 15px;
	height: 15px;
  cursor: pointer;
  transition: .3s;
}
#carousel-controller button.prev::before ,
#carousel-controller button.next::before {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0px;
	top: 0;
    margin: auto;
    content: "";
    width: 15px;
    height: 15px;
    border-top: 2px solid #0c0d6a;
    border-right: 2px solid #0c0d6a;
}
#carousel-controller button.prev::before {
    transform: rotate(225deg);
}
#carousel-controller button.next::before {
    transform: rotate(45deg);
}

#carousel-controller .dots { display: flex; gap: 8px; }
#carousel-controller .dot {
	width: 10px; height: 10px; border-radius: 50%; background: #A3A3C7;
	transition: background .3s;
	cursor: pointer;
}
#carousel-controller .dot.active { background: #0C0D6A; }
body.started .panel.bright .label { display: flex; }

#carousel-controller .pause {
  width: 10px;
  height: 10px;
  cursor: pointer;
  border: none;
}

#carousel-controller .pause::after {
	content: "";
	position: absolute;
	top: 0;
	left: -2px;
	bottom: auto;
	right: auto;
	width: 1em;
	height: 1em;
    background: linear-gradient(to bottom, #0C0D6A 0%, #0C0D6A 100%) 3px 0px, linear-gradient(to bottom, #0C0D6A 0%, #0C0D6A 100%) 8px 0px;
	background-size: 0.2em 0.8em;
	background-repeat: no-repeat;
	border: none;
}
#carousel-controller.paused .pause::after {
	top: 0;
	bottom:0px;
	left: 0;
	right: 0;
	margin: auto;
	display: inline-block;
	vertical-align: middle;
	color: #333;
	line-height: 1;
	width: 0;
	height: 0;
	border-style: solid;
	border-color: transparent;
	border-width: 0.375em 0.64952em;
	border-left-color: #0C0D6A;
	border-right: 0;
}


/* ===== Loading ===== */
#overlay{
  position:fixed; inset:0;
  background:rgba(255,255,255,.95);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  z-index:9999;
}
.progress-ring{ transform:rotate(-90deg); margin-bottom:20px; }
.progress-ring__circle{ transition:stroke-dashoffset .2s ease; }
#loading-text{ font-size:1.1rem; color:#242160; }

/* ===== Intro Scene ===== */
#intro{
  position:fixed; inset:0; overflow:hidden; background:#fff; z-index:9998;
}
#intro.hidden { display:none !important; }
#intro .bg{
  position:absolute; inset:0;
  background:url('/assets/bg.png') no-repeat center center;
  background-size:contain;
  transform:scale(1.6) translateY(-20vh);
  animation: zoomOutDown 6s ease-in-out forwards;
}
@keyframes zoomOutDown{
  0%{ transform:scale(1.6) translateY(-20vh); opacity:1; }
  100%{ transform:scale(0.75) translateY(25vh); opacity:1; }
}
#intro .logo{
  position:absolute; width:auto;height:15vh; left:50%; top:10%;
  transform:translate(-50%,0); opacity:0; filter:drop-shadow(0 6px 16px rgba(0,0,0,.15));
  animation: fadeInLogo 2s ease-in-out 6s forwards;
}
@keyframes fadeInLogo{ 0%{opacity:0} 100%{opacity:1} }

#intro.fade-out .bg{ animation: fadeOutStillBg 2.4s ease-in-out forwards; }
#intro.fade-out .logo{ animation: fadeOutLogo 2.4s ease-in-out forwards; }
@keyframes fadeOutStillBg{
  0%{ opacity:1; transform:scale(0.75) translateY(25vh); }
  100%{ opacity:0; transform:scale(0.75) translateY(25vh); }
}
@keyframes fadeOutLogo{ 0%{opacity:1} 100%{opacity:0} }

#intro {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
 background: #fff;
}

#intro .intro-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 1;
}

#intro .video-controls {
	position: absolute;
	right: 2%;
	bottom: 2%;
	z-index: 9;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10%;
    width: 5vw;
}
#intro .video-controls button {
    width: calc(90% / 2);
    font-size: 11px;
}
.togglePlayBtn::after {
  content: "STOP";
}
.togglePlayBtn:not(.is-playing)::after {
  content: "PLAY";
}

#intro .video-controls .skipBtn span,
#intro .video-controls .togglePlayBtn span {
	position: relative;
	display: block;
	padding-top: 10px;
}
#intro .video-controls .skipBtn span::before {
    position: absolute;
    top: 3.5%;
    margin: 0 auto;
    width: 0px;
    height: 0px;
    border: 4px solid transparent;
    border-left: 7px solid #333;
    box-sizing: border-box;
    content: "";
    left: 35%;
}
#intro .video-controls .skipBtn span::after {
    position: absolute;
    top: 0%;
    margin: 0 auto;
    right: 34%;
    width: 2px;
    height: 10px;
    background: #333;
    content: "";
}
#intro .video-controls .togglePlayBtn:not(.is-playing) span::before {
    position: absolute;
    top: 5%;
    left: 42%;
    margin: 0 auto;
    width: 0px;
    height: 0px;
    border: 4px solid transparent;
    border-left: 7px solid #333;
    box-sizing: border-box;
    content: "";
}
#intro .video-controls .togglePlayBtn.is-playing span::before,
#intro .video-controls .togglePlayBtn.is-playing span::after {
	position: absolute;
    top: 0%;
    width: 2px;
    height: 10px;
    box-sizing: border-box;
    background-color: #333;
    content: "";
}
#intro .video-controls .togglePlayBtn.is-playing span::before {
    left: 40%;
}
#intro .video-controls .togglePlayBtn.is-playing span::after {
    right: 39%;
}

/* ===== Main ===== */
#main-content{ display:none; }
#main-content.active{ display:block; }

.connection-lines line.conn-line {
  stroke: #007bff;
  stroke-width: 1.5;
  transition: opacity 0s ease, stroke-width 0s ease;
}
#intro.fade-out {
  opacity: 0;
  transition: opacity 1.2s ease;
}

#intro.hidden {
  display: none;
}

#main-content {
	position: relative;
}
@keyframes fadeInBg {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* 共通設定 */
#main-content::before,
#main-content::after {
    content: "";
    position: absolute;
    opacity: 0;                /* 最初は透明 */
    animation: fadeInBg 1.8s ease forwards;
    pointer-events: none;
}

/* ==== 左側 ==== */
#main-content::before {
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    background: transparent url(../img/index/top_left.svg) no-repeat left bottom;
    background-size: contain;
    animation-delay: 0.2s;     /* 左を少し遅らせたい場合 */
}

/* ==== 右側 ==== */
#main-content::after {
    bottom: 0;
    right: 0;
    height: 70vh;
    width: 100%;
    background: transparent url(../img/index/top_right.svg) no-repeat right bottom;
    background-size: contain;
    animation-delay: 0.4s;     /* 右をさらに遅らせる */
}

@media (min-width: 768px) and (max-width: 960px) {
:root {
	--gap: -35vmin;
}
.panel {
	width: 70vw;
}
body.started .panel.bright {
    width: 95vw;
}
.carousel-inner {
	margin-top: -10vh;
}
.center-image {
    width: 60vw;
    height: 50vw;
}
#carousel-controller {
    bottom: -3vh;
}
}



@media screen and (max-width:764px) {
:root {
	--gap: -47.5vmin;
}
.panel {
	width: 85vw;
}
body.started .panel.bright {
    width: 95vw;
}
.carousel-inner {
	margin-top: -35vh;
}
.carousel-stage {
	height: 100vh;
}
.center-image {
	width: 80vw;
	height: 60vw;
}
#carousel-controller {
    bottom: -3vh;
}
.connection-lines {

}
#carousel-controller {
  padding: 4% 6%;
}


.panel .label strong {

}
.panel .label strong::before {

}
.panel .label strong::after {

}














#layer-below .panel,
#layer-above .panel {
transform-origin: center center;
}
#main-content::before {
	display: none;
}
#main-content::after {
	display: none;
}



#intro .video-controls {
	right: 4%;
	bottom: auto;
	top: 2.5%;
	width: 15vw;
}

}