.appearance-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.appearance-presets button {
  padding: 8px;
  border: 1px solid #d5dfcd;
  border-radius: 8px;
  background: #fbfcf7;
  color: #385342;
  font: inherit;
  cursor: pointer;
}

.appearance-presets button:hover { border-color: #698d76; }

.appearance-presets span {
  display: block;
  height: 26px;
  margin-bottom: 5px;
  border-radius: 5px;
  background: #e9eee5;
}

[data-appearance-preset="glass"] span { background: linear-gradient(125deg, #f3faf5, #adcdc1); }
[data-appearance-preset="matte"] span { background: linear-gradient(125deg, #faf0df, #dccbad); }
[data-appearance-preset="pearl"] span { background: linear-gradient(125deg, #eef8ee, #eee3f5 50%, #fff1da); }

.appearance-controls,
.appearance-glass-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr));
  gap: 14px 18px;
}

.appearance-glass-controls { margin-top: 14px; }
.appearance-glass-controls[hidden] { display: none; }

.appearance-controls label,
.appearance-glass-controls label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #405948;
}

.appearance-controls output,
.appearance-glass-controls output {
  color: #516f5d;
  font-variant-numeric: tabular-nums;
}

.appearance-controls :is(input, select),
.appearance-glass-controls input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}

.appearance-controls select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #d4dfd0;
  border-radius: 7px;
  background: #fbfcf7;
  color: #314e3f;
  font: inherit;
}

.appearance-controls input[type="color"] { width: 46px; min-height: 30px; }
.appearance-controls input[type="range"], .appearance-glass-controls input[type="range"] { accent-color: #356854; }

:is(.profile-page, #publicPage).appearance-atmosphere { position: relative; isolation: isolate; }

:is(.profile-page, #publicPage).appearance-atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 16% 9%, var(--appearance-glow) 0%, transparent 54%),
    radial-gradient(circle at 32% 27%, var(--appearance-grain-dark) 0 .55px, transparent .9px),
    radial-gradient(circle at 72% 58%, var(--appearance-grain-light) 0 .6px, transparent 1px);
  background-size: 100% 720px, 4px 5px, 7px 6px;
  background-repeat: no-repeat, repeat, repeat;
}

.profile-page[data-surface="glass"] :is(.page-link, .page-image, .page-video, .link-folder > summary, .profile-search-field) {
  background-color: var(--appearance-tint) !important;
  background-image: linear-gradient(150deg, #ffffff36, transparent 65%);
  -webkit-backdrop-filter: blur(var(--appearance-blur)) saturate(1.24);
  backdrop-filter: blur(var(--appearance-blur)) saturate(1.24);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .profile-page[data-surface="glass"] :is(.page-link, .page-image, .page-video, .link-folder > summary, .profile-search-field) {
    background-image: linear-gradient(145deg, #ffffff4d, #ffffff18);
  }
}

.profile-page[data-surface="matte"] :is(.page-link, .page-image, .page-video, .link-folder > summary, .profile-search-field) {
  background-image: linear-gradient(155deg, #fff6df57, #65543a12);
}

.profile-page[data-surface="pearl"] :is(.page-link, .page-image, .page-video, .link-folder > summary, .profile-search-field) {
  background-image: linear-gradient(120deg, #e9fff0a1, #f4e6ffc2 53%, #fff2dca1);
}

.profile-page.appearance-shadow :is(.page-link, .page-image, .page-video, .link-folder > summary, .profile-search-field) {
  box-shadow: 0 var(--appearance-shadow-y) var(--appearance-shadow-blur) var(--appearance-shadow-color);
}

.profile-page.appearance-edge :is(.page-link, .page-image, .page-video, .link-folder > summary, .profile-search-field):not(:focus-visible) {
  outline: 1px solid var(--appearance-edge-color);
  outline-offset: -1px;
}

@media (prefers-reduced-motion: no-preference) {
  .profile-page:is([data-appearance-motion="enter"], [data-appearance-motion="both"]) .profile-intro {
    animation: profile-appearance-enter .38s ease-out both;
  }

  .profile-page:is([data-appearance-motion="enter"], [data-appearance-motion="both"]) .page-modules {
    animation: profile-appearance-enter .42s .075s ease-out both;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .profile-page:is([data-appearance-motion="lift"], [data-appearance-motion="both"]) :is(.page-link, .link-folder > summary) {
    transition: translate .18s ease-out;
  }

  .profile-page:is([data-appearance-motion="lift"], [data-appearance-motion="both"]) :is(.page-link, .link-folder > summary):hover {
    translate: 0 -3px;
  }
}

@keyframes profile-appearance-enter {
  from { opacity: .42; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
