/* ── Technology stack section ─────────────────────────────────── */

.tech-stack {
  position: relative;
  padding: 0 0 clamp(2rem, 4vh, 3rem);
  margin-top: 0;
}

/* About values panel already has a border — avoid a second line above tech stack */
.about + .tech-stack {
  padding-top: clamp(1rem, 2.5vw, 1.5rem);
}

.about + .tech-stack .tech-stack__divider {
  display: none;
}

.tech-stack__divider {
  position: relative;
  height: 1px;
  margin: 0 auto clamp(2rem, 4vh, 2.75rem);
  max-width: min(920px, 88%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(34, 211, 238, 0.45) 22%,
    rgba(59, 130, 246, 0.55) 50%,
    rgba(168, 85, 247, 0.45) 78%,
    transparent 100%
  );
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.18);
}

.tech-stack__divider-glow {
  display: none;
}

.tech-stack__header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(1.5rem, 3vw, 2rem);
  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);
}

.tech-stack.is-visible .tech-stack__header.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tech-stack__eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.tech-stack__heading {
  margin: 0 0 0.75rem;
  font-size: var(--type-subsection-title);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.tech-stack__subtitle {
  margin: 0;
  font-size: var(--type-body-sm);
  line-height: 1.65;
  color: var(--text-secondary);
}

.tech-stack__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.2vw, 0.9rem);
}

.tech-stack__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1.1rem 0.75rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background:
    linear-gradient(155deg, rgba(14, 22, 44, 0.72) 0%, rgba(8, 14, 30, 0.55) 100%);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  transition-delay: var(--reveal-delay, 0s);
}

.tech-stack.is-visible .tech-stack__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tech-stack__item:hover {
  border-color: rgba(var(--tech-rgb), 0.35);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(var(--tech-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tech-stack__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--tech-color);
  background: linear-gradient(145deg, rgba(var(--tech-rgb), 0.22) 0%, rgba(var(--tech-rgb), 0.06) 100%);
  border: 1px solid rgba(var(--tech-rgb), 0.32);
  box-shadow: 0 0 18px rgba(var(--tech-rgb), 0.14);
}

.tech-stack__icon svg {
  width: 22px;
  height: 22px;
}

.tech-stack__name {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.tech-stack__tag {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

/* Brand accents */
.tech-stack__item--dotnet    { --tech-rgb: 81, 43, 212;  --tech-color: #a78bfa; }
.tech-stack__item--webapi    { --tech-rgb: 59, 130, 246;  --tech-color: #93c5fd; }
.tech-stack__item--angular   { --tech-rgb: 221, 0, 49;    --tech-color: #f87171; }
.tech-stack__item--typescript { --tech-rgb: 49, 120, 198; --tech-color: #60a5fa; }
.tech-stack__item--mssql     { --tech-rgb: 204, 41, 39;   --tech-color: #fca5a5; }
.tech-stack__item--mysql     { --tech-rgb: 68, 121, 161;  --tech-color: #7dd3fc; }
.tech-stack__item--flutter   { --tech-rgb: 2, 86, 155;    --tech-color: #67e8f9; }
.tech-stack__item--redis     { --tech-rgb: 220, 56, 45;   --tech-color: #fca5a5; }
.tech-stack__item--linux     { --tech-rgb: 252, 198, 36;  --tech-color: #fde047; }
.tech-stack__item--docker    { --tech-rgb: 36, 150, 237;  --tech-color: #7dd3fc; }

@media (max-width: 1100px) {
  .tech-stack__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tech-stack__header {
    margin-bottom: 1.35rem;
  }

  .tech-stack__heading {
    font-size: clamp(1.35rem, 5vw, 1.65rem);
  }

  .tech-stack__subtitle {
    font-size: 0.86rem;
  }

  .tech-stack__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .tech-stack__item {
    padding: 0.85rem 0.5rem 0.75rem;
    border-radius: 14px;
  }

  .tech-stack__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .tech-stack__icon svg {
    width: 19px;
    height: 19px;
  }

  .tech-stack__name {
    font-size: 0.78rem;
  }

  .tech-stack__tag {
    font-size: 0.62rem;
  }
}

@media (max-width: 480px) {
  .tech-stack__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .tech-stack__item {
    padding: 0.75rem 0.45rem 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-stack__item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
