.wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* box 保持原始比例，自動高度 */
.box {
  position: relative;
  width: 75vw;        /* 撐滿螢幕寬度 */
  max-width: 1080px;   /* 可限制最大寬度 */
  min-height: 650px; /* 父容器最小高度 */
  overflow: hidden;
}

/* 圖片層：第一層、第三層生長，第二層旋轉 */
.box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 第一層：由下往上生長 */
.layer1 {          
  clip-path: inset(100% 0 0 0);
  animation: growUp 5s ease forwards;
  animation-delay: 0.5s;
  z-index: 1;
}

/* 第二層：旋轉，需要絕對定位 */
.layer2 {
  transform-origin: center center;
  animation: rotate 20s linear infinite;
  z-index: 3;
}

/* 第三層：由上往下生長 */
.layer3 {            
  clip-path: inset(0 0 100% 0);
  animation: growDown 2s ease forwards;
  animation-delay: 2s;
  z-index: 2;
}

/* Responsive background sections */
.bg-section {
width: 100%;
max-width: 100%;
height: auto;
display: block;
object-fit: contain;
opacity: 0;
margin: 0;
padding: 0;
vertical-align: top;
transition: opacity 1.5s ease, transform 1s ease;
}

.bg-section.visible {
opacity: 1;
transform: translateY(0);
}

/* Hero image specific styling */
.hero-image {
width: 100%;
height: auto;
object-fit: contain;
max-height: none;
min-height: auto;
}

/* Story images with parallax effect */
.story-image {
margin: 0;
transform: translateY(30px);
}

.story-image.visible {
transform: translateY(0);
}

/* Intro section with responsive design */
.intro-section {
background-color: #ffe49d;
width: 100%;
padding: 3rem 0;
min-height: 200px;
}

.intro-box {
background-color: aliceblue;
border-radius: 10px;
box-shadow: 5px 4px 15px rgba(0, 0, 0, 0.2);
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-box:hover {
box-shadow: 5px 8px 25px rgba(0, 0, 0, 0.3);
}

.intro-box p {
margin: 0;
line-height: 1.8;
}

body {
background-color: #3D5A8D;
}

/* Content section animations */
.content-section {
padding: 3rem 0;
}

.content-box {
background-color: aliceblue;
border-radius: 10px;
box-shadow: 5px 4px 15px rgba(0, 0, 0, 0.2);
padding: 2rem;
margin-bottom: 2rem;
opacity: 0;
transition: all 0.8s ease;
}

.content-box.animate {
opacity: 1;
}

/* Fade in from bottom */
.fade-in-up {
transform: translateY(50px);
}

.fade-in-up.animate {
transform: translateY(0);
}

/* Fade in from left */
.fade-in-left {
transform: translateX(-50px);
}

.fade-in-left.animate {
transform: translateX(0);
}

/* Fade in from right */
.fade-in-right {
transform: translateX(50px);
}

.fade-in-right.animate {
transform: translateX(0);
}

/* Hover effects for content boxes */
.content-box:hover {
box-shadow: 5px 8px 25px rgba(0, 0, 0, 0.3);
}

/* Heading animations */
.content-box h2 {
position: relative;
padding-bottom: 0.5rem;
transition: color 0.3s ease;
}

.content-box h2::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 3px;
background: linear-gradient(90deg, #45b06c, #3D5A8D);
transition: width 0.6s ease;
}

.content-box.animate h2::after {
width: 100px;
}

/* Paragraph line height for readability */
.content-box p {
line-height: 1.8;
color: #333;
}



@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes growUp {
from { clip-path: inset(100% 0 0 0); }
to   { clip-path: inset(0 0 0 0); }
}

@keyframes growDown {
from { clip-path: inset(0 0 100% 0); }
to   { clip-path: inset(0 0 0 0); }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
* {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
.layer1, .layer2, .layer3 {
  animation: none !important;
  clip-path: inset(0 0 0 0) !important;
  opacity: 1 !important;
}
.bg-section, .content-box, .intro-box {
  opacity: 1 !important;
  transform: none !important;
}
}
/* 下方內容示範 */
.content {
width: 100%;
text-align: center;
margin-top: 20px;
font-size: 20px;
}
/* Text overlay positioning */
.text-overlay {
position: absolute;
top: 0;
left: 5%;
z-index: 1000;
}
.logo-img{
  display: inline-block;
  width: 15%;
}

.no-story-image{
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
.box img {
  height: auto;
}

.logo-img{
  width: 12%;
}

.no-story-image{
  display: block;
}

.box {
  min-height: 300px;
}

.intro-section {
  padding: 2rem 0;
}

.intro-box,
.content-box {
  width: 100%;
  padding: 1.5rem;
}

.content-section {
  padding: 2rem 0;
}

.hero-image {
  width: 100%;
  height: auto;
}

.story-image {
  margin: 0;
}

.text-overlay {
  font-size: 10px;
  position: absolute;
  /* position: relative; */
  left: 0;
  padding: 1rem;
}
.text-overlay h2{
  font-size: 15px;
}
}

@media (max-width: 375px) {
.box img {
  height: auto;
}
.logo-img{
  width: 12%;
}

.no-story-image{
  display: block;
}

.box {
  min-height: 300px;
}

.intro-box,
.content-box {
  width: 100%;
  padding: 1rem;
}

.content-box h2 {
  font-size: 1.5rem;
}

.hero-image {
  width: 100%;
  height: auto;
}

.text-overlay {
  position: absolute;
  left: 0;
  padding: 0.5rem;
}
.iphone{
  position: relative; 
}
}
u{
  margin-bottom: 2%;
  display: block;
}