/* Profile Studio page. Builds on css/style.css (panels, inputs, the GitHub style preview). */

.studio {
  padding-bottom: 72px;
}

.studio-intro {
  padding: 28px 0 26px;
  max-width: 820px;
}

.studio-title {
  margin: 0 0 14px;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.studio-lede {
  margin: 0;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.6;
}

/* Two columns: controls on the left, a large preview that stays in view on the right. */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.st-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.st-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.st-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.st-load {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.st-load .select {
  grid-column: 1 / -1;
}

.st-load .input,
.st-load .button {
  height: 44px;
}

.st-status {
  margin: -4px 0 0;
}

.st-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.st-color {
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

/* Sections list */
.st-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.st-section.is-on {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.st-section.is-open {
  box-shadow: 0 10px 26px -20px color-mix(in srgb, var(--accent) 70%, transparent);
}

.st-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
}

/* A small switch instead of a plain checkbox. */
.st-toggle {
  position: relative;
  display: inline-flex;
  flex: none;
  cursor: pointer;
}

.st-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.st-toggle input::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.st-toggle input:checked {
  background: var(--accent);
}

.st-toggle input:checked::after {
  transform: translateX(14px);
}

.st-toggle input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.st-section-name {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.st-section:not(.is-on) .st-section-name {
  color: var(--muted);
}

.st-section-name::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s ease;
}

.st-section.is-open .st-section-name::after {
  transform: rotate(225deg) translateY(-1px);
}

.st-move {
  display: inline-flex;
  gap: 2px;
}

.st-arrow {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.st-arrow:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.st-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.st-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 14px 16px;
  animation: st-open 0.25s ease;
}

@keyframes st-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.st-editor .textarea {
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: 13.5px;
  line-height: 1.5;
}

.st-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.check.is-off {
  opacity: 0.45;
}

.st-source {
  align-self: flex-start;
}

.st-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.st-pane[hidden] {
  display: none;
}

.st-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.st-drop:hover,
.st-drop.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}

.st-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.st-drop-text {
  font-weight: 600;
}

.param output {
  margin-left: 6px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* Output column */
.studio-output {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.st-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 14px;
}

.st-files[hidden] {
  display: none;
}

.st-files p {
  flex: 1 1 280px;
  margin: 0;
}

.st-file-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-empty {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1000px) {
  .studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-output {
    position: static;
  }
}

@media (max-width: 600px) {
  .st-checks {
    grid-template-columns: minmax(0, 1fr);
  }
}
