/* ===== Labs / Index ===== */
:root {
  --li-bg-deep: #0E0B26;
  --li-bg-mid:  #16123A;
  --li-text:    #EDE9FE;
  --li-muted:   rgba(237, 233, 254, 0.62);
  --li-faint:   rgba(237, 233, 254, 0.36);
  --li-line:    rgba(237, 233, 254, 0.10);
  --li-line-strong: rgba(237, 233, 254, 0.18);
  --li-violet:  #9B6EF3;
  --li-blue:    #4F8EF7;
  --li-pink:    #C084FC;
  --li-glow:    rgba(155, 110, 243, 0.35);
}

.labs-index {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79, 142, 247, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(192, 132, 252, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, var(--li-bg-deep) 0%, var(--li-bg-mid) 100%);
  color: var(--li-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
}

/* Two slow-drifting aurora blobs and a barely-perceptible breathing veil
   keep the page alive without competing with content. */
.labs-index::before,
.labs-index::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  will-change: transform;
}
.labs-index::before {
  width: 70vmax;
  height: 70vmax;
  top: -25vmax;
  left: -15vmax;
  background: radial-gradient(circle, rgba(79, 142, 247, 0.22) 0%, rgba(79, 142, 247, 0.08) 35%, transparent 65%);
  animation: li-aurora-a 38s ease-in-out infinite;
}
.labs-index::after {
  width: 60vmax;
  height: 60vmax;
  bottom: -22vmax;
  right: -12vmax;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.20) 0%, rgba(155, 110, 243, 0.06) 40%, transparent 65%);
  animation: li-aurora-b 52s ease-in-out infinite;
}
.labs-index > * {
  position: relative;
  z-index: 1;
}

@keyframes li-aurora-a {
  0%   { transform: translate3d(0, 0, 0)        scale(1); }
  33%  { transform: translate3d(8vw, 6vh, 0)    scale(1.10); }
  66%  { transform: translate3d(-4vw, 10vh, 0)  scale(0.96); }
  100% { transform: translate3d(0, 0, 0)        scale(1); }
}
@keyframes li-aurora-b {
  0%   { transform: translate3d(0, 0, 0)        scale(1); }
  40%  { transform: translate3d(-9vw, -7vh, 0)  scale(1.08); }
  75%  { transform: translate3d(5vw, -3vh, 0)   scale(0.94); }
  100% { transform: translate3d(0, 0, 0)        scale(1); }
}

/* Re-skin the standard nav for the dark studio backdrop. */
.labs-index nav {
  background: transparent;
  border-bottom: 1px solid transparent;
}
.labs-index nav.scrolled {
  background: rgba(14, 11, 38, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--li-line);
}
.labs-index .nav-links a { color: var(--li-text); opacity: 0.78; }
.labs-index .nav-links a:hover { opacity: 1; }
.labs-index .nav-cta {
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.45);
}

.li-stage {
  flex: 1 1 auto;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 7rem 6% 5rem;
}

/* ===== Hero ===== */
.li-hero {
  margin-bottom: 3.2rem;
}
.li-breadcrumb {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--li-blue), var(--li-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.li-breadcrumb a {
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  padding-bottom: 1px;
  background: linear-gradient(135deg, var(--li-blue), var(--li-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter 0.25s ease, border-bottom-color 0.25s ease;
}
.li-breadcrumb a:hover {
  filter: brightness(1.2);
  border-bottom-color: rgba(155, 110, 243, 0.5);
}
.li-title {
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 200;
  letter-spacing: -2px;
  line-height: 1;
}
.li-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--li-muted);
  max-width: 56ch;
  margin: 0;
}

/* ===== Project list ===== */
.li-projects {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.li-project {
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--li-line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.li-project:hover {
  border-color: var(--li-line-strong);
  background: rgba(255, 255, 255, 0.028);
  box-shadow: 0 12px 40px -12px var(--li-glow);
}
.li-project.is-expanded {
  border-color: var(--li-line-strong);
  background: rgba(255, 255, 255, 0.032);
  box-shadow: 0 16px 60px -16px var(--li-glow);
}

.li-project-head {
  width: 100%;
  display: block;
  padding: 1.4rem 1.6rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.li-project-head:focus-visible {
  outline: 2px solid var(--li-violet);
  outline-offset: 2px;
  border-radius: 12px;
}

.li-project-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--li-faint);
  margin-bottom: 0.4rem;
}
.li-project-title {
  margin: 0 0 0.5rem;
  font-size: 1.55rem;
  font-weight: 300;
  letter-spacing: -0.5px;
  color: var(--li-text);
  line-height: 1.2;
}
.li-project-teaser {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--li-muted);
  max-width: 60ch;
}

.li-project-toggle {
  margin-top: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--li-line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--li-text);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.li-project-toggle-label {
  white-space: nowrap;
}
.li-project-toggle-icon {
  flex-shrink: 0;
  transition: transform 0.4s ease;
}
.li-project:hover .li-project-toggle {
  background: rgba(155, 110, 243, 0.14);
  border-color: var(--li-violet);
  color: #fff;
}
.li-project:hover .li-project-toggle-icon {
  transform: translateY(1px);
}
.li-project.is-expanded .li-project-toggle {
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.22), rgba(155, 110, 243, 0.28));
  border-color: var(--li-violet);
  color: #fff;
}
.li-project.is-expanded .li-project-toggle-icon {
  transform: rotate(180deg);
}

/* ===== Expanded body ===== */
.li-project-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.li-project-body[hidden] {
  display: block; /* the controller manages hidden state itself */
}
.li-project-body-inner {
  padding: 0 1.6rem 1.8rem;
  border-top: 1px solid var(--li-line);
  margin-top: 0.2rem;
}

.li-project-prose {
  padding-top: 1.4rem;
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--li-muted);
  max-width: 64ch;
}
.li-project-prose p {
  margin: 0 0 1rem;
}
.li-project-prose p:last-of-type {
  margin-bottom: 0;
}
.li-project-coda {
  margin-top: 1.6rem !important;
  font-style: italic;
  color: var(--li-text);
  opacity: 0.78;
  letter-spacing: 0.2px;
}

.li-project-actions {
  margin-top: 1.6rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.li-project-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--li-text);
  background: linear-gradient(135deg, var(--li-blue), var(--li-violet));
  box-shadow: 0 6px 20px -6px var(--li-glow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  border: 1px solid transparent;
}
.li-project-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px -8px var(--li-glow);
}
.li-project-cta svg {
  transition: transform 0.25s ease;
}
.li-project-cta:hover svg {
  transform: translateX(2px);
}
.li-project-cta-secondary {
  background: rgba(155, 110, 243, 0.08);
  border-color: var(--li-line-strong);
  color: rgba(237, 233, 254, 0.85);
  box-shadow: none;
}
.li-project-cta-secondary:hover {
  background: rgba(155, 110, 243, 0.18);
  border-color: var(--li-violet);
  color: var(--li-text);
  box-shadow: 0 6px 20px -8px var(--li-glow);
}

.li-project-prose strong {
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--li-text);
  background: linear-gradient(135deg, var(--li-blue), var(--li-violet), var(--li-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Empty hint ===== */
.li-empty-hint {
  margin-top: 1rem;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--li-faint);
  text-align: center;
}

/* ===== Footer recolor ===== */
.labs-index footer {
  background: transparent;
  border-top: 1px solid var(--li-line);
  margin-top: 3rem;
}

/* ===== Mobile ===== */
@media (max-width: 700px) {
  .li-stage { padding: 5.5rem 5% 3rem; }
  .li-hero { margin-bottom: 2.4rem; }
  .li-project-head { padding: 1.1rem 1.2rem; }
  .li-project-title { font-size: 1.3rem; }
  .li-project-teaser { font-size: 0.9rem; }
  .li-project-body-inner { padding: 0 1.2rem 1.4rem; }
  .li-project-prose { font-size: 0.92rem; }
  .li-project-toggle { padding: 0.5rem 0.9rem; font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .li-project,
  .li-project-body,
  .li-project-toggle,
  .li-project-toggle-icon,
  .li-project-cta { transition: none; }
  .labs-index::before,
  .labs-index::after { animation: none; }
}
