/* =============================================
   sgtvs — Custom Styles v3
   natural-organic design system + timeline-vertical layout
   Botanical Slowness: all transitions 500-700ms ease-in-out
   ============================================= */

/* ------------ Keyframes ------------ */

@keyframes floatLeaf {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-18px) rotate(6deg); }
  50% { transform: translateY(-8px) rotate(-3deg); }
  75% { transform: translateY(-22px) rotate(9deg); }
}

@keyframes floatDot {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
  20% { transform: translate(24px, -16px) scale(1.1); opacity: 0.5; }
  40% { transform: translate(12px, -36px) scale(0.9); opacity: 0.3; }
  60% { transform: translate(-18px, -24px) scale(1.05); opacity: 0.45; }
  80% { transform: translate(-30px, -8px) scale(0.95); opacity: 0.3; }
}

@keyframes growVine {
  0%, 100% { opacity: 0.15; transform: scaleY(0.6); }
  50% { opacity: 0.5; transform: scaleY(1); }
}

@keyframes waveMove {
  0%, 100% { transform: translateX(-3%); opacity: 0.2; }
  50% { transform: translateX(3%); opacity: 0.45; }
}

/* Blob morphing (Organic Morphing rule) */
@keyframes blobMorph {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
  50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
}

@keyframes jump {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ------------ Animation utility classes ------------ */
.animate-leaf { animation: floatLeaf 7s ease-in-out infinite; }
.animate-leaf-1 { animation: floatLeaf 6s ease-in-out infinite; animation-delay: -1s; }
.animate-leaf-2 { animation: floatLeaf 8s ease-in-out infinite; animation-delay: -3s; }
.animate-dot { animation: floatDot 10s ease-in-out infinite; }
.animate-dot-1 { animation: floatDot 9s ease-in-out infinite; animation-delay: -2s; }
.animate-dot-2 { animation: floatDot 11s ease-in-out infinite; animation-delay: -5s; }
.animate-dot-3 { animation: floatDot 8s ease-in-out infinite; animation-delay: -7s; }
.animate-vine { animation: growVine 5s ease-in-out infinite; }
.animate-vine-1 { animation: growVine 4s ease-in-out infinite; animation-delay: -1s; }
.animate-wave { animation: waveMove 13s ease-in-out infinite; }
.animate-wave-1 { animation: waveMove 11s ease-in-out infinite; animation-delay: -4s; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .animate-leaf, .animate-leaf-1, .animate-leaf-2,
  .animate-dot, .animate-dot-1, .animate-dot-2, .animate-dot-3,
  .animate-vine, .animate-vine-1,
  .animate-wave, .animate-wave-1 {
    animation: none !important;
  }
  [data-scroll] {
    opacity: 1 !important;
    transform: none !important;
  }
  .detail-modal-overlay,
  .detail-modal-overlay.active,
  .detail-modal,
  .detail-modal-overlay.active .detail-modal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .toast,
  .toast.visible {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
    transition: none !important;
  }
  .contact-card {
    transition: none !important;
  }
}

/* ---------- Scroll-driven: bidirectional fade (enter + exit) ---------- */
[data-scroll] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out;
}
[data-scroll].visible {
  opacity: 1;
  transform: translateY(0);
}
[data-scroll].exit {
  opacity: 0;
  transform: translateY(-30px);
}

/* ---------- Decorative elements ---------- */
.leaf { pointer-events: none; z-index: 0; }

.dot-decoration {
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  position: absolute;
}

.vine-decoration {
  pointer-events: none;
  z-index: 0;
  position: absolute;
  border-left: 2px solid #a8a29e;
  border-bottom: 2px solid #a8a29e;
  border-radius: 0 0 0 100%;
  opacity: 0.3;
  transform-origin: left top;
}

.wave-decoration {
  pointer-events: none;
  z-index: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 60px;
  opacity: 0.2;
}

/* Blob decorations (Organic Morphing) */
.blob {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: blobMorph 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.blob-1 { animation-delay: -2s; }
.blob-2 { animation-delay: -6s; }

/* Palette swatches */
.palette-swatch {
  display: inline-block;
  border: 1px solid #e7e5e4;
  transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
}
.palette-swatch:hover {
  transform: translateY(-0.125rem) scale(1.1);
  box-shadow: 0 4px 12px rgba(92, 64, 51, 0.2);
}

/* Badges (showcase style) */
.badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  background-color: #8b9d77;
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.5s ease-in-out, transform 0.5s ease-in-out;
}
.badge:hover {
  background-color: #7a8c68;
  transform: translateY(-0.125rem);
}

/* Join card */
.join-card {
  background-color: #faf6f1;
  border-radius: 2rem;
  border: 1px solid #e7e5e4;
}

/* ---------- Body gradient background (smooth section transitions) ---------- */
body {
  background: linear-gradient(180deg, #faf6f1 0%, #fefce8 50%, #fafaf9 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Section backgrounds — transparent to let body gradient show through */
.section-brand,
.section-members,
.section-timeline,
.section-join {
  background-color: transparent;
}

/* ---------- Timeline layout ---------- */

.timeline-container {
  position: relative;
}
.timeline-container::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #d6d3d1;
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-node {
  display: flex;
  position: relative;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.timeline-center {
  flex: 0 0 3rem;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background-color: #8b9d77;
  border: 3px solid #fefce8;
  z-index: 2;
  flex-shrink: 0;
  margin-top: 1.5rem;
  transition: transform 0.5s ease-in-out, background-color 0.5s ease-in-out;
}
.timeline-dot:hover {
  transform: scale(1.3);
  background-color: #5c4033;
}

.timeline-side {
  width: calc(50% - 1.5rem);
  min-width: 0;
}

/* Timeline card — used for both image+text and text-only sides */
.timeline-card {
  overflow: hidden;
  background-color: #faf6f1;
  border-radius: 2rem;
  border: 1px solid #e7e5e4;
  padding: 1.5rem;
  transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out, background-color 0.5s ease-in-out;
}
/* Soft Earth Press: hover sinks slightly + deepens color */
.timeline-card:hover {
  transform: translateY(0.125rem);
  background-color: #f5ede4;
  box-shadow: 0 4px 12px rgba(120, 110, 100, 0.1);
}

/* Verdant Tint: hover text shifts toward deep green */
.timeline-card:hover .timeline-title {
  color: #5c4033;
}

/* Image inside timeline card */
.timeline-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 1.2rem;
  margin-bottom: 0.75rem;
  background-color: #e9e0d4;
}

/* Detailed text card — slightly different bg for visual distinction */
.timeline-card-text {
  background-color: #f5f0ea;
}

/* Year badge */
.timeline-year {
  display: inline-block;
  padding: 0.2rem 1rem;
  background-color: #8b9d77;
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.timeline-title {
  transition: color 0.5s ease-in-out;
}

/* Timeline responsive (mobile: smaller dot, keep two-sided) */
@media (max-width: 767px) {
  .timeline-dot {
    width: 0.875rem;
    height: 0.875rem;
    margin-top: 1.75rem;
  }
}

/* ---------- Members grid ---------- */
.members-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* 行级居中：2 卡 / 1 卡的最后一行居中，3 卡行恰好填满无效果 */
  gap: 16px;
}

.member-card-wrapper {
  flex: 0 0 calc((100% - 32px) / 3);  /* 与 JS cellWidth = (W - 32) / 3 公式一致 */
  display: flex;
  justify-content: center;   /* 卡片在 wrapper 内居中（替代原 justify-self-center 的轨道内居中） */
  align-items: flex-start;   /* 防止 align-items: stretch 将卡片拉伸到上一轮的 wrapper 高度，污染高度测量 */
  overflow: hidden;
  border-radius: 2rem;
}

.member-card-wrapper .member-card {
  flex-shrink: 0;            /* 防止 scale<1 时卡片（280px）被压缩到 cellWidth */
}

/* ---------- Member card (image + text) ---------- */
.member-card {
  width: 280px;
  /* 以 top center 为缩放原点：卡片居中于 wrapper 时，缩放后可视宽度恰为 280*scale = 单元宽，
     不会被 overflow: hidden 裁掉左侧，且宽高比 280:rowMax 在任意缩放比例下保持不变 */
  transform-origin: top center;
  display: flex;
  flex-direction: column;
  background-color: #faf6f1;
  border-radius: 2rem;
  border: 1px solid #e7e5e4;
  overflow: hidden;
  transition: box-shadow 0.5s ease-in-out, background-color 0.5s ease-in-out;
}
/* Soft Earth Press */
.member-card:hover {
  background-color: #f5ede4;
  box-shadow: 0 6px 20px rgba(120, 110, 100, 0.2), 0 2px 8px rgba(120, 110, 100, 0.1);
}
/* Verdant Tint */
.member-card:hover .member-name {
  color: #5c4033;
}

.member-card-img {
  flex: 1 1 auto;
  min-height: 0;
  height: 200px;             /* 固定设计高度：着陆页所有卡片图片均裁剪显示（完整图片仅在点击弹窗中展示） */
  width: 100%;
  object-fit: cover;
  background-color: #e9e0d4;
}

.member-card-body {
  flex: 0 0 auto;
  padding: 1.25rem;
  text-align: center;
}

.member-name {
  transition: color 0.5s ease-in-out;
}

.member-role {
  color: #8b9d77;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.member-desc {
  color: #78716c;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ---------- Brand CTA button ---------- */
.brand-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 500;
  background-color: #8b9d77;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.5s ease-in-out, transform 0.5s ease-in-out;
}
.brand-cta:hover {
  background-color: #7a8c68;
  transform: translateY(-0.125rem);
}
.brand-cta:active {
  transform: scale(0.95);
}

/* ---------- Contact cards grid ---------- */
.contact-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 767px) {
  .contact-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Contact card ---------- */
.contact-card {
  background: #faf6f1;
  border-radius: 2rem;
  border: 1px solid #e7e5e4;
  padding: 1.25rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out, background-color 0.5s ease-in-out;
}
.contact-card:hover {
  transform: translateY(0.125rem);
  background-color: #f5ede4;
  box-shadow: 0 4px 12px rgba(120, 110, 100, 0.1);
}
.contact-card:active {
  transform: scale(0.97);
}
.contact-card-jump {
  animation: jump 0.5s ease-in-out;
}
.contact-card--empty {
  opacity: 0.5;
  cursor: default;
}
.contact-card--empty:hover {
  transform: none;
  background-color: #faf6f1;
  box-shadow: none;
}

.contact-card-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.contact-card-label {
  font-size: 12px;
  color: #78716c;
  margin-bottom: 4px;
}

.contact-card-value {
  font-size: 14px;
  color: #5c4033;
  font-weight: 500;
  word-break: break-all;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #5c4033;
  color: #fff;
  padding: 10px 24px;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Join section ---------- */
.join-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 500;
  background-color: #8b9d77;
  color: white;
  transition: background-color 0.5s ease-in-out, transform 0.5s ease-in-out;
}
.join-cta:hover {
  background-color: #7a8c68;
  transform: translateY(0.125rem);
}
.join-cta:active {
  transform: scale(0.97);
}

/* ---------- Member card: clickable ---------- */
.member-card--clickable {
  cursor: pointer;
}

/* ---------- Member card: no description (taller image) ---------- */
.member-card-body--no-desc {
  padding-top: 1.5rem;
}



/* ---------- Detail modal ---------- */
.detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.detail-modal-overlay.active {
  opacity: 1;
}

.detail-modal {
  background: #faf6f1;
  border-radius: 2rem;
  border: 1px solid #e7e5e4;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}
.detail-modal-overlay.active .detail-modal {
  transform: scale(1);
  opacity: 1;
}

.detail-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #e9e0d4;
  border: none;
  border-radius: 9999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5c4033;
  cursor: pointer;
  z-index: 10;
  transition: background 0.5s ease-in-out, transform 0.5s ease-in-out;
}
.detail-modal-close:hover {
  background: #d4c9bb;
  transform: translateY(-0.125rem);
}
.detail-modal-close:active {
  transform: scale(0.95);
}

.detail-modal-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #e9e0d4;
  border-radius: 2rem 2rem 0 0;
}

.detail-modal-body {
  padding: 1.5rem;
}

.detail-modal-title {
  font-family: ui-serif, Georgia, "Noto Serif SC", serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #5c4033;
  margin-bottom: 4px;
}

.detail-modal-subtitle {
  color: #8b9d77;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.detail-modal-text {
  color: #78716c;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* 完整图片模式：主图不再固定 200px 裁剪，按原比例完整显示（弹窗超高时内部滚动） */
.detail-modal--full-image img.detail-modal-img {
  height: auto;
}

/* 电商详情：正文（保留换行） */
.detail-modal-content {
  white-space: pre-line;
}
.detail-modal-text + .detail-modal-content {
  margin-top: 0.75rem;
}

/* 电商详情：图片2（正文下方，宽 100% 完整显示） */
.detail-modal-img2 {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  margin-top: 1rem;
}

/* ---------- Smooth scroll ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Body width control ---------- */
.content-width {
  max-width: 68ch;
}
