/* ═══════════════════════════════════════════════════════════════
   lab.css — #lab Section Wrapper Styles
   Dileep Kallakuri · dkportfolio
   Explicitly dark-themed — section sits before #systems (dark)
   ═══════════════════════════════════════════════════════════════ */

/* ── SECTION ──────────────────────────────────────────────────── */
.section-lab {
  padding: 7.6rem 6.4vw 7.4rem;
  margin-top: -2.2rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(143, 201, 190, 0.032) 0%, rgba(143, 201, 190, 0) 28%),
    radial-gradient(ellipse at 18% 20%, rgba(210, 186, 143, 0.03) 0%, rgba(210, 186, 143, 0) 22%),
    radial-gradient(ellipse at 82% 14%, rgba(82, 95, 121, 0.05) 0%, rgba(82, 95, 121, 0) 22%),
    linear-gradient(180deg, #2f343d 0%, #242c37 8%, #171f2b 22%, #0f1721 42%, #0a111a 68%, #080c13 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.006) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* top transition wash from the warm about section into the dark lab scene */
.section-lab::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -28%, rgba(248, 239, 226, 0.24) 0%, rgba(248, 239, 226, 0.1) 9%, rgba(248, 239, 226, 0.03) 16%, rgba(248, 239, 226, 0) 24%),
    linear-gradient(180deg, rgba(243, 234, 223, 0.2) 0%, rgba(214, 206, 197, 0.05) 6%, rgba(82, 92, 108, 0.03) 12%, rgba(8, 14, 24, 0) 20%);
  pointer-events: none;
  z-index: 0;
}

.section-lab::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 9rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(143, 201, 190, 0.02) 0%, rgba(143, 201, 190, 0) 28%),
    linear-gradient(180deg, rgba(6, 11, 19, 0) 0%, rgba(6, 11, 19, 0.14) 34%, rgba(7, 12, 20, 0.36) 66%, rgba(7, 12, 20, 0.62) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.lab-header {
  text-align: center;
  margin-bottom: 3.25rem;
  position: relative;
  z-index: 1;
  max-width: 58rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.lab-header::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -1.8rem;
  width: min(94vw, 58rem);
  height: 15rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(8, 14, 24, 0.42) 0%, rgba(8, 14, 24, 0.14) 40%, rgba(8, 14, 24, 0) 72%);
  filter: blur(14px);
  pointer-events: none;
  z-index: -1;
}

.lab-eyebrow {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(210, 186, 143, 0.72);
  margin-bottom: 0.8rem;
  position: relative;
  padding: 0 1.2rem;
}

.lab-eyebrow::before,
.lab-eyebrow::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 2rem;
  height: 1px;
  background: rgba(210, 186, 143, 0.22);
}

.lab-eyebrow::before { right: 100%; }
.lab-eyebrow::after  { left: 100%; }

.lab-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: rgba(247, 246, 242, 0.98);
  margin: 0 0 1.1rem;
  text-shadow: 0 14px 40px rgba(5, 9, 16, 0.34);
}

.lab-header h2 em {
  font-style: italic;
  color: rgba(220, 209, 189, 0.82);
}

.lab-subtext {
  font-family: var(--font-main);
  font-size: clamp(0.92rem, 1.2vw, 1.06rem);
  color: rgba(226, 231, 238, 0.78);
  line-height: 1.68;
  max-width: 32rem;
  margin: 0 auto;
  text-shadow: 0 10px 24px rgba(5, 9, 16, 0.18);
}

/* ── TABS ─────────────────────────────────────────────────────── */
.lab-tabs {
  display: flex;
  justify-content: center;
  gap: 0.14rem;
  margin-bottom: 2.7rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.022));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 0.32rem;
  width: -webkit-fit-content;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
}

.lab-tab {
  padding: 0.58rem 1.46rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(228, 232, 240, 0.54);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.32s ease, color 0.32s ease, box-shadow 0.32s ease, transform 0.32s ease;
  white-space: nowrap;
  outline: none;
  position: relative;
}

.lab-tab:hover {
  color: rgba(244, 246, 250, 0.88);
  background: rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

.lab-tab.active {
  background:
    linear-gradient(180deg, rgba(255, 251, 243, 0.16), rgba(255, 251, 243, 0.07)),
    radial-gradient(circle at 18% 0%, rgba(159, 221, 208, 0.12), rgba(159, 221, 208, 0) 54%);
  color: rgba(251, 248, 243, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.lab-tab.active::after {
  content: '';
  position: absolute;
  inset: auto 20% 0.34rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(159, 221, 208, 0), rgba(159, 221, 208, 0.72), rgba(220, 195, 154, 0));
}

/* ── CONTENT / PANELS ─────────────────────────────────────────── */
.lab-content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 33rem;
  padding: 0.55rem 0 0.2rem;
  isolation: isolate;
}

.lab-content::before {
  content: '';
  position: absolute;
  left: 50%;
  top: .6rem;
  width: min(90vw, 1040px);
  height: 28rem;
  transform: translateX(-50%);
  border-radius: 36px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 249, 238, 0.03) 0%, rgba(255, 249, 238, 0.012) 22%, rgba(143, 201, 190, 0.028) 32%, rgba(143, 201, 190, 0) 64%);
  filter: blur(26px);
  pointer-events: none;
  z-index: 0;
  transition: background .5s cubic-bezier(0.22, 1, 0.36, 1), transform .5s cubic-bezier(0.22, 1, 0.36, 1), filter .5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lab-content::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 0;
  transition: border-color .42s ease, background .42s ease, opacity .42s ease;
}

.lab-content[data-active-panel="terminal"]::before {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 249, 238, 0.04) 0%, rgba(255, 249, 238, 0.016) 22%, rgba(143, 201, 190, 0.04) 32%, rgba(143, 201, 190, 0) 64%);
}

.lab-content[data-active-panel="sql-console"]::before {
  background:
    radial-gradient(ellipse at 46% 38%, rgba(255, 249, 238, 0.03) 0%, rgba(255, 249, 238, 0.012) 18%, rgba(210, 186, 143, 0.042) 30%, rgba(210, 186, 143, 0) 60%);
}

.lab-content[data-active-panel="arch-playground"]::before {
  background:
    radial-gradient(ellipse at 52% 36%, rgba(255, 249, 238, 0.026) 0%, rgba(255, 249, 238, 0.01) 18%, rgba(138, 160, 204, 0.04) 30%, rgba(138, 160, 204, 0) 60%);
}

.lab-content[data-active-panel="terminal"]::after {
  border-color: rgba(255, 255, 255, 0.035);
}

.lab-content[data-active-panel="sql-console"]::after,
.lab-content[data-active-panel="arch-playground"]::after {
  border-color: rgba(255, 255, 255, 0.028);
}

/* Hidden panels: completely out of flow */
.lab-panel {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.996);
  filter: blur(4px);
  transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), filter 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.34s;
}

.lab-panel::before {
  content: '';
  position: absolute;
  inset: -1.25rem -1rem auto;
  height: 8rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity .38s ease;
}

.lab-panel[hidden] {
  display: block !important;
}

/* Active panel: visible with a quick fade-up */
.lab-panel.active {
  position: relative;
  z-index: 1;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: opacity 0.44s cubic-bezier(0.22, 1, 0.36, 1), transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), filter 0.44s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.lab-panel.active::before {
  opacity: 1;
}

@keyframes labPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 680px) {
  .section-lab {
    padding: 6rem 5vw 5.9rem;
    margin-top: -1.5rem;
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  }
  .section-lab::after {
    height: 6.2rem;
  }
  .section-lab::before {
    background:
      radial-gradient(ellipse at 50% -20%, rgba(248, 239, 226, 0.28) 0%, rgba(248, 239, 226, 0.14) 10%, rgba(248, 239, 226, 0.04) 18%, rgba(248, 239, 226, 0) 30%),
      linear-gradient(180deg, rgba(243, 234, 223, 0.28) 0%, rgba(202, 199, 205, 0.08) 7%, rgba(80, 92, 120, 0.04) 13%, rgba(8, 14, 24, 0) 22%);
  }
  .lab-header::before {
    top: -1.5rem;
    width: min(96vw, 40rem);
    height: 13rem;
    filter: blur(12px);
  }
  .lab-tabs {
    gap: 0;
    padding: 0.22rem;
  }
  .lab-content::before {
    width: min(94vw, 680px);
    height: 19rem;
    top: 1rem;
    filter: blur(20px);
  }
  .lab-content {
    min-height: 31rem;
  }
  .lab-tab {
    padding: 0.45rem 0.9rem;
    font-size: 0.76rem;
  }
  .lab-eyebrow::before,
  .lab-eyebrow::after { width: 1rem; }
}

@media (max-width: 480px) {
  .lab-tabs {
    width: 100%;
    -webkit-width: 100%;
    justify-content: stretch;
  }
  .lab-content {
    min-height: 28rem;
  }
  .lab-tab {
    flex: 1;
    text-align: center;
    padding: 0.42rem 0.4rem;
    font-size: 0.72rem;
  }
}
