:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  color: #271b36;
  background: #fbfaff;
  font-synthesis: none;
  --text-muted: #665b74;
  --line: #e8e1ef;
  --accent: #6335c4;
  --accent-dark: #5125ab;
  --tint: #f2ebff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible,
.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

.masthead {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.masthead-inner,
.page {
  width: min(100% - 3rem, 74rem);
  margin-inline: auto;
}

.masthead-inner {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  gap: .65rem;
  align-items: center;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -.035em;
}

.page { padding-block: 2.8rem 3.5rem; }
.intro { margin-block-end: 1.85rem; }

.intro h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.65rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.06em;
}

.intro p {
  margin: .75rem 0 0;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: #fff;
  box-shadow: 0 2px 4px #36204a07, 0 12px 28px #36204a06;
}

.card-heading {
  display: flex;
  min-height: 2.65rem;
  gap: .5rem;
  justify-content: space-between;
  align-items: center;
  margin-block-end: .9rem;
}

.card-heading h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -.035em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: .68rem;
  padding: .45rem .85rem;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 700;
}

.button svg,
.tab svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:disabled { opacity: .55; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-secondary { color: #432961; border-color: var(--line); background: #fff; }
.button-secondary:hover:not(:disabled) { background: var(--tint); }
.button-quiet { color: var(--text-muted); background: transparent; padding-inline: .55rem; }
.button-quiet:hover:not(:disabled) { color: var(--accent-dark); background: var(--tint); }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1.4;
  border: 1px solid #e6dcfa;
  border-radius: .95rem;
  background-color: #efe8ff;
  background-image: radial-gradient(#d9cdf4 1px, transparent 1px);
  background-size: 16px 16px;
}

.stage-decoration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portrait {
  position: absolute;
  inset: 4% 9% 0;
}

.portrait svg { display: block; width: 100%; height: 100%; }

.export-row {
  display: flex;
  gap: .65rem 1rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-block-start: 1rem;
}

.export-row p,
.status {
  margin: 0;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.5;
}

.export-row p span { margin-inline: .15rem; }
.status { margin-block-start: .6rem; color: #91273e; }

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .25rem;
  padding: .28rem;
  background: #f7f4fb;
  border: 1px solid #ede6f3;
  border-radius: .85rem;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 3.45rem;
  padding: .35rem .1rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  background: transparent;
  color: #5d516d;
  font-size: .875rem;
  font-weight: 650;
}

.tab:hover { background: #eee6f8; }
.tab[aria-selected="true"] {
  background: #fff;
  color: var(--accent-dark);
  border-color: #e7dcf9;
  box-shadow: 0 1px 3px #3b255616;
}

.panel { padding-block-start: 1.35rem; }
.group { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.group + .group { margin-block-start: 1.4rem; }
.group legend { margin-block-end: .65rem; padding: 0; font-size: .95rem; font-weight: 750; }
.colour-name { padding-inline-start: .35rem; font-size: .875rem; font-weight: 500; color: var(--text-muted); }

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

.options:has(.choice:nth-child(4)):not(:has(.choice:nth-child(5))) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: .25rem;
  padding: .4rem .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #fdfbff;
  color: #51445f;
  text-align: center;
  cursor: pointer;
}

.choice:hover { border-color: #b49bde; }
.choice:has(input:checked) {
  background: var(--tint);
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.option-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 3.25rem;
}

.option-art svg { display: block; width: 100%; max-width: 4rem; height: 100%; }
.option-name { font-size: .875rem; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }

.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.choice.colour-choice { width: 2.65rem; height: 2.65rem; padding: .25rem; border-radius: 50%; background: #fff; }
.swatch { flex: 1; width: 100%; border: 1px solid #2c213526; border-radius: 50%; background: var(--swatch); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 52rem) {
  #panel-face .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-face .option-art { height: 4.2rem; }
}

@media (max-width: 51.999rem) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .page, .masthead-inner { width: min(100% - 2rem, 37rem); }
  .page { padding-top: 1.9rem; }
}

@media (max-width: 34rem) {
  .page, .masthead-inner { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.65rem; }
  .intro { margin-block-end: 1.3rem; }
  .intro p { font-size: 1rem; }
  .card { padding: .85rem; border-radius: 1rem; }
  .stage { aspect-ratio: 1.2; }
  .option-name { font-size: .8125rem; }
}
