:root {
  --ink: #f7f3ff;
  --muted: #9a91ac;
  --soft: #6f677e;
  --line: rgba(232, 223, 255, 0.11);
  --line-strong: rgba(232, 223, 255, 0.18);
  --panel: rgba(18, 16, 30, 0.78);
  --panel-solid: #151222;
  --panel-deep: #0e0d18;
  --violet: #a791ff;
  --violet-bright: #c2b7ff;
  --orange: #ff9b67;
  --cyan: #65e2d3;
  --lime: #c7ef8d;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 5%, rgba(85, 56, 177, 0.13), transparent 25rem),
    radial-gradient(circle at 9% 86%, rgba(19, 118, 117, 0.09), transparent 30rem),
    #0a0912;
  color: var(--ink);
  letter-spacing: -0.01em;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.08;
}

.ambient-one {
  top: 28%;
  right: -13rem;
  background: #805ef6;
}

.ambient-two {
  bottom: -15rem;
  left: 21%;
  background: #1eaba4;
}

.motion-on .ambient-one {
  animation: drift-one 18s ease-in-out infinite alternate;
}

.motion-on .ambient-two {
  animation: drift-two 24s ease-in-out infinite alternate;
}

@keyframes drift-one {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-32px, 24px, 0) scale(1.08); }
}

@keyframes drift-two {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(42px, -18px, 0) scale(0.95); }
}

.page-shell {
  position: relative;
  width: min(100% - 56px, 1560px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-style: italic;
  letter-spacing: -0.07em;
}

.brand-divider {
  width: 1px;
  height: 16px;
  margin-left: 4px;
  background: var(--line-strong);
}

.brand-subtitle {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-orbit {
  position: relative;
  display: inline-block;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(199, 239, 141, 0.8);
  border-radius: 50%;
  transform: rotate(-30deg);
}

.brand-orbit::before,
.brand-orbit::after {
  position: absolute;
  inset: 4px -5px;
  border: 1px solid rgba(101, 226, 211, 0.7);
  border-radius: 50%;
  content: "";
}

.brand-orbit::after {
  inset: 10px 1px;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255, 155, 103, 0.7);
  transform: rotate(30deg);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 21px;
}

.live-pill,
.topbar-stat,
.stage-overline,
.section-kicker,
.eyebrow,
.insight-label,
.canvas-topline,
.canvas-bottomline,
.keyboard-strip,
.range-hint,
.rail-version {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lime);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(199, 239, 141, 0.08), 0 0 12px rgba(199, 239, 141, 0.8);
}

.topbar-stat {
  display: flex;
  gap: 7px;
  color: var(--muted);
}

.stat-label {
  color: var(--soft);
}

.icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button:hover {
  border-color: rgba(167, 145, 255, 0.65);
  background: rgba(167, 145, 255, 0.1);
  color: var(--violet-bright);
}

.icon-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(270px, 316px) minmax(0, 1fr);
  gap: clamp(40px, 5.5vw, 100px);
  padding: 67px 0 54px;
}

.control-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.intro-block {
  max-width: 290px;
}

.eyebrow,
.section-kicker,
.insight-label {
  color: var(--violet);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
}

.eyebrow-line {
  width: 23px;
  height: 1px;
  background: var(--violet);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(35px, 3.2vw, 50px);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

h1 em {
  color: var(--orange);
  font-style: italic;
}

.intro-copy {
  max-width: 265px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.control-section {
  border-top: 1px solid var(--line);
}

.fractal-section {
  margin-top: 46px;
  padding-top: 19px;
}

.tuning-section {
  margin-top: 31px;
  padding-top: 19px;
}

.palette-section {
  margin-top: 31px;
  padding-top: 19px;
}

.section-heading {
  margin-bottom: 17px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.fractal-list {
  display: grid;
  gap: 3px;
}

.fractal-card {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 9px 10px 9px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.fractal-card:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  transform: translateX(2px);
}

.fractal-card.is-active {
  border-color: rgba(167, 145, 255, 0.2);
  background: linear-gradient(90deg, rgba(167, 145, 255, 0.13), rgba(167, 145, 255, 0.035));
  color: var(--ink);
}

.fractal-card.is-active::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: -1px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255, 155, 103, 0.6);
  content: "";
}

.fractal-glyph {
  display: block;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(205, 192, 255, 0.33);
  border-radius: 50%;
  background-color: #2c2641;
  background-image: radial-gradient(circle at 65% 39%, #ffb07b 0 3%, transparent 4%), radial-gradient(circle at 30% 64%, #9f7cf4 0 14%, transparent 15%), linear-gradient(135deg, #1b1830, #6353a7 56%, #ff8f68);
  opacity: 0.85;
}

.glyph-julia {
  border-radius: 42% 58% 49% 51% / 50% 42% 58% 50%;
  background-image: radial-gradient(ellipse at 35% 65%, #68e3cb 0 7%, transparent 8%), radial-gradient(ellipse at 72% 37%, #ef7a9d 0 9%, transparent 10%), linear-gradient(45deg, #1a1935, #49649f 48%, #cda1e8);
}

.glyph-ship {
  border-radius: 38% 62% 44% 56% / 46% 40% 60% 54%;
  background-image: linear-gradient(145deg, transparent 35%, #ff9b67 36% 47%, transparent 48%), linear-gradient(25deg, #171629, #c05f6e 48%, #f5c582);
}

.glyph-tricorn {
  background-image: radial-gradient(ellipse at 50% 38%, #ead284 0 6%, transparent 7%), conic-gradient(from 35deg, #17142b, #6558c2, #df7687, #17142b);
}

.glyph-newton {
  border-radius: 49% 51% 51% 49% / 40% 56% 44% 60%;
  background-image: radial-gradient(circle at 27% 28%, #f4c56e 0 7%, transparent 8%), radial-gradient(circle at 67% 29%, #6ce2ce 0 8%, transparent 9%), radial-gradient(circle at 49% 77%, #f07c94 0 9%, transparent 10%), #252040;
}

.glyph-carpet {
  border-radius: 4px;
  background-image: linear-gradient(90deg, transparent 28%, #bc9cff 29% 32%, transparent 33% 64%, #bc9cff 65% 68%, transparent 69%), linear-gradient(0deg, transparent 28%, #bc9cff 29% 32%, transparent 33% 64%, #bc9cff 65% 68%, transparent 69%);
}

.fractal-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fractal-card-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fractal-card-copy small {
  overflow: hidden;
  color: var(--soft);
  font-size: 9px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fractal-card-index {
  align-self: start;
  padding-top: 3px;
  color: var(--soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.range-row {
  margin-top: 20px;
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.range-label label,
.range-label output {
  color: var(--muted);
  font-size: 10px;
}

.range-label output {
  color: var(--violet-bright);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  display: block;
  width: 100%;
  height: 3px;
  margin: 0;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(167, 145, 255, 0.72) 0%, rgba(167, 145, 255, 0.72) 50%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.1) 100%);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  appearance: none;
  border: 2px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 0 1px rgba(195, 183, 255, 0.5), 0 0 10px rgba(167, 145, 255, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 0 1px rgba(195, 183, 255, 0.5), 0 0 10px rgba(167, 145, 255, 0.4);
}

.range-hint {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--soft);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 10px;
  margin-top: 25px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-ui {
  position: relative;
  width: 25px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 180ms ease, border-color 180ms ease;
}

.toggle-ui::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soft);
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.toggle-control input:checked + .toggle-ui {
  border-color: rgba(101, 226, 211, 0.4);
  background: rgba(101, 226, 211, 0.14);
}

.toggle-control input:checked + .toggle-ui::after {
  background: var(--cyan);
  transform: translateX(11px);
  box-shadow: 0 0 8px rgba(101, 226, 211, 0.6);
}

.toggle-control input:checked ~ span:last-child {
  color: var(--ink);
}

.palette-grid {
  display: flex;
  gap: 9px;
}

.palette-chip {
  position: relative;
  width: 37px;
  height: 27px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease;
}

.palette-chip:hover {
  transform: translateY(-2px);
}

.palette-chip.is-active {
  border-color: var(--ink);
}

.palette-chip span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

.palette-aurora span { background: linear-gradient(90deg, #171330, #6e4bbb 43%, #5ad6d0 72%, #f1d277); }
.palette-ember span { background: linear-gradient(90deg, #18121d, #7c3261 43%, #f26558 72%, #f8cd7a); }
.palette-mono span { background: linear-gradient(90deg, #11111a, #5f638c 47%, #e3daf5); }
.palette-tide span { background: linear-gradient(90deg, #111b2e, #216e8a 46%, #6ed6c2 77%, #d6e9c2); }
.palette-candy span { background: linear-gradient(90deg, #201737, #ad5ca6 45%, #f691a9 75%, #f3d68f); }

.rail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
  transition: color 180ms ease;
}

.text-button:hover {
  color: var(--orange);
}

.button-icon {
  color: var(--orange);
  font-size: 13px;
  vertical-align: -1px;
}

.rail-version {
  color: var(--soft);
  font-size: 7px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.explorer-stage {
  min-width: 0;
}

.stage-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 25px;
}

.stage-overline {
  display: flex;
  gap: 9px;
  margin-bottom: 11px;
  color: var(--soft);
  font-size: 8px;
}

.stage-overline span:first-child {
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

.overline-slash {
  color: var(--line-strong);
}

.stage-heading h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 43px);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.stage-heading h2 span {
  color: var(--violet);
  font-style: italic;
}

.stage-description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.stage-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.outline-button,
.primary-button,
.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.outline-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.outline-button:hover {
  border-color: rgba(199, 239, 141, 0.4);
  color: var(--lime);
  transform: translateY(-1px);
}

.outline-button svg,
.reset-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.primary-button {
  border: 1px solid rgba(255, 155, 103, 0.65);
  background: var(--orange);
  color: #20131b;
  box-shadow: 0 6px 16px rgba(255, 155, 103, 0.12);
}

.primary-button:hover {
  background: #ffb287;
  transform: translateY(-1px);
}

.primary-button.is-playing {
  border-color: rgba(101, 226, 211, 0.72);
  background: var(--cyan);
}

.play-icon {
  font-size: 8px;
}

.canvas-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(13, 12, 22, 0.94);
  box-shadow: var(--shadow);
}

.canvas-topline,
.canvas-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 17px;
  color: var(--soft);
  font-size: 8px;
}

.canvas-topline {
  border-bottom: 1px solid rgba(232, 223, 255, 0.07);
}

.canvas-coord,
.canvas-mode,
.zoom-readout,
.render-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.canvas-mode {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.status-separator {
  color: var(--soft);
}

.coord-dot {
  width: 5px;
  height: 5px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(101, 226, 211, 0.8);
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 900 / 620;
  background: #11101e;
  cursor: grab;
  isolation: isolate;
}

.canvas-wrap.is-dragging {
  cursor: grabbing;
}

#fractalCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  transform: scale(1);
}

.canvas-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(7, 6, 13, 0.24) 100%), linear-gradient(90deg, rgba(7, 6, 13, 0.12), transparent 14%, transparent 86%, rgba(7, 6, 13, 0.12));
}

.canvas-corner {
  position: absolute;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-color: rgba(199, 239, 141, 0.68);
  pointer-events: none;
}

.canvas-corner-tl {
  top: 15px;
  left: 15px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.canvas-corner-br {
  right: 15px;
  bottom: 15px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.canvas-hint {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 4;
  color: rgba(247, 243, 255, 0.52);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.canvas-hint.is-hidden {
  opacity: 0;
}

.mouse-icon {
  margin-right: 5px;
  color: var(--cyan);
  font-size: 12px;
  vertical-align: -1px;
}

.hint-separator {
  padding: 0 7px;
  color: var(--orange);
}

.canvas-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) translateY(5px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.canvas-loading.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.loading-ring {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.canvas-wrap.fractal-switch {
  animation: fractal-switch 700ms cubic-bezier(0.22, 0.8, 0.25, 1);
}

@keyframes fractal-switch {
  0% { opacity: 0.68; transform: scale(0.992); filter: saturate(1.35) brightness(1.2); }
  58% { opacity: 1; transform: scale(1.003); filter: saturate(1.1) brightness(1.04); }
  100% { opacity: 1; transform: scale(1); filter: saturate(1) brightness(1); }
}

.canvas-bottomline {
  min-height: 47px;
  border-top: 1px solid rgba(232, 223, 255, 0.07);
}

.zoom-readout,
.render-readout {
  min-width: 76px;
  color: var(--soft);
}

.zoom-readout strong,
.render-readout strong {
  color: var(--violet-bright);
  font-weight: 600;
  letter-spacing: 0;
}

.canvas-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.round-button {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.round-button:hover {
  border-color: var(--cyan);
  background: rgba(101, 226, 211, 0.1);
  color: var(--cyan);
}

.reset-button {
  min-height: 23px;
  padding: 0 7px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.reset-button:hover {
  color: var(--ink);
}

.insight-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.insight-card {
  min-height: 105px;
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(20, 18, 31, 0.58);
}

.insight-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.insight-mark {
  color: var(--soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.insight-card p {
  margin-bottom: 0;
  color: var(--soft);
  font-size: 9px;
  line-height: 1.4;
}

.formula {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: -0.04em;
}

.formula sub,
.formula sup {
  color: var(--orange);
  font-size: 10px;
}

.coordinate-values {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.telemetry-values {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
}

.telemetry-values div {
  display: grid;
  gap: 3px;
}

.telemetry-values strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.telemetry-values span {
  color: var(--soft);
  font-size: 8px;
  text-transform: uppercase;
}

.keyboard-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 23px;
  color: var(--soft);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.keyboard-label {
  color: var(--orange);
  letter-spacing: 0.18em;
}

kbd {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  margin: 0 3px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-bottom-color: rgba(232, 223, 255, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-family: inherit;
  font-size: 8px;
  letter-spacing: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(6, 5, 11, 0.68);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.help-modal {
  position: relative;
  width: min(100%, 390px);
  padding: 35px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: modal-in 280ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.help-modal h2 {
  margin-bottom: 27px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.07em;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 155, 103, 0.12);
  color: var(--orange);
}

.shortcut-list {
  display: grid;
  gap: 11px;
  color: var(--muted);
  font-size: 11px;
}

.shortcut-list div {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-list strong {
  margin-left: auto;
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 1050px) {
  .app-grid {
    grid-template-columns: minmax(240px, 285px) minmax(0, 1fr);
    gap: 38px;
  }

  .intro-block {
    max-width: 270px;
  }

  h1 {
    font-size: 38px;
  }

  .toggle-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 32px, 680px);
  }

  .topbar {
    min-height: 68px;
  }

  .brand-subtitle,
  .topbar-stat {
    display: none;
  }

  .app-grid {
    display: block;
    padding-top: 39px;
  }

  .control-rail {
    display: block;
  }

  .intro-block {
    max-width: 500px;
  }

  .intro-copy {
    max-width: 430px;
  }

  .fractal-section {
    margin-top: 34px;
  }

  .fractal-list {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .fractal-card {
    min-height: 57px;
  }

  .tuning-section,
  .palette-section {
    margin-top: 27px;
  }

  .toggle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rail-footer {
    margin-top: 26px;
    margin-bottom: 42px;
  }

  .stage-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 19px;
  }

  .stage-actions {
    width: 100%;
  }

  .outline-button,
  .primary-button {
    flex: 1;
  }
}

@media (max-width: 500px) {
  .page-shell {
    width: min(100% - 24px, 430px);
  }

  .topbar-meta {
    gap: 12px;
  }

  .live-pill {
    font-size: 8px;
  }

  h1 {
    max-width: 310px;
    font-size: 37px;
  }

  .fractal-list {
    grid-template-columns: 1fr;
  }

  .toggle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .canvas-topline,
  .canvas-bottomline {
    padding-right: 11px;
    padding-left: 11px;
  }

  .canvas-mode {
    gap: 5px;
    font-size: 7px;
  }

  .canvas-coord {
    overflow: hidden;
    max-width: 53%;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .canvas-hint {
    right: 9px;
    bottom: 9px;
    font-size: 7px;
  }

  .canvas-bottomline {
    min-height: 42px;
  }

  .zoom-readout,
  .render-readout {
    min-width: 38px;
    font-size: 7px;
  }

  .zoom-readout span,
  .render-readout span {
    display: none;
  }

  .reset-button {
    padding: 0 2px;
    font-size: 7px;
  }

  .insight-grid {
    grid-template-columns: 1fr 1fr;
  }

  .formula-card {
    grid-column: 1 / -1;
  }

  .insight-card {
    min-height: 100px;
  }

  .keyboard-strip {
    gap: 10px;
    line-height: 1.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
