/* Working stack section — designed to match the existing Gabriella portfolio. */
.stack-section {
  order: 3;
  position: relative;
  padding: clamp(4.75rem, 8vw, 8rem) clamp(1.5rem, 7vw, 7rem);
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 14%, rgba(217, 212, 237, .32), transparent 27%),
    radial-gradient(circle at 10% 88%, rgba(246, 196, 176, .28), transparent 28%),
    linear-gradient(180deg, #fff9f5 0%, #fffdf9 100%);
}

.stack-section::after {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  right: -8rem;
  bottom: -11rem;
  border: 1px solid rgba(195, 113, 126, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 3.5rem rgba(217, 212, 237, .12), 0 0 0 7rem rgba(246, 196, 176, .09);
  pointer-events: none;
}

.stack-intro,
.stack-grid {
  position: relative;
  z-index: 1;
}

.stack-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .55fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.stack-kicker {
  margin: 0 0 1.1rem;
  color: var(--rose-deep);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.stack-title {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 6.6vw, 7.2rem);
  font-weight: 500;
  letter-spacing: -.075em;
  line-height: .84;
}

.stack-title em {
  color: var(--rose);
  font-weight: 500;
}

.stack-copy {
  max-width: 390px;
  margin: 0 0 .3rem;
  color: #65565c;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.7;
}

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

.stack-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 112px;
  padding: 1.25rem 1.3rem;
  border: 1px solid rgba(195, 113, 126, .2);
  border-radius: 1.2rem;
  background: rgba(255, 253, 249, .76);
  box-shadow: 0 10px 28px rgba(143, 83, 96, .055);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.stack-card:nth-child(2),
.stack-card:nth-child(5) {
  background: rgba(237, 210, 195, .34);
}

.stack-card:nth-child(3),
.stack-card:nth-child(6) {
  background: rgba(217, 212, 237, .28);
}

.stack-card:hover {
  transform: translateY(-4px);
  border-color: rgba(195, 113, 126, .42);
  background: #fffdf9;
  box-shadow: 0 16px 34px rgba(143, 83, 96, .1);
}

.stack-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 83, 96, .24);
  border-radius: 14px;
  background: rgba(255, 253, 249, .75);
  color: var(--rose-deep);
}

.stack-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stack-card-copy {
  min-width: 0;
}

.stack-card h3 {
  margin: 0 0 .28rem;
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
}

.stack-card p {
  margin: 0;
  color: #75666b;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.5;
}

html.dark .stack-section {
  background:
    radial-gradient(circle at 88% 14%, rgba(104, 92, 148, .18), transparent 27%),
    radial-gradient(circle at 10% 88%, rgba(213, 138, 152, .14), transparent 28%),
    linear-gradient(180deg, #241d22 0%, #2a2026 100%);
}

html.dark .stack-copy,
html.dark .stack-card p {
  color: #d9bdc4;
}

html.dark .stack-card,
html.dark .stack-card:nth-child(2),
html.dark .stack-card:nth-child(3),
html.dark .stack-card:nth-child(5),
html.dark .stack-card:nth-child(6) {
  border-color: rgba(240, 169, 180, .18);
  background: rgba(42, 32, 38, .76);
}

html.dark .stack-card:hover {
  border-color: rgba(240, 169, 180, .4);
  background: #30252b;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .18);
}

html.dark .stack-icon {
  border-color: rgba(240, 169, 180, .24);
  background: rgba(31, 24, 29, .55);
  color: var(--rose-deep);
}

@media (max-width: 980px) {
  .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .stack-section { padding: 4.5rem 1.25rem; }
  .stack-intro { grid-template-columns: 1fr; gap: 1.4rem; margin-bottom: 2.4rem; }
  .stack-title { font-size: clamp(3.1rem, 14vw, 4.7rem); }
  .stack-copy { max-width: 330px; font-size: .84rem; }
  .stack-grid { grid-template-columns: 1fr; gap: .8rem; }
  .stack-card { min-height: 96px; padding: 1rem; grid-template-columns: 44px minmax(0, 1fr); gap: .85rem; border-radius: 1rem; }
  .stack-icon { width: 44px; height: 44px; border-radius: 12px; }
  .stack-card h3 { font-size: .86rem; }
  .stack-card p { font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .stack-card { transition: none; }
  .stack-card:hover { transform: none; }
}
