@font-face {
  font-family: Manrope;
  src: url(assets/manrope.ttf) format("truetype");
  font-display: swap;
  font-weight: 200 800;
}
:root {
  color-scheme: dark;
  --bg: #171918;
  --panel: #1c1e1d;
  --line: #353735;
  --text: #f3f0e8;
  --muted: #a4a59e;
  --accent: #e8b783;
  --accent-dark: #3a3026;
  --font: Manrope, "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button {
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.topbar {
  height: 88px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -1.2px;
  line-height: 1.05;
}
.brand-mark {
  font:
    52px/1 Georgia,
    serif;
  color: var(--accent);
}
.brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.7px;
  line-height: 1.8;
}
.header-center {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.2px;
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.text-button:hover {
  color: var(--text);
}
.workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  max-width: 1920px;
  margin: auto;
}
.controls {
  background: var(--panel);
  padding: 25px 25px 24px;
  border-right: 1px solid var(--line);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}
.panel-heading h1 {
  font-size: 17px;
  letter-spacing: -0.5px;
  font-weight: 550;
  margin: 0;
}
.icon-button {
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-button:hover {
  background: #ffffff10;
  color: var(--text);
}
.control-section {
  border-bottom: 1px solid var(--line);
  padding: 20px 0 21px;
}
.control-section h2 {
  font-size: 13px;
  letter-spacing: 0.1px;
  font-weight: 650;
  margin: 0 0 18px;
}
.control-section h2 > span {
  float: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.control {
  margin-top: 16px;
}
.control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #bec0b8;
  margin-bottom: 9px;
  gap: 10px;
}
output {
  font-variant-numeric: tabular-nums;
  color: #e7e5df;
  font-size: 11px;
  background: #292c28;
  padding: 3px 7px;
  border-radius: 4px;
  min-width: 39px;
  text-align: center;
}
input[type="range"] {
  --fill: 0%;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  margin: 12px 0;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--fill),
    #3b3d39 var(--fill) 100%
  );
  border-radius: 5px;
  cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #edc499;
  border: 2px solid #1c1e1d;
  box-shadow: 0 0 0 1px #edc499;
}
input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #edc499;
  border: 2px solid #1c1e1d;
  box-shadow: 0 0 0 1px #edc499;
}
input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}
.range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #92958b;
  margin-top: 8px;
}
.shape-presets {
  display: flex;
  gap: 7px;
}
.shape-presets button {
  font-size: 11px;
  background: #262926;
  color: #aeb1a8;
  padding: 6px 10px;
  border: 1px solid #363a34;
  border-radius: 4px;
}
.shape-presets button.active {
  background: var(--accent-dark);
  color: var(--accent);
  border-color: #776048;
}
.palettes {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 20px;
}
.palette {
  height: 30px;
  flex: 1;
  border-radius: 4px;
  position: relative;
  border: 2px solid var(--panel);
  outline: 1px solid transparent;
}
.palette.active {
  outline-color: var(--accent);
}
.palette:hover {
  transform: translateY(-2px);
}
.copper {
  background: linear-gradient(120deg, #372322, #af693c, #f5d7a5);
}
.tide {
  background: linear-gradient(120deg, #172a38, #287e93, #b3e6d9);
}
.iris {
  background: linear-gradient(120deg, #2c2246, #ac71ab, #f0c3d8);
}
.moss {
  background: linear-gradient(120deg, #192b1b, #748a43, #e4d799);
}
.mono {
  background: linear-gradient(120deg, #282d32, #819296, #eef0e7);
}
.motion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.motion-heading h2 {
  margin: 0;
}
.switch {
  width: 31px;
  height: 18px;
  border-radius: 14px;
  background: #444741;
  padding: 3px;
  transition: background 0.2s;
}
.switch span {
  display: block;
  width: 12px;
  height: 12px;
  background: #d9ddd1;
  border-radius: 50%;
  transition: transform 0.2s;
}
.switch[aria-checked="true"] {
  background: var(--accent);
}
.switch[aria-checked="true"] span {
  background: #282720;
  transform: translateX(13px);
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: #141613;
  padding: 4px;
  border: 1px solid #33362f;
  border-radius: 6px;
}
.segmented button {
  padding: 7px 3px;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.segmented button.active {
  background: #36382f;
  color: var(--text);
}
.render-section {
  border: 0;
  padding-bottom: 20px;
}
.surprise-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #655642;
  border-radius: 5px;
  padding: 11px 8px;
  color: var(--accent);
  background: #292820;
  font-size: 12px;
}
.surprise-button:hover {
  background: #393226;
}
.explorer {
  min-width: 0;
  padding: 24px 26px 25px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 1;
  min-height: 560px;
  background: #101310;
  border: 1px solid #36372f;
  border-radius: 9px;
}
.stage:fullscreen {
  border: 0;
  border-radius: 0;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.stage canvas:active {
  cursor: grabbing;
}
.stage:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #0b100e9c,
    transparent 28%,
    transparent 78%,
    #0b100e9c
  );
  pointer-events: none;
  z-index: 1;
}
.stage-heading {
  position: absolute;
  top: 29px;
  left: 30px;
  pointer-events: none;
  z-index: 2;
}
.fractal-tag {
  font-size: 12px;
  color: #dac9b0;
  margin-bottom: 10px;
}
.stage-heading h2 {
  font-size: 32px;
  font-weight: 450;
  letter-spacing: -1.2px;
  margin: 0;
  line-height: 1.25;
}
.formula {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 19px;
  letter-spacing: 1px;
  color: #acb2a4;
  margin-top: 12px;
}
.stage-tools {
  position: absolute;
  display: flex;
  gap: 5px;
  right: 21px;
  top: 24px;
  z-index: 3;
}
.stage-tools .icon-button,
.view-tools {
  background: #151a17b3;
  border: 1px solid #57605240;
  color: #d0d4c8;
  backdrop-filter: blur(8px);
}
.stage-tools .icon-button {
  width: 35px;
  height: 35px;
}
.view-tools {
  position: absolute;
  right: 23px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px;
  border-radius: 7px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.view-tools > span {
  height: 1px;
  background: #525b4c;
  margin: 1px 6px;
}
.stage-bottom {
  position: absolute;
  bottom: 23px;
  left: 29px;
  right: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  z-index: 3;
  pointer-events: none;
  font-size: 11px;
  color: #c1c8b4;
}
.gesture-hint span {
  color: #6c7463;
  padding: 0 10px;
}
.coordinates {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: #aab39e;
}
.collection {
  flex: none;
}
.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.collection-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.2px;
}
.collection-heading > span {
  font-size: 11px;
  color: #9da295;
}
.fractal-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.fractal-card {
  background: #22251f;
  border: 1px solid #383d32;
  border-radius: 6px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  transition:
    border-color 0.2s,
    transform 0.2s;
  min-width: 0;
}
.fractal-card:hover {
  border-color: #a29275;
  transform: translateY(-3px);
}
.fractal-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.fractal-card img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  display: block;
  background: #161b16;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 12px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.card-dot {
  height: 5px;
  width: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}
.fractal-card.active .card-dot {
  opacity: 1;
}
.fractal-card.active .card-bottom {
  color: var(--accent);
  background: #292b21;
}
#transition-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  object-fit: fill;
}
.mobile-controls {
  display: none;
}
#error {
  position: absolute;
  bottom: 65px;
  left: 25px;
  right: 70px;
  padding: 14px;
  background: #382c21;
  color: #f3d2a9;
  border: 1px solid #816346;
  border-radius: 6px;
  font-size: 13px;
  z-index: 4;
}
dialog {
  max-width: 500px;
  width: calc(100% - 32px);
  background: #20231f;
  color: var(--text);
  border: 1px solid #4b5043;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 25px 100px #0008;
}
dialog::backdrop {
  background: #050905b8;
  backdrop-filter: blur(8px);
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.dialog-heading h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.8px;
  margin: 0;
  max-width: 300px;
}
.dialog-heading button {
  flex: none;
}
dialog p {
  font-size: 14px;
  color: #b9bfb0;
  line-height: 1.7;
}
dl {
  margin: 24px 0;
}
dl div {
  margin-bottom: 18px;
}
dt {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 5px;
}
dd {
  margin: 0;
  font-size: 13px;
  color: #bac0b2;
  line-height: 1.7;
}
.help-note {
  font-size: 12px !important;
}
@media (min-width: 761px) {
  .workspace {
    height: calc(100dvh - 88px);
    min-height: 650px;
  }
  .controls {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #5a5b4c transparent;
  }
  .explorer {
    min-height: 0;
  }
  .stage {
    min-height: 360px;
  }
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .controls {
    padding-left: 30px;
    padding-right: 30px;
  }
  .fractal-card img {
    height: 110px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .controls {
    padding: 22px 20px;
  }
  .explorer {
    padding: 20px;
    gap: 22px;
  }
  .fractal-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .fractal-card img {
    height: 68px;
  }
  .card-bottom {
    padding: 9px 10px;
  }
  .stage-heading {
    top: 24px;
    left: 23px;
  }
  .stage-heading h2 {
    font-size: 28px;
  }
  .stage-tools {
    right: 15px;
    top: 20px;
  }
  .coordinates {
    display: none;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 75px;
    padding: 0 20px;
  }
  .brand {
    font-size: 24px;
  }
  .brand-mark {
    font-size: 45px;
  }
  .brand-sub {
    font-size: 9px;
  }
  .header-center {
    display: none;
  }
  .text-button {
    font-size: 12px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .explorer {
    order: 0;
    padding: 16px;
    gap: 22px;
  }
  .controls {
    order: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 16px 24px;
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 26px;
  }
  .panel-heading {
    grid-column: 1/-1;
    margin-bottom: 0;
  }
  .control-section {
    padding-top: 22px;
  }
  .render-section {
    border-bottom: 1px solid var(--line);
  }
  .surprise-button {
    grid-column: 1/-1;
    margin-top: 22px;
    min-height: 44px;
  }
  .stage {
    flex: none;
    height: 65dvh;
    min-height: 440px;
    max-height: 680px;
  }
  .stage-heading {
    left: 21px;
    top: 23px;
  }
  .stage-heading h2 {
    font-size: 27px;
    max-width: 190px;
  }
  .fractal-tag {
    font-size: 11px;
  }
  .formula {
    font-size: 17px;
  }
  .stage-tools {
    right: 13px;
    top: 17px;
    flex-direction: column;
  }
  .stage-bottom {
    left: 21px;
    bottom: 20px;
    font-size: 10px;
  }
  .gesture-hint {
    font-size: 0;
  }
  .gesture-hint:before {
    content: "Drag to move / Pinch to explore";
    font-size: 10px;
  }
  .gesture-hint span {
    display: none;
  }
  .view-tools {
    right: 13px;
    padding: 3px;
  }
  .view-tools .icon-button {
    width: 36px;
    height: 36px;
  }
  .mobile-controls {
    position: absolute;
    bottom: 53px;
    left: 19px;
    display: flex;
    background: #182018d9;
    color: #d7decf;
    padding: 8px 11px;
    border: 1px solid #535d4660;
    border-radius: 5px;
    z-index: 3;
  }
  .fractal-list {
    gap: 11px;
  }
  .fractal-card img {
    height: 85px;
  }
  .card-bottom {
    font-size: 11px;
    padding: 10px;
  }
  .collection-heading > span {
    font-size: 10px;
  }
  .collection-heading h2 {
    font-size: 13px;
  }
  .control label {
    font-size: 13px;
  }
  .control-section h2 {
    font-size: 14px;
  }
  .range-ends {
    font-size: 11px;
  }
  .palette {
    height: 29px;
  }
  .palettes {
    gap: 6px;
  }
  input[type="range"] {
    height: 5px;
    margin: 18px 0;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
  }
  .segmented button,
  .shape-presets button {
    min-height: 36px;
  }
  .shape-presets {
    gap: 4px;
  }
  .shape-presets button {
    padding: 5px 6px;
    font-size: 10px;
  }
}
@media (max-width: 390px) {
  .controls {
    display: block;
  }
  .panel-heading {
    margin-bottom: 5px;
  }
  .stage-heading h2 {
    font-size: 25px;
  }
  .fractal-card img {
    height: 70px;
  }
  .card-bottom {
    font-size: 10px;
    padding: 9px 7px;
  }
  .collection-heading > span {
    display: none;
  }
  .palettes {
    justify-content: flex-start;
  }
  .palette {
    max-width: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
    animation-duration: 0s !important;
  }
}
