:root {
  color-scheme: dark;
  --bg: #101722;
  --panel: #151e2b;
  --line: #2a3646;
  --text: #eef3f6;
  --muted: #9cabbc;
  --accent: #a4d7e1;
  --ink: #09101a;
  --radius: 16px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:hover {
  filter: brightness(1.15);
}
button:active {
  filter: brightness(0.9);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 23px;
  letter-spacing: -1px;
  font-weight: 600;
  white-space: nowrap;
}
.brand svg {
  height: 36px;
  width: 36px;
  stroke: var(--accent);
  stroke-width: 1.35;
}
.brand-period {
  color: var(--accent);
}
.header-divider {
  height: 23px;
  width: 1px;
  background: var(--line);
}
.header-label {
  font-size: 13px;
  color: var(--muted);
}
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 23px;
  align-items: center;
}
.quiet-button {
  background: none;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
}
.help-icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
}
.export-button {
  border: 1px solid #405062;
  background: #202d3d;
  border-radius: 8px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  min-height: 44px;
}
.workspace {
  max-width: 1920px;
  margin: auto;
  padding: 26px 28px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}
.explorer {
  min-width: 0;
}
.viewport {
  position: relative;
  height: calc(100dvh - 303px);
  min-height: 400px;
  max-height: 1000px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #060d17;
  border: 1px solid #293747;
  isolation: isolate;
}
.viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
#fractal {
  touch-action: none;
  cursor: grab;
}
#fractal:active {
  cursor: grabbing;
}
#transition {
  pointer-events: none;
  opacity: 0;
}
.scene-title {
  position: absolute;
  top: 30px;
  left: 32px;
  pointer-events: none;
  text-shadow: 0 2px 18px #000;
}
.scene-category {
  font-size: 12px;
  color: #afc1d1;
  margin-bottom: 7px;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.8px;
  font-weight: 400;
  margin: 0 0 12px;
  line-height: 1.1;
}
.formula {
  color: #acc4d4;
  font-family: Georgia, serif;
  font-size: 21px;
  font-style: italic;
}
.icon-button {
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
  border-radius: 8px;
}
.fullscreen {
  position: absolute;
  right: 22px;
  top: 23px;
  background: #152030a6;
  border: 1px solid #ffffff15;
}
.canvas-bottom {
  position: absolute;
  bottom: 22px;
  left: 26px;
  right: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  gap: 10px;
}
.canvas-bottom > span {
  font-size: 12px;
  color: #bacbd9;
  text-shadow: 0 1px 5px #000;
}
#zoom-readout {
  min-width: 70px;
  font-variant-numeric: tabular-nums;
}
.gesture-hint span {
  margin: 0 9px;
  color: #70899f;
}
.view-tools {
  display: flex;
  border: 1px solid #425267;
  background: #152030e8;
  border-radius: 10px;
  pointer-events: auto;
  box-shadow: 0 6px 20px #0003;
}
.view-tools button {
  background: none;
  border: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  font-size: 22px;
}
.view-tools button + button {
  border-left: 1px solid #364355;
}
.view-tools svg {
  width: 17px;
  height: 17px;
}
.collection-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 13px;
}
.collection-heading h2 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.collection-heading > span {
  font-size: 12px;
  color: var(--muted);
}
.fractal-collection {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.fractal-card {
  position: relative;
  padding: 0;
  text-align: left;
  background: #182332;
  border: 1px solid #303d4e;
  border-radius: 10px;
  overflow: hidden;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.fractal-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: #26394a;
  box-shadow: 0 0 0 1px var(--accent);
}
.fractal-card canvas {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}
.card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  font-size: 12px;
}
.selected-mark {
  width: 14px;
  height: 14px;
  border: 1px solid #687d91;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: transparent;
}
.fractal-card[aria-pressed="true"] .selected-mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 15px 23px 22px;
  align-self: start;
}
.settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: -10px;
}
.settings h2 {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.3px;
  margin: 0;
}
.settings h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.control-section {
  padding: 23px 0 19px;
  border-bottom: 1px solid var(--line);
}
.control-section h3 {
  margin-bottom: 23px;
}
.slider-control {
  margin-top: 19px;
}
.slider-control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #b6c3d1;
  margin-bottom: 10px;
  gap: 8px;
}
.slider-control output {
  color: #e0eaf2;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.slider-control input {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  --fill: 30%;
}
.slider-control input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--accent) var(--fill),
    #3b495c var(--fill)
  );
}
.slider-control input::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d6e8ee;
  margin-top: -4.5px;
  box-shadow: 0 0 0 3px #151e2b;
}
.slider-control input::-moz-range-track {
  height: 3px;
  background: #3b495c;
}
.slider-control input::-moz-range-progress {
  height: 3px;
  background: var(--accent);
}
.slider-control input::-moz-range-thumb {
  height: 12px;
  width: 12px;
  background: #d6e8ee;
  border: 0;
  border-radius: 50%;
}
.slider-control input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-row h3 {
  margin: 0;
}
.section-row > span {
  font-size: 12px;
  color: var(--muted);
}
.palettes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  margin: 18px 0 22px;
}
.palette {
  height: 32px;
  border: 3px solid var(--panel);
  outline: 1px solid #465365;
  border-radius: 50%;
  padding: 0;
  position: relative;
}
.palette[aria-pressed="true"] {
  outline: 2px solid var(--accent);
}
.palette[aria-pressed="true"]:after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  text-shadow: 0 1px 4px black;
  font-size: 13px;
}
.motion-section {
  padding: 18px 0;
}
.toggle {
  width: 34px;
  height: 20px;
  border: 1px solid #506071;
  background: #344253;
  border-radius: 20px;
  position: relative;
  padding: 2px;
}
.toggle span {
  display: block;
  width: 14px;
  height: 14px;
  background: #c0cbd4;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle[aria-checked="true"] {
  background: #618997;
  border-color: #7fb5c1;
}
.toggle[aria-checked="true"] span {
  transform: translateX(13px);
  background: #effaff;
}
.render-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 21px 0;
  font-size: 12px;
  color: #b6c3d1;
}
.render-section select {
  border: 1px solid #405064;
  background: #202c3b;
  border-radius: 6px;
  padding: 7px;
  color: #dfe9f1;
  max-width: 135px;
  font-size: 12px;
}
.surprise-button {
  width: 100%;
  border: 1px solid #465b6e;
  border-radius: 8px;
  background: #283b4d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-size: 13px;
}
.surprise-button svg {
  width: 17px;
  height: 17px;
}
.error {
  position: absolute;
  bottom: 80px;
  left: 20px;
  right: 20px;
  padding: 16px;
  background: #362020;
  border: 1px solid #b77373;
  border-radius: 8px;
  font-size: 13px;
}
.viewport:fullscreen {
  max-height: none;
  height: 100dvh;
  border: 0;
  border-radius: 0;
}
.viewport:fullscreen .scene-title {
  top: 40px;
  left: 40px;
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid #43566d;
  border-radius: 18px;
  padding: 32px;
  width: min(480px, calc(100% - 32px));
  box-shadow: 0 30px 100px #0009;
}
dialog::backdrop {
  background: #030a14bb;
}
dialog h2 {
  font-size: 25px;
  letter-spacing: -0.7px;
  font-weight: 500;
  margin: 8px 0 28px;
}
.close-dialog {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 26px;
}
dl {
  margin: 0;
}
dl div + div {
  margin-top: 20px;
}
dt {
  font-size: 14px;
  font-weight: 600;
}
dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
[hidden] {
  display: none !important;
}
.scene-title {
  isolation: isolate;
}
.scene-title::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -32px -80px -45px -32px;
  background: radial-gradient(
    ellipse at 20% 25%,
    #061323ed 0%,
    #061323a6 40%,
    transparent 72%
  );
}
.palette {
  height: 40px;
}
.canvas-bottom::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -26px -26px -22px;
  background: linear-gradient(transparent, #06132399);
  pointer-events: none;
}
.canvas-bottom {
  isolation: isolate;
}
@media (min-width: 1450px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 30px 36px;
  }
  .settings {
    padding-left: 26px;
    padding-right: 26px;
  }
  .viewport {
    height: calc(100dvh - 323px);
  }
  .fractal-card canvas {
    height: 90px;
  }
  .topbar {
    padding: 0 40px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 275px;
    gap: 16px;
    padding: 20px;
  }
  .settings {
    padding-left: 18px;
    padding-right: 18px;
  }
  .gesture-hint {
    display: none;
  }
  .scene-title {
    left: 24px;
  }
  .card-label {
    font-size: 11px;
    padding: 10px 8px;
  }
  .fractal-collection {
    gap: 8px;
  }
  .selected-mark {
    display: none;
  }
  .header-label {
    display: none;
  }
  .header-divider {
    display: none;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 76px;
    padding: 0 18px;
    gap: 10px;
  }
  .brand {
    font-size: 21px;
    gap: 9px;
  }
  .brand svg {
    width: 29px;
    height: 29px;
  }
  .header-actions {
    gap: 9px;
  }
  .desktop-label {
    display: none;
  }
  .quiet-button {
    min-width: 32px;
    justify-content: center;
  }
  .export-button {
    padding: 10px 12px;
    font-size: 12px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 24px;
  }
  .viewport {
    height: 54dvh;
    min-height: 360px;
    max-height: 600px;
  }
  .scene-title {
    top: 24px;
    left: 24px;
  }
  h1 {
    font-size: 36px;
  }
  .fullscreen {
    right: 14px;
    top: 16px;
  }
  .canvas-bottom {
    left: 20px;
    right: 20px;
    bottom: 18px;
  }
  .collection-heading {
    margin-top: 22px;
  }
  .collection-heading > span {
    display: none;
  }
  .fractal-collection {
    grid-template-columns: repeat(5, 130px);
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin: 0 -2px;
    scroll-snap-type: x proximity;
  }
  .fractal-card {
    scroll-snap-align: start;
  }
  .fractal-card canvas {
    height: 70px;
  }
  .card-label {
    font-size: 12px;
    padding: 10px;
  }
  .selected-mark {
    display: grid;
  }
  .settings {
    width: 100%;
    padding: 16px 24px 24px;
  }
  .settings-heading h2 {
    font-size: 18px;
  }
  .control-section {
    padding: 24px 0;
  }
  .slider-control {
    margin-top: 24px;
  }
  .slider-control label {
    font-size: 14px;
  }
  .slider-control input {
    height: 26px;
  }
  .settings h3 {
    font-size: 14px;
  }
  .palette {
    width: 44px;
    height: 44px;
    justify-self: center;
  }
  .toggle {
    height: 26px;
    width: 44px;
  }
  .toggle span {
    width: 20px;
    height: 20px;
  }
  .toggle[aria-checked="true"] span {
    transform: translateX(17px);
  }
  .toggle:before {
    content: "";
    position: absolute;
    inset: -9px 0;
  }
  .render-section {
    font-size: 14px;
  }
  .render-section select {
    min-height: 44px;
  }
  .surprise-button {
    min-height: 48px;
  }
  .view-tools button {
    height: 44px;
  }
}
@media (max-width: 760px) {
  html {
    scroll-padding-top: calc(42dvh + 24px);
  }
  .explorer {
    display: contents;
  }
  .viewport {
    position: sticky;
    top: 8px;
    z-index: 3;
    height: 42dvh;
    min-height: 280px;
    max-height: 360px;
    flex-shrink: 0;
    box-shadow: 0 0 0 8px var(--bg);
  }
  .collection-heading {
    margin: 0 0 -10px;
  }
  .fractal-collection {
    flex-shrink: 0;
  }
  .settings {
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
