/* Global Styles */
body {
    font-family: sans-serif;
    line-height: 1.6;
    background: var(--background-color); /* Use background-color from theme */
    color: var(--text-color); /* Use text-color from theme */
    margin: 0; /* Remove margin from body */
}

html {
    scroll-behavior: smooth;
}

:target {
    scroll-margin-top: 80px;
}

/* Header Styles */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background: transparent;  /* Make header transparent */
    color: var(--primary-color); /* Use primary color for text */
    padding: 1rem 2rem; /* Add padding to header */
    z-index: 1000; /* Ensure header stays on top */
    display: flex;
    justify-content: space-between; /* Space out logo and nav */
    align-items: center; /* Center logo and nav vertically */
    transition: all 0.3s ease; /* Smooth transition when scrolling */
    box-sizing: border-box;
}

/* Header when scrolling down */
header.scrolled {
    background: var(--primary-color); /* Add primary color on scroll */
    color: var(--text-color); /* Use text-color from theme */
    padding: 0.75rem 2rem; /* Adjust padding on scroll */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px); /* Optional: blur effect */
}

.logo {
    font-size: 1.5rem;
    color: inherit; /* Ensure the logo uses the same color as the header */
    white-space: nowrap; /* Prevent logo text from breaking into multiple lines */
}

.logo img {
  height: 20px; /* adjust size as needed */
  width: auto;  /* keep aspect ratio */
  display: block; /* remove any inline spacing */
}

/* Container within header to handle logo and nav */
.container {
    display: flex;
    justify-content: space-between; /* Ensure the logo and nav are spaced out */
    width: 100%;
    align-items: center;
}

/* Navigation styling */
nav {
    display: flex;
    gap: 1rem; /* Space between the links */
}

nav a {
    font-weight: 600;
    color: inherit; /* Inherit color from header */
    text-decoration: none;
}

/* Main Content */
main {
    padding-top: 0; /* Remove extra space caused by fixed header */
}

/* First Section: Ensure header is on top */
section.driving {
    margin-top: 0;
    padding-top: 0;
}

/* Parallax effect for sections with images */
.parallax-section {
    background-attachment: fixed; /* Keeps the image fixed */
    background-position: center;
    background-size: cover;
    height: 100vh;
    color: var(--background-color); /* Use background-color from theme */
    text-align: center;
    padding: 0; /* Remove padding */
    margin: 0; /* Remove margin */
    position: relative; /* Ensure header is on top of this */
    will-change: background-position; /* Improves performance */
}
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay with black */
    z-index: 1; /* Ensure overlay is below the content but above the background */
    pointer-events: none; /* Prevent overlay from interfering with content interaction */
  }


.content-box {
    max-width: 1000px;
    margin: auto;
    color: white; /* Ensure the text is visible */
    z-index: 2; /* Ensure content appears above the overlay */
  }
  

/* Content inside the parallax section (text, etc.) */
/* .parallax-section .content {
    position: relative;
    z-index: 2;
    color: var(--background-color); 
} */

.parallax-section .content-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* Maintain 16:9 ratio */
  width: 80vw;               /* Responsive width */
  max-width: 1000px;
  aspect-ratio: 16 / 9;      /* Native CSS support */

  /* Styling */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 2rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.55);
  color: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.color-section .container {
  padding: 60px 20px;
}

.section-title.gradient-span {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 24px;
}

.parallax-section .content-box h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  color:aqua;
}

.parallax-section .content-box p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  max-width: 90%;
}

/* Color sections without images */
.color-section {
    background-color: var(--primary-color); /* Primary color from theme */
    color: var(--background-color); /* Use background-color as text color */
    height: 100vh;
    text-align: center;
    transition: background-color 0.3s ease;
    margin: 0; /* Remove margin */
}

/* Remove default margin/padding from all sections */
section {
    margin: 0;
    padding: 0;
}

/* Driving Box: Content centered over parallax background */
.driving-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the text */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: var(--background-color); /* Text color */
    width: 50%; /* 50% width of the section */
    padding: 20px;
    border-radius: 10px;
    z-index: 2; /* Text should be on top of the background */
    opacity: 1; /* Initially visible */
    transition: opacity 1s ease-out, transform 1s ease-out; /* Smooth fade out and move */
}

/* Title of the driving box */
.driving-box h2 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    color: var(--text-color);
}

/* Scroll-based animation: Hide the text box when scrolling */
body.scrolled .driving-box {
    opacity: 0; /* Fade out the text box */
    transform: translate(-50%, -70%); /* Optionally, move the text upwards slightly for a disappearing effect */
}


.gradient-span{
    background: linear-gradient(90deg, #9F54FD 22.27%, #FFC69C 105.76%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
    position: relative;
    z-index: 1;
    display: inline-block;
  }


/* Color Section 基本样式 */
.color-section {
  background-color: var(--primary-color);
  color: var(--background-color);
  padding: 90px 20px;
}

/* Flex 排版（同 card 机制） */
.color-layout {
  display: flex;
  flex-wrap: wrap;         /* 宽则左右，窄则上下 */
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* 左列：标题部分 */
.color-left {
  flex: 1 1 40%;
  text-align: left;
  min-width: 280px;
}
.color-left h2 {
  font-size: 2rem;
  font-weight: 700;
  color: aqua;
}

/* 右列：文字段落 */
.color-right {
  flex: 1 1 55%;
  font-size: 1.15rem;
  line-height: 1.8;
  color: #f0f0f0;
  min-width: 280px;
}

/* 窄屏：上下排 */
@media (max-width: 768px) {
  .color-left,
  .color-right {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* 装饰线条 */
.color-decor-top,
.color-decor-bottom {
  height: 4px;
  width: 60px;
  margin: 12px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFC69C 0%, #9F54FD 100%);
}
.color-decor-bottom {
  width: 40px;
  opacity: 0.7;
}

.parallax-section { position: relative; }

.parallax-section .content-box,
.driving-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important; /* beat any inline transforms */
  z-index: 2;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Make sure the hero section and canvas have space under the fixed navbar */
#driving-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}


.color-decor-top,
.color-decor-bottom {
  height: 4px;
  width: 60px;
  margin: 12px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFC69C 0%, #9F54FD 100%);
}

.color-decor-bottom {
  width: 40px;
  opacity: 0.7;
}




/* Mobile scaling for brief section  */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #9F54FD; outline-offset: 2px; border-radius: 6px; }
a, button { -webkit-tap-highlight-color: rgba(159,84,253,0.2); }

h1 { font-size: clamp(1.8rem, 6vw, 3rem); line-height: 1.2; }
h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.3; }
h3 { font-size: clamp(1.25rem, 4.5vw, 1.75rem); line-height: 1.35; }
p, li, label, input, textarea, button { font-size: clamp(1rem, 3.8vw, 1.125rem); }

/* Parallax fixes for mobile */
.parallax-section { background-attachment: scroll !important; min-height: 100svh; height: auto !important; }
@media (max-width: 768px) {
  .parallax-section .content-box {
    width: 92vw !important;
    aspect-ratio: auto !important;
    padding: 1.25rem !important;
    max-height: calc(100svh - 120px);
    overflow: auto;
  }
}

/* Sticky header adjustments */
@media (max-width: 768px) {
  header {
    position: sticky !important;
    top: 0;
    padding: 0.75rem 1rem !important;
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,0.35);
  }
  nav { gap: 0.5rem !important; }
  .logo img { height: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
