/* Colors */
:root {
  --bg: #F8F7F4;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-2: #555555;
  --text-3: #777777;
  --accent: #6537BD;
  --accent-hover: #532CA0;
  --accent-bg: #EEE8FB;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

html.page-home,
body.page-home {
  /* scroll-snap-type: y proximity; */
  /* scroll-padding-top: 84px; */
}

body.page-home main>section {
  /* scroll-snap-align: start; */
  /* scroll-margin-top: 84px; */
}

body.page-home .site-footer {
  /* scroll-snap-align: end; */
}

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.container {
  max-width: 1150px;
  /* margin: 0 auto; */
  width: 100%;
  padding: 0 1rem;
  align-self: center;
}

.page-home-main {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.site-header {
  background: var(--card);
  /* border-bottom: 1px solid #eee; */
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: stretch;
  width: 100%;
}

.site-header .container {
  max-width: none;
  align-self: stretch;
 /* padding: 0 clamp(1rem, 5vw, 4rem); */
}

.site-header,
.site-header * {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.site-header .fa,
.site-header .fa-solid,
.site-header .fa-regular {
  font-family: "Font Awesome 6 Free";
}

.site-header .fa-brands {
  font-family: "Font Awesome 6 Brands";
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Language Switcher in Header */
.calendar-lang-segment {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px;
  flex: 0 0 auto;
  position: relative;
  margin-left: auto;
}

.calendar-lang-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transform: translateX(0);
  transition: transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1), width 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
  pointer-events: none;
  will-change: transform, width;
}

.calendar-lang-option {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.45rem 0.9rem;
  line-height: 1.2;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  transition: color 180ms ease;
  width: auto;
  text-align: center;
}

.calendar-lang-option[data-lang="zh-cn"] {
  width: 60px;
}

.calendar-lang-option.is-active {
  color: var(--accent);
}

.calendar-lang-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(101, 55, 189, 0.12);
}

@media (max-width: 640px) {
  .calendar-lang-segment {
    padding: 2px;
  }
  .calendar-lang-indicator {
    top: 2px;
    left: 2px;
    height: calc(100% - 4px);
  }
  .calendar-lang-option {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  .calendar-lang-option[data-lang="zh-cn"] {
    width: 50px;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: rgba(101, 55, 189, 0.35);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  color: var(--accent);
}

.nav-toggle:hover .nav-toggle-icon,
.nav-toggle:hover .nav-toggle-icon::before,
.nav-toggle:hover .nav-toggle-icon::after,
.nav-toggle:focus-visible .nav-toggle-icon,
.nav-toggle:focus-visible .nav-toggle-icon::before,
.nav-toggle:focus-visible .nav-toggle-icon::after {
  background: var(--accent);
}

.nav-toggle:focus-visible {
  outline: 2px solid rgba(101, 55, 189, 0.35);
  outline-offset: 2px;
}

.nav-toggle-icon {
  position: relative;
  width: 20px;
  height: 2px;
  background: currentColor;
  display: block;
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, top 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-toggle.is-open {
  background: transparent;
}

.nav-toggle.is-open .nav-toggle-icon {
  background: transparent;
}

.nav-toggle.is-open .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand span {
  color: var(--accent);
  margin-left: -0.4rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.05));
}

nav .nav-link {
  margin-left: 0.5rem;
  color: var(--text-2);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  font-weight: 700;
  font-size: 0.85rem;
}

nav button.nav-link {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
}

nav button.nav-user-trigger {
  border-left: 1.5px solid rgba(26, 26, 26, 0.18);
  border-right: 1.5px solid rgba(26, 26, 26, 0.18);
  margin-left: 0.7rem;
}

nav .nav-link:hover {
  color: var(--accent);
}

nav .nav-link-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-caret {
  display: inline-block;
  font-size: 1rem;
  color: var(--text-3);
  transition: transform 0.15s ease, color 0.15s ease;
  margin-right: -0.3rem;
}

.nav-item-dropdown:hover .nav-caret,
.nav-item-dropdown:focus-within .nav-caret {
  transform: rotate(180deg);
  color: var(--accent);
}

.nav-item {
  display: inline-flex;
  align-items: center;
}

.nav-item-dropdown {
  position: relative;
}

.nav-item-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
}

form .nav-dropdown-link {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus {
  color: var(--accent);
  background: var(--accent-bg);
  outline: none;
}

.nav-user .nav-dropdown {
  left: auto;
  right: 0;
}

.nav-user-trigger {
  display: inline-flex;
  align-items: center;
  border-left: 1.5px solid rgba(26, 26, 26, 0.18);
  border-right: 1.5px solid rgba(26, 26, 26, 0.18);
}

.nav-user-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  text-transform: capitalize;
  padding: 0.4rem 0.2rem;
  padding-left: 0.4rem;
}

.nav-user-role {
  display: none;
}

.nav-dropdown-link i {
  margin-right: 0.6rem;
  width: 1.1rem;
  text-align: center;
}

.hero-banner {
  position: relative;
  margin: 0;
  background: #101114;
  width: 100%;
  color: #fff;
  border-radius: 0;
  padding: clamp(1rem, 1vw, 1rem) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-areas: "text media";
  gap: 1.25rem;
  overflow: hidden;
  min-height: calc(100vh - 64px - 60px); /* Fill remaining space: 100vh - header(64) - footer(approx 60) */
  align-items: center;
  padding-left: clamp(6rem, 8vw, 4rem);
}

.hero-text {
  grid-area: text;
  align-self: center;
  justify-self: start;
  text-align: left;
  max-width: 44rem;
}

.hero-title {
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-title .cn {
  color: #C7B8FF;
  letter-spacing: 3px;
  font-size: 2.5rem;
}

.hero-desc {
  margin: 0.8rem 0 1.5rem;
  margin-right: 1.5rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.1rem;

}

.hero-title {
  animation: fadeInUp .6s ease-out both;
}

.hero-desc {
  animation: fadeInUp .7s ease-out .05s both;
}

.hero-actions {
  animation: fadeInUp .8s ease-out .1s both;
}

.btn-lg {
  padding: 0.7rem 1.1rem;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-area: media;
  transform: translateY(calc(var(--hero-base-shift) + var(--hero-parallax)));
  margin-bottom: 1.6rem;
  margin-right: -1rem;
}

.hero-media img {
  width: min(260px, 100%);
  height: auto;
  animation: faqHeroBulbPulse 10s ease-in-out infinite;
  filter: brightness(1);
}

@keyframes faqHeroBulbPulse {
  0%,
  100% {
    filter: brightness(0.7);
  }

  50% {
    filter: brightness(1.15);
  }
}

.hero-bg-accent {
  position: absolute;
  right: -30%;
  top: -10%;
  width: 60%;
  height: 180%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(101, 55, 189, 0.45) 0%, rgba(83, 44, 160, 0.25) 35%, rgba(0, 0, 0, 0) 70%);
  transform: rotate(18deg);
  pointer-events: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatSlow {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-title,
  .hero-desc {
    animation: none;
  }

  .hero-media img {
    animation: none;
  }

  .hero-banner .btn-slide,
  .hero-banner .btn-slide::before {
    transition: none;
  }

  .hero-title,
  .hero-desc {
    opacity: 1;
    transform: none;
  }
}

.btn {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: 50px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-slide {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--accent);
  color: #fff;
  transition: color 0.28s ease, border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 10px 26px rgba(101, 55, 189, 0.28);
  letter-spacing: 1px;
  font-weight: 600;
}

.btn-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  transform: translateX(-102%);
  transition: transform 0.32s ease;
  z-index: -1;
}

.btn-slide:hover,
.btn-slide:focus-visible {
  color: var(--accent);
  border-color: #fff;
  background: transparent;
  box-shadow: 0 14px 32px rgba(83, 44, 160, 0.38);
}

.btn-slide:hover::before,
.btn-slide:focus-visible::before {
  transform: translateX(0);
}

.site-footer {
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #101114;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.875rem;
  display: flex;
  justify-content: center;
  /* margin-top: 2rem; */
}

.site-footer .container {
  max-width: none;
  width: 100%;
  padding: 0 clamp(1rem, 5vw, 4rem);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.footer-locale {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.footer-locale .icon-globe,
.footer-locale .icon-envelope {
  width: 18px;
  height: 18px;
  display: block;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.footer-links a:hover {
  color: #C7B8FF;
}

@media (max-width: 1024px) {
  .hero-banner {
    min-height: calc(100dvh - 64px); /* Fills visible viewport minus header */
    padding: 2rem;
    grid-template-columns: 1fr;
    grid-template-areas: "media" "text";
    text-align: left;
    gap: 1.5rem;
    display: grid;
    align-content: center; /* Vertically center the entire content */
  }
  .hero-text {
    grid-area: text;
    justify-self: start;
    text-align: left;
    max-width: 100%;
    margin: 0;
  }
  .hero-title {
    text-align: left;
    margin: 0;
  }
  .hero-desc {
    text-align: left;
    margin: 0.8rem 0 1.5rem;
    margin-right: 0;
  }
  .hero-actions {
    justify-content: flex-start;
  }
  .hero-media {
    grid-area: media;
    margin-right: 0;
    margin-bottom: 0;
    transform: none;
    justify-content: center;
    display: flex;
  }
  .hero-media img {
    max-height: 32dvh; /* Scale image relative to screen height */
    width: auto;
    object-fit: contain;
    margin: 0 auto;
  }
  .hero-title {
    font-size: 2.1rem;
    margin-bottom: 20px;
    margin-top: 20px;
  }
  .hero-desc{
    font-size: 1.2rem;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    /* gap: 1.5rem; */
    text-align: center;
  }
  .footer-right {
    flex-direction: column;
    gap: 1rem;
  }
  .btn-slide{
    font-size: 1.2rem;
  }
}

@media (max-width: 640px) {
  body.nav-open {
    overflow: hidden;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
  }

  .footer-right {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    margin-bottom: 0.7rem;
  }

  .nav {
    height: auto;
    padding: 0.8rem 0.9rem;
    padding-right: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-toggle {
    display: inline-flex;
    z-index: 40;
  }

  body.nav-open .nav-toggle {
    position: fixed;
    top: 14px;
    right: 16px;
  }

  body.nav-open .brand {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--bg);
    padding: 6rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-16px);
    pointer-events: none;
    transition:
      opacity 0.35s ease,
      transform 0.35s ease,
      visibility 0s linear 0.35s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
      opacity 0.35s ease,
      transform 0.35s ease,
      visibility 0s linear 0s;
  }

  .site-nav .nav-link {
    margin-left: 0;
    padding: 1rem 0.5rem;
    display: block;
    width: min(420px, 100%);
    font-size: 1rem;
    text-align: left;
  }

  .site-nav button.nav-link {
    text-align: left;
  }

  nav button.nav-user-trigger {
    border-left: 0px solid rgba(26, 26, 26, 0.18);
    border-right: 0px solid rgba(26, 26, 26, 0.18);
    margin-left: 0rem;
  }

  .site-nav .nav-item {
    display: block;
    width: min(420px, 100%);
  }

  .site-nav .nav-item-dropdown::after {
    display: none;
  }

  .site-nav .nav-dropdown {
    position: static;
    top: auto;
    left: auto;
    min-width: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    display: none;
  }

  .nav-item-dropdown.is-open .nav-dropdown {
    display: block;
  }

  .nav-dropdown-link {
    padding-left: 1.5rem;
  }
}
