/* =========================================================================
   SUDOO 布素朵 — Brand Site Stylesheet
   The page is a pixel-faithful reproduction of the approved design slices:
   every section renders the original artwork edge-to-edge, with transparent
   hotspot links/buttons positioned (in percentages) over interactive areas.
   ========================================================================= */

:root {
  --color-primary: #2f934a;
  --color-primary-dark: #21732f;
  --header-h: 60px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.2s;
  --dur-slow: 0.8s;
}

@media (max-width: 859px) {
  :root {
    --header-h: 52px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", "Segoe UI",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  z-index: 1000;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  margin: 0;
}

/* ---------- Slice sections (original artwork, edge to edge) ---------- */
.slice {
  position: relative;
  font-size: 0;
}

.slice img {
  width: 100%;
  height: auto;
}

/* ---------- Sticky header (HTML nav; logo cropped from the original slice) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 clamp(14px, 3.5vw, 60px);
  gap: clamp(14px, 2.5vw, 48px);
  transition: box-shadow var(--dur-fast) var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 2px 14px rgba(20, 30, 22, 0.18);
}

/* The logo occupies x 20.96%–37.89% of the 3840×72 header slice:
   crop box aspect = (0.1693 × 3840) / 72 ≈ 9.03, image shifted left
   by 20.96% of its own width so only the logo region shows */
.site-header__logo {
  display: block;
  height: 58%;
  flex: none;
}

.site-header__logo-crop {
  display: block;
  height: 100%;
  aspect-ratio: 9.03;
  overflow: hidden;
}

.site-header__logo-crop img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translateX(-20.96%);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 44px);
  margin: 0 auto;
}

.site-header__nav a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.02em;
  opacity: 0.92;
  white-space: nowrap;
  transition: opacity var(--dur-fast) var(--ease);
}

.site-header__nav a:hover,
.site-header__nav a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-header__contact {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
  flex: none;
}

.site-header__phone {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-header__phone::before {
  content: "·";
  margin-right: 8px;
  opacity: 0.7;
}

.site-header__cta {
  background: #fff;
  color: var(--color-primary-dark);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(20, 30, 22, 0.2);
}

@media (max-width: 859px) {
  .site-header {
    padding: 0 14px;
  }

  .site-header__nav,
  .site-header__phone {
    display: none;
  }

  .site-header__logo {
    height: 46%;
  }

  .site-header__contact {
    margin-left: auto;
  }

  .site-header__cta {
    padding: 5px 12px;
    font-size: 12px;
  }
}

/* ---------- Transparent hotspots over the artwork ---------- */
.hotspot {
  position: absolute;
  display: block;
}

.hotspot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
  border-radius: 6px;
}

.hotspot--tab:focus-visible {
  outline-color: var(--color-primary-dark);
}

.hotspot--tab {
  border-radius: 50%;
  transition: transform var(--dur-fast) var(--ease);
}

.hotspot--tab:hover {
  transform: translateY(-2px);
}

/* ---------- Carousel (品牌中心 / 材料本源 两屏轮播) ---------- */
.carousel {
  position: relative;
  overflow: hidden;
  font-size: 0;
}

.carousel__track {
  display: flex;
  transition: transform var(--dur-slow) var(--ease);
}

.carousel__slide {
  flex: 0 0 100%;
  width: 100%;
}

.carousel__slide img {
  width: 100%;
  height: auto;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(20, 30, 22, 0.15);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  z-index: 2;
}

.carousel__btn:hover,
.carousel__btn:focus-visible {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.carousel__btn svg {
  width: 20px;
  height: 20px;
}

.carousel__btn--prev {
  left: 14px;
}

.carousel__btn--next {
  right: 14px;
}

.carousel__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  z-index: 2;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0;
  transition: background var(--dur-fast) var(--ease), width var(--dur-fast) var(--ease);
}

.carousel__dot.is-active {
  background: var(--color-primary);
  width: 22px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .carousel__btn {
    width: 32px;
    height: 32px;
  }

  .carousel__btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ---------- Product series carousel (晨/昼/途/夜 滑动切换) ---------- */
.product-carousel .carousel__track {
  align-items: flex-start;
}

.product-slide img {
  width: 100%;
  height: auto;
}

/* The product artwork is mostly white — make idle dots visible on it */
.product-carousel .carousel__dot {
  background: rgba(0, 0, 0, 0.15);
}

.product-carousel .carousel__dot.is-active {
  background: var(--color-primary);
}

.product-carousel .carousel__btn {
  top: 18%;
}

/* ---------- Hero: first viewport fits header + poster exactly ---------- */
.slice--hero {
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

@supports (height: 100svh) {
  .slice--hero {
    height: calc(100svh - var(--header-h));
  }
}

/* Full poster stays visible (contain); the same artwork, blurred and
   scaled up, fills the leftover space as an ambient backdrop */
.slice--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/sections/02-poster.webp") center / cover no-repeat;
  filter: blur(30px);
  transform: scale(1.12);
}

.slice--hero img {
  position: relative;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Narrow screens: show the complete poster at its natural aspect ratio,
   flowing like every other slice (no crop, no ambient fill) */
@media (max-width: 859px) {
  .slice--hero {
    height: auto;
  }

  .slice--hero::before {
    display: none;
  }

  .slice--hero img {
    height: auto;
    object-fit: fill;
  }
}

/* Scroll-down indicator on the hero */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(20, 30, 22, 0.18);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  animation: hero-bounce 2.2s var(--ease) infinite;
  z-index: 2;
}

.hero-scroll:hover,
.hero-scroll:focus-visible {
  background: #fff;
  transform: scale(1.08);
}

.hero-scroll svg {
  width: 22px;
  height: 22px;
}

@keyframes hero-bounce {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: 10px; }
}

/* Narrow screens: hero is not full-height, the indicator has no room */
@media (max-width: 859px) {
  .hero-scroll {
    display: none;
  }
}

/* ---------- Scroll reveal (JS-gated: no-JS keeps content visible) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(20, 30, 22, 0.2);
  opacity: 0;
  visibility: hidden;
  translate: 0 8px;
  transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast),
    translate var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  z-index: 600;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #fff;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

/* ---------- Footer: company + ICP filing info ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 18px;
  padding: 18px 16px;
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
}
