/* —— Sumu SPA —— 纸感 / 网格 / 无物理分割线 —— */
:root {
  --paper: #ffffff;
  --paper-alt: #f9f9f9;
  --ink: #333333;
  --accent-sage: #e15a24;
  --accent-slate: #4a5568;
  --line: rgba(51, 51, 51, 0.18);
  --header-glass: rgba(255, 255, 255, 0.72);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.35s;
}

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

html {
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

html.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--paper);
  transition: background-color 0.6s var(--ease-out);
}

body.lang-flash {
  background-color: var(--paper-alt);
}

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

/* —— Sticky header —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    background 0.45s var(--ease-out),
    backdrop-filter 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out);
}

.site-header.is-scrolled {
  background: var(--header-glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(51, 51, 51, 0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  display: block;
  height: auto;
  max-height: 70px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav-link {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-slate);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: translateX(-50%) scaleX(1);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.lang-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.2rem;
  opacity: 0.45;
  transition:
    opacity 0.25s ease,
    color 0.25s ease;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  opacity: 0.85;
}

.lang-btn.active {
  opacity: 1;
  color: var(--accent-sage);
}

.lang-sep {
  font-size: 0.7rem;
  opacity: 0.35;
  user-select: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  margin-left: auto;
  transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
}

.site-header.nav-open .nav-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  /*
   * 滚动后顶栏带 backdrop-filter 时，会为子级 position:fixed 建立「包含块」，
   * 全屏 .site-nav 会被压进顶栏高度，只能看到第一项。菜单打开时关闭顶栏毛玻璃。
   */
  .site-header.nav-open,
  .site-header.nav-open.is-scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--paper);
    box-shadow: none;
  }

  .site-header.nav-open .header-inner {
    overflow: visible;
  }

  .site-header.nav-open .logo-link,
  .site-header.nav-open .nav-toggle {
    position: relative;
    z-index: 120;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 110;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    /* 首帧即锁满视口高度，避免先按「内容高度」排版再拉高造成两段显示 */
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    max-height: 100vh;
    max-height: 100dvh;
    max-height: 100svh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(1.25rem, 4vh, 2rem);
    padding: max(1.25rem, env(safe-area-inset-top, 0px))
      max(1.5rem, env(safe-area-inset-right, 0px))
      max(1.25rem, env(safe-area-inset-bottom, 0px))
      max(1.5rem, env(safe-area-inset-left, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* 不透明白底，避免透视到底层与未铺满的错觉 */
    background-color: var(--paper);
    background-image: linear-gradient(var(--paper), var(--paper));
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    /* 关闭时淡出；visibility 延后去掉以免打断 opacity 过渡 */
    transition:
      opacity 0.22s var(--ease-out),
      visibility 0s linear 0.22s;
  }

  /* 打开：不参与淡入，整页菜单一次成型（避免 opacity 渐变时像「先出一行再展开」） */
  .site-header.nav-open .site-nav {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0s, visibility 0s;
  }

  .site-nav .nav-link {
    font-size: 1rem;
    flex-shrink: 0;
  }

  .lang-switch {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 0.5rem;
    flex-shrink: 0;
  }
}

/* —— Hero —— */
.hero-flow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(5rem, 12vh, 8rem) 0 clamp(4rem, 10vh, 7rem);
  overflow: hidden;
  background-color: var(--paper);
}

/* 上下各占 50%；底图无磨砂，整体 80% 不透明度（opacity: 0.8） */
.hero-bg-split {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.hero-bg-split__half {
  position: relative;
  flex: 1 1 50%;
  min-height: 0;
  overflow: hidden;
}

.hero-bg-split__media {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.8;
}

.hero-bg-split__half--top .hero-bg-split__media {
  background-image: url("../images/back.png");
  background-position: center top;
}

.hero-bg-split__half--bottom .hero-bg-split__media {
  background-image: url("../images/back2.png");
  background-position: center top;
}

/* 上下拼接处淡化中线 */
.hero-bg-split::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: clamp(48px, 12vh, 120px);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 11;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 2rem);
  background-color: #ffffff;
}

.hero-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 5vw + 1rem, 3.75rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.15;
  color: var(--ink);
  text-shadow:
    0 0.08em 0.22em rgba(51, 51, 51, 0.12),
    0 0.02em 0.06em rgba(51, 51, 51, 0.08);
  animation: hero-in 1.1s var(--ease-out) both;
  animation-delay: 0.12s;
}

/* 中文主标题在窄屏（如 iPhone）单行显示，按视口压缩字号 */
@media (max-width: 480px) {
  html[lang^="zh"] .hero-title {
    white-space: nowrap;
    letter-spacing: 0.06em;
    font-size: min(1.85rem, calc((100vw - 2.75rem) / 11));
  }
}

.hero-sub {
  margin: 0;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  letter-spacing: 0.04em;
  line-height: 1.85;
  color: var(--ink);
  opacity: 0.88;
  text-shadow:
    0 0.06em 0.18em rgba(51, 51, 51, 0.1),
    0 0.015em 0.05em rgba(51, 51, 51, 0.06);
  animation: hero-in 1.15s var(--ease-out) both;
  animation-delay: 0.35s;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Section rhythm —— */
main {
  position: relative;
  z-index: 1;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(4.5rem, 14vw, 9rem) clamp(1.5rem, 5vw, 3rem);
}

/* —— Scroll ornament line —— */
.section-ornament {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem);
}

.ornament-line {
  display: block;
  height: 1px;
  background: var(--line);
  width: 0;
  margin: 0 auto;
  transition: width 1.1s var(--ease-out);
}

.section-ornament.is-visible .ornament-line {
  width: 100%;
}

/* —— About: diagonal shards + asymmetric rhythm —— */
.about-editorial {
  display: flex;
  flex-direction: column;
  gap: clamp(2.75rem, 7vw, 5.5rem);
}

.about-band {
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(1.25rem, 4vw, 3rem);
}

.about-band--body {
  grid-template-columns: minmax(0, 0.44fr) minmax(0, 0.56fr);
}

.about-band--lead > .about-band__copy--year {
  grid-column: 1;
}

.about-band--lead > .about-shard--diag-r {
  grid-column: 2;
  min-width: 0;
}

.about-band__copy--year {
  padding-right: clamp(0, 2vw, 1rem);
  display: flex;
  align-items: center;
}

.about-band__copy--body {
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  max-width: 36em;
  justify-self: start;
  display: flex;
  align-items: center;
}

.about-year {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.05;
  color: var(--ink);
}

.about-text {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.85;
  color: var(--ink);
  opacity: 0.92;
}

.about-shard {
  margin: 0;
  position: relative;
  isolation: isolate;
  align-self: stretch;
  /* 明确高度，避免 grid 内 height:100% 塌缩导致图片不可见 */
  min-height: clamp(200px, 30vw, 340px);
  height: clamp(200px, 30vw, 340px);
}

.about-shard__inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  transform: translateZ(0);
}

/* Diagonal crop + soft edge into paper */
.about-shard--diag-r .about-shard__inner {
  -webkit-clip-path: polygon(16% 0, 100% 0, 100% 100%, 0% 90%);
  clip-path: polygon(16% 0, 100% 0, 100% 100%, 0% 90%);
}

.about-shard--diag-l .about-shard__inner {
  -webkit-clip-path: polygon(0 0, 100% 10%, 84% 100%, 0 100%);
  clip-path: polygon(0 0, 100% 10%, 84% 100%, 0 100%);
}

.about-shard__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  /* 仅轻扫斜边，避免整幅被不透明白盖住 */
  opacity: 0.55;
}

/* Feather along diagonal seams（diag-r 略弱，避免盖住主体） */
.about-shard--diag-r .about-shard__inner::after {
  opacity: 0.35;
  background: linear-gradient(
    128deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 18%,
    rgba(255, 255, 255, 0) 36%
  );
}

.about-shard--diag-l .about-shard__inner::after {
  background: linear-gradient(
    308deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.18) 15%,
    rgba(255, 255, 255, 0) 34%
  );
}

.about-shard img {
  /* 流式占位 + cover，避免仅 absolute 时个别环境下宽度塌成 0 */
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .about-band,
  .about-band--body {
    grid-template-columns: 1fr;
    gap: clamp(1.75rem, 5vw, 2.5rem);
  }

  .about-band--lead .about-shard {
    order: 1;
  }

  .about-band--lead .about-band__copy--year {
    order: 0;
  }

  .about-band__copy--body {
    justify-self: start;
    padding-left: 0;
  }

  .about-shard--diag-r .about-shard__inner {
    -webkit-clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 94%);
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 94%);
  }

  .about-shard--diag-l .about-shard__inner {
    -webkit-clip-path: polygon(0 0, 100% 6%, 90% 100%, 0 100%);
    clip-path: polygon(0 0, 100% 6%, 90% 100%, 0 100%);
  }

  .about-shard {
    min-height: clamp(200px, 48vw, 280px);
    height: clamp(200px, 48vw, 280px);
  }
}

/* —— Products —— */
.products {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 12vw, 7rem);
}

.product-card {
  position: relative;
}

.product-name {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.product-visual {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 21 / 9;
  max-height: min(52vh, 420px);
}

.product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.75s var(--ease-out);
}

.product-card:hover .product-visual img,
.product-card:focus-within .product-visual img {
  transform: scale(1.05);
}

.product-detail {
  margin: 0;
  padding-top: 1rem;
  font-weight: 300;
  font-size: 0.9375rem;
  line-height: 1.8;
  max-width: 40em;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.45s var(--ease-out),
    max-height 0.55s var(--ease-out),
    transform 0.45s var(--ease-out);
}

.product-card:hover .product-detail,
.product-card:focus-within .product-detail {
  opacity: 1;
  max-height: 14rem;
  transform: translateY(0);
}

@media (hover: none) {
  .product-detail {
    opacity: 0.92;
    max-height: none;
    transform: none;
    padding-top: 1rem;
  }
}

/* —— Footer / Contact —— */
.footer-contact {
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 8vw, 5rem);
  align-items: end;
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

.footer-brand {
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: var(--ink);
}

.footer-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.1vw, 1rem);
}

.footer-link {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.35s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #888888;
}

.footer-address {
  margin: 0;
  line-height: 1.85;
  max-width: 28em;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid transparent;
}

.copyright {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.lang-switch--footer .lang-btn {
  font-size: 0.6875rem;
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Back to top —— */
.back-to-top {
  position: fixed;
  z-index: 90;
  right: max(3rem, env(safe-area-inset-right, 0px) + 0.35rem);
  bottom: max(1rem, env(safe-area-inset-bottom, 0px) + 0.35rem);
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--header-glass);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(51, 51, 51, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.35s var(--ease-out),
    visibility 0.35s var(--ease-out),
    transform 0.35s var(--ease-out),
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: rgba(138, 154, 91, 0.55);
  color: var(--accent-sage);
  box-shadow: 0 4px 18px rgba(51, 51, 51, 0.08);
}

.back-to-top:focus-visible {
  outline: 1px solid var(--accent-slate);
  outline-offset: 3px;
}

.back-to-top__icon {
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1;
}

@media (max-width: 768px) {
  body:has(.site-header.nav-open) .back-to-top.is-visible {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition-duration: 0.01ms;
  }
}

/* —— CTA accent (optional hooks) —— */
.btn-accent {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-slate);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

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