/* ===================================================
   Nano-Tech "Why YiLian" Section
   Light background · Hex wave alternating layout
   =================================================== */

/* ── Section Container ── */
.section-nano {
  position: relative;
  background: transparent;
  overflow: hidden;
  padding: var(--space-2xl) 0 calc(var(--space-2xl) + 40px);
}

/* ── Background Image (no overlay) ──
   NOTE: this file lives at assets/css/, so assets/ is one level up:
   ../images/nano-bg.png.jpg resolves to assets/images/nano-bg.png.jpg. */
.section-nano::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../images/nano-bg.png.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
.nano-header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 80px;
  padding: 0 40px;
}

.section-nano .section-label {
  color: var(--brand-500);
  border-color: var(--brand-200);
}

.section-nano h2 {
  color: var(--brand-600);
}

/* ==========================================
   Wave Layout — flex wrap + translateY offset
   Items alternate high / low / high / low
   ========================================== */

.nano-grid {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  padding: 0 40px;
  margin: 0 auto;
}

/* 6 items spread across full width */
.nano-item {
  text-align: center;
  transition: transform var(--dur-med) var(--ease-out);
  width: 16%;
  min-width: 180px;
  flex-shrink: 0;
}

/* ── Rounded card ── */
.nano-item .nano-card {
  background: #ffffff;
  border: 1px solid rgba(200, 200, 200, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 28px 20px 24px;
  transition: all var(--dur-med) var(--ease-out);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Dramatic wave offset ── */
/* Items 1,3,5 — shifted far UP */
.nano-item:nth-child(odd) {
  transform: translateY(-60px);
}

/* Items 2,4,6 — shifted far DOWN */
.nano-item:nth-child(even) {
  transform: translateY(60px);
}

.nano-item:hover {
  transform: translateY(-12px);
}
.nano-item:nth-child(odd):hover {
  transform: translateY(calc(-60px + -12px));
}
.nano-item:nth-child(even):hover {
  transform: translateY(calc(60px + -12px));
}
.nano-item:hover .nano-card {
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.15);
  border-color: var(--brand-200);
}

/* ── Icon ── */
.nano-hex {
  margin: 0 auto 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nano-hex i,
.nano-hex svg {
  font-size: 3.0rem;
  color: var(--brand-500);
  transition: all var(--dur-med) ease;
}

.nano-item:hover .nano-hex i,
.nano-item:hover .nano-hex svg {
  color: var(--brand-600);
  transform: scale(1.15);
}

/* ── Typography (dark text) ── */
.nano-item h4 {
  font-family: var(--alt);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Accent line under title */
.nano-item h4::after {
  content: '';
  display: block;
  width: 26px;
  height: 2px;
  background: var(--brand-300);
  margin: 8px auto 0;
  border-radius: 2px;
  transition: width var(--dur-med) ease;
}

.nano-item:hover h4::after {
  width: 44px;
  background: var(--brand-500);
}

.nano-item p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #999999;
  margin: 0 auto;
  max-width: 260px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .nano-grid {
    padding: 0 24px;
    gap: 30px;
  }
  .nano-item {
    width: 28%;
    min-width: 180px;
  }
  /* Column-based wave: col1↑ col2↓ col3↑ — same column same direction, no cross-row overlap */
  .nano-item:nth-child(3n+1) {
    transform: translateY(-15px);
  }
  .nano-item:nth-child(3n+2) {
    transform: translateY(15px);
  }
  .nano-item:nth-child(3n+3) {
    transform: translateY(-15px);
  }
  .nano-item:hover {
    transform: translateY(-8px);
  }
  .nano-item:nth-child(3n+1):hover {
    transform: translateY(calc(-15px + -8px));
  }
  .nano-item:nth-child(3n+2):hover {
    transform: translateY(calc(15px + -8px));
  }
  .nano-item:nth-child(3n+3):hover {
    transform: translateY(calc(-15px + -8px));
  }
}

@media (max-width: 768px) {
  .nano-grid {
    padding: 0 20px;
    justify-content: center;
    gap: 24px;
  }
  .nano-item {
    width: calc(50% - 30px);
    min-width: 140px;
    margin: 0;
  }
  /* Column-based wave: col1↑ col2↓ — same column same direction, no cross-row overlap */
  .nano-item:nth-child(2n+1) {
    transform: translateY(-10px);
  }
  .nano-item:nth-child(2n+2) {
    transform: translateY(10px);
  }
  .nano-item:hover {
    transform: translateY(-6px);
  }
  .nano-item:nth-child(2n+1):hover {
    transform: translateY(calc(-10px + -6px));
  }
  .nano-item:nth-child(2n+2):hover {
    transform: translateY(calc(10px + -6px));
  }
}

@media (max-width: 500px) {
  .nano-grid {
    padding: 0 16px;
    max-width: 380px;
    margin: 0 auto;
  }
  .nano-item {
    width: 100%;
    min-width: 0;
    max-width: 320px;
  }
  .nano-item:nth-child(odd),
  .nano-item:nth-child(even) {
    transform: translateY(0);
  }
  .nano-header {
    margin-bottom: 50px;
  }
}
