/* 小象生图剧 — small additions on top of the extracted Tailwind bundle. */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* hover-play videos start hidden over their poster */
video[data-src] {
  transition: opacity 0.5s ease;
}

/* scroll reveal (falls back to fully visible without JS) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* keep the marquee rows pausing on hover like the original */
.home-gallery-row:hover .home-gallery-track {
  animation-play-state: paused;
}

/* accordion body height animation needs an explicit auto fallback */
#faq-list .overflow-hidden {
  overflow: hidden;
}

/* mobile drawer scroll lock helper */
body:has(.fixed.inset-0.z-\[60\]:not(.hidden)) {
  overflow: hidden;
}

/* --- English typography tweaks ----------------------------------------- */
/* English strings are longer; give headings more room and slightly smaller type */
html[lang="en"] #banner header {
  max-width: min(94vw, 74rem);
}
html[lang="en"] #banner h1 {
  font-size: clamp(2.1rem, 3.4vw + 0.5rem, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
html[lang="en"] #banner h1 > span {
  display: inline;
}
html[lang="en"] #banner p {
  font-size: 1rem;
  line-height: 1.7;
}
html[lang="en"] h2 {
  letter-spacing: -0.02em;
}
html[lang="en"] .section-kicker {
  letter-spacing: 0.24em;
}

/* English nav is wider — trim gaps a little earlier than in Chinese */
html[lang="en"] header nav {
  gap: 1.6rem;
}
html[lang="en"] .logo-slogan {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
}
@media (max-width: 1180px) {
  html[lang="en"] header nav {
    gap: 1.1rem;
  }
  html[lang="en"] header nav span.rounded-\[3px\] {
    display: none;
  }
}
@media (max-width: 1120px) {
  html[lang="en"] .logo-slogan {
    display: none;
  }
}

/* logo lockup ---------------------------------------------------------- */
.logo-lockup {
  text-decoration: none;
  flex: none;
}
.logo-mark {
  /* the supplied mark is a wide elephant+film-strip lockup */
  max-width: 5.4rem;
  flex: none;
  transition: opacity 0.2s ease;
}
.logo-lockup:hover .logo-mark {
  opacity: 0.82;
}
.logo-word,
.logo-slogan {
  white-space: nowrap;
}

/* nav labels must never wrap to two lines */
header nav a,
header nav button {
  white-space: nowrap;
}

/* header CTA and language pill stay on one line */
header a[href="https://ai.openeleph.com"] {
  white-space: nowrap;
}

/* tighten the nav gaps before the logo starts colliding */
@media (max-width: 1180px) {
  header nav {
    gap: 1.5rem !important;
  }
  .logo-slogan {
    font-size: 0.5625rem;
    letter-spacing: 0.16em;
  }
}
@media (max-width: 980px) {
  header nav {
    gap: 1rem !important;
  }
  .logo-mark {
    max-width: 4.4rem;
  }
}
@media (max-width: 420px) {
  .logo-slogan {
    letter-spacing: 0.14em;
  }
  .logo-mark {
    max-width: 3.8rem;
  }
  .logo-word {
    font-size: 0.9375rem;
  }
}

/* ------------------------------------------------ legal footer (ICP 备案) */
.footer-legal {
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(17, 17, 17, 0.07);
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(17, 17, 17, 0.42);
}
.footer-copy {
  margin: 0;
  letter-spacing: 0.01em;
}
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
}

/* the filing badge: visible, legible, obviously clickable — 监管要求 */
.icp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  background: #fff;
  color: rgba(17, 17, 17, 0.62);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease,
    transform 0.2s ease;
}
.icp-badge:hover,
.icp-badge:focus-visible {
  border-color: rgba(17, 17, 17, 0.26);
  color: #111;
  background: #fafafa;
  transform: translateY(-1px);
  outline: none;
}
.icp-badge:focus-visible {
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}
.icp-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.icp-badge:hover .icp-icon,
.icp-badge:focus-visible .icp-icon {
  opacity: 1;
  color: #111;
}
/* public-security filing uses a slightly different tint so the two are distinguishable */
.icp-badge--ps {
  border-color: rgba(21, 87, 168, 0.16);
  color: rgba(21, 87, 168, 0.7);
}
.icp-badge--ps:hover,
.icp-badge--ps:focus-visible {
  border-color: rgba(21, 87, 168, 0.34);
  color: #1557a8;
}
.icp-badge--ps .icp-icon {
  color: #1557a8;
}

@media (max-width: 640px) {
  .footer-legal {
    flex-direction: column;
    gap: 0.6rem;
    padding-bottom: 3.25rem; /* 避开右下角悬浮按钮 */
  }
}

/* language switcher pill */
header button[aria-haspopup="listbox"] .lang-label {
  min-width: 2.6rem;
  text-align: left;
}
header [role="listbox"] button {
  white-space: nowrap;
}

/* active nav underline for the section currently in view */
header nav a.is-active {
  color: #111;
}
header nav a.is-active::after {
  transform: scaleX(1);
}

/* dropdown menus must escape the header shell clipping */
header > div.overflow-visible {
  overflow: visible !important;
}

/* mobile drawer: rounded panel that scrolls if it gets tall */
body > div.fixed.inset-0 > div {
  border-bottom-left-radius: 1.5rem;
  border-bottom-right-radius: 1.5rem;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* showcase marquee cards keep their aspect even before images load */
#gallery .home-gallery-track img {
  background: #f4f2ef;
}
