:root {
  --bg: #1e1e1e;
  --panel: #2a2a2a;
  --ink: #f5f5f5;
  --accent: chartreuse;
  --muted: #bbbbbb;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 24px;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

h1 {
  text-align: center;
  color: var(--accent);
  margin: 0 0 6px;
}
.lead {
  text-align: center;
  color: #dcdcdc;
  margin: 0 0 18px;
}

/* Top demo switcher */
.switcher {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 20px;
}
.switcher button {
  background: var(--accent);
  color: #111;
  border: 0;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.25s;
}
.switcher button:hover {
  transform: scale(1.05);
}
.switcher .ghost {
  background: transparent;
  color: var(--accent);
  outline: 1px solid var(--accent);
}
.switcher .active {
  background: var(--accent);
  color: #111;
  outline: none;
}

/* Workbench: left controls + right output */
.workbench {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 460px) 1fr;
}
@media (max-width: 860px) {
  .workbench {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel);
  border-radius: 12px;
  padding: 16px 16px 12px;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.15);
}
.card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.3px;
}
.group {
  margin: 10px 0 14px;
}
.group p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: bold;
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btns button {
  background: var(--accent);
  color: #111;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}
.btns button:hover {
  transform: scale(1.05);
}
.btns .reset {
  background: transparent;
  color: var(--accent);
  outline: 1px solid var(--accent);
}

/* Output panel */
.output {
  display: grid;
  gap: 10px;
}
.output .stage {
  background: #111;
  border-radius: 12px;
  min-height: 260px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: 1px dashed rgba(128, 255, 128, 0.35);
}
.hint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Flex preview styles */
#flexPreview {
  background: #111;
  border-radius: 10px;
  height: 240px;
  padding: 10px;
  display: flex;
  width: 100%;
  gap: 8px;
  transition: all 0.25s ease;
}
#flexPreview .item {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  font-weight: bold;
  display: grid;
  place-items: center;
  transition: background 0.25s, transform 0.25s, height 0.25s;
}
#flexPreview .item:hover {
  transform: scale(1.06);
}

/* Transform preview styles */
#transformStage {
  perspective: 700px;
  transform-style: preserve-3d;
  display: grid;
  place-items: center;
  width: 100%;
}
#transformBox {
  width: 110px;
  height: 110px;
  border-radius: 10px;
  background: var(--accent);
  color: #111;
  font-weight: bold;
  display: grid;
  place-items: center;
  transition: transform 0.35s ease;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

/* Section visibility */
.section {
  display: none;
}
.section.active {
  display: contents;
} /* keep grid from collapsing */
.stage {
  display: block; /* stops centering the child */
}
