/* The original image keeps the exact phone footprint; changing the material
   never replaces the card's gesture target or makes screen contents interactive. */
[data-phone-frame="glass"] .phone > .frame {
  visibility: hidden;
}
[data-phone-frame="glass"] .phone {
  border-radius: var(--pg-radius, 16%);
  box-shadow:
    0 30px 48px -30px #27344042,
    0 9px 16px -11px #27344038;
}
[data-phone-frame="glass"] .phone .screen.hero-home {
  inset: var(--pg-inset, 6.2%);
  border-radius: var(--pg-inner-radius, 11%);
  background: #fafafa;
  box-shadow: none;
}
[data-phone-frame="glass"]
  .phone:has(.pg-material[data-renderer="webgl"])
  .screen.hero-home {
  background: transparent;
}
[data-phone-frame="glass"] .hh-top {
  padding-top: 17.4cqw;
}
.pg-material {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pg-optics,
.pg-rim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--pg-radius);
  pointer-events: none;
}
.pg-optics {
  display: block;
  z-index: 0;
  opacity: 0;
}
.pg-material[data-renderer="webgl"] .pg-optics {
  opacity: 1;
}
.pg-rim {
  z-index: 2;
  box-sizing: border-box;
  padding: var(--pg-inset);
  background: conic-gradient(
    from 155deg,
    #f4fcffb0,
    #506a8070 11%,
    #fff 19%,
    #d8f0ff60 25%,
    #f5fcff30 34%,
    #efcfae80 45%,
    #fff 48%,
    #637c9470 53%,
    #e4f3ff40 65%,
    #a1acb380 77%,
    #fff 84%,
    #f4fcffb0
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  -webkit-backdrop-filter: blur(var(--pg-frost, 2px));
  backdrop-filter: blur(var(--pg-frost, 2px));
}
.pg-material[data-renderer="webgl"] .pg-rim {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.pg-material::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--pg-radius);
  border: 0.65px solid #9cabb558;
  box-shadow: inset 0 1px 1px #fff9;
  pointer-events: none;
}
.pg-island {
  position: absolute;
  z-index: 3;
  left: 36%;
  top: 3.8%;
  width: 28%;
  height: 3.75%;
  border-radius: 999px;
  background: linear-gradient(165deg, #34424de8, #141d25fa 48%, #34414aeb);
  box-shadow:
    inset 0 1px 1px #ffffff8c,
    inset 0 -1px 1px #0007,
    0 0 0 0.75px #25324055,
    0 2px 3px #2d3b4920;
}
.pg-island::before {
  content: "";
  position: absolute;
  left: 21%;
  right: 33%;
  height: 11%;
  top: 23%;
  background: #a0c1cd21;
  border-radius: 100%;
  filter: blur(0.5px);
}
.pg-island::after {
  content: "";
  position: absolute;
  right: 13%;
  top: 29%;
  height: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #8bcced 0%,
    #293f64 24%,
    #0a1420 53%,
    #2a3b52 69%,
    #14202d 75%
  );
  box-shadow: 0 0 0 1px #6e889438;
}
.pg-scene {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}
.pg-scene[hidden] {
  display: none;
}

/* Independent, bottom-right material studio. The panel scrolls internally and
   remains nonmodal, so the phone deck can be touched while adjusting materials. */
.glass-studio {
  pointer-events: none;
  position: fixed;
  z-index: 210;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  color: #22282d;
  font:
    400 13px/1.4 Selecta,
    Arial,
    sans-serif;
  letter-spacing: 0;
  text-align: left;
}
.glass-studio button,
.glass-studio input,
.glass-studio select {
  font: inherit;
  letter-spacing: inherit;
}
.glass-studio button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gs-trigger {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  height: 48px;
  padding: 0 16px 0 11px;
  border: 1px solid #fff;
  border-radius: 99px;
  color: #283039;
  background: #ffffffd9;
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow:
    0 5px 24px #24344313,
    0 1px 3px #24344317,
    inset 0 1px 1px #fff;
}
.gs-trigger-plus {
  font-size: 20px;
  line-height: 1;
  color: #69757d;
  margin-left: 3px;
  transition: transform 0.25s;
}
.is-open .gs-trigger-plus {
  transform: rotate(45deg);
}
.gs-gem {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid #fff;
  background: conic-gradient(
    from 35deg,
    #ecfaff,
    #bac9d250,
    #fff,
    #cee3ed,
    #96afbf80,
    #fff,
    #ecfaff
  );
  box-shadow:
    inset 1px 1px 2px #fff,
    inset -2px -2px 3px #718b9e65,
    0 1px 2px #63758425;
}
.gs-panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: 312px;
  max-height: min(740px, calc(100dvh - 96px));
  margin-bottom: 12px;
  border: 1px solid #ffffffeb;
  border-radius: 24px;
  overflow: hidden;
  background: #fbfcfdef;
  backdrop-filter: blur(32px) saturate(1.1);
  -webkit-backdrop-filter: blur(32px) saturate(1.1);
  box-shadow:
    0 20px 65px #283a4b24,
    0 2px 10px #283a4b12,
    inset 0 1px 1px #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.975);
  transform-origin: bottom right;
  transition:
    opacity 0.22s,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0.3s;
}
.is-open .gs-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.gs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 15px;
  flex: none;
}
.gs-header h2 {
  margin: 0;
  font:
    500 19px/1.2 Selecta,
    Arial,
    sans-serif;
  letter-spacing: -0.025em;
}
.gs-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #858d95;
}
.gs-close {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9edf0;
  color: #6a747c;
  font-size: 22px !important;
  padding: 0;
  line-height: 1 !important;
}
.gs-body {
  padding: 0 20px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c6cfd4 transparent;
}
.gs-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.gs-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  padding: 8px 2px;
  border-radius: 12px;
  background: transparent;
  color: #7a838b;
  font-size: 10px !important;
}
.gs-preset:hover {
  background: #e9eef2;
}
.gs-preset[aria-pressed="true"] {
  background: #fff;
  border-color: #c6d3dc;
  color: #253848;
  box-shadow: 0 2px 5px #283a4b09;
}
.gs-swatch {
  width: 31px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #fff;
  background: linear-gradient(
    140deg,
    #e2f3fd,
    #fff8 35%,
    #d0e1e94d 60%,
    #a7bacdad
  );
  box-shadow:
    inset 1px 1px 1px #fff,
    inset -2px -2px 2px #536c8050,
    0 2px 3px #283a4b16;
}
.gs-preset-crystal .gs-swatch {
  border-radius: 5px;
  background: linear-gradient(
    120deg,
    #adbbc7,
    #fff 12%,
    #dfedf155 27%,
    #fff 74%,
    #77949e
  );
}
.gs-preset-frost .gs-swatch {
  background: linear-gradient(140deg, #fcfcf7, #d9dde0);
  box-shadow:
    inset 1px 1px 3px #fff,
    inset -2px -2px 4px #9ca9b750;
}
.gs-preset-prism .gs-swatch {
  background: conic-gradient(
    #d6e7fd,
    #d9efdb,
    #fdf0c6,
    #efc6dd,
    #c7cbfd,
    #d6e7fd
  );
}
.gs-preset-smoke .gs-swatch {
  background: linear-gradient(
    135deg,
    #8796a3,
    #28313b 36%,
    #5f7183 75%,
    #b6c0c8
  );
  box-shadow:
    inset 1px 1px 1px #e6f0f8,
    inset -1px -1px 2px #10222f;
}
.gs-material-note {
  font-size: 11px;
  color: #89929a;
  text-align: center;
  margin: 10px 0 19px;
}
.gs-group {
  min-width: 0;
  border: 0;
  border-top: 1px solid #dde3e7;
  margin: 0;
  padding: 14px 0 17px;
}
.gs-group legend {
  float: left;
  padding: 0;
  width: 100%;
  margin: 0 0 13px;
  color: #87919a;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.gs-control {
  display: block;
  clear: both;
  margin: 0 0 13px;
}
.gs-control:last-child {
  margin-bottom: 0;
}
.gs-reset-layout {
  display: block;
  padding: 3px 0;
  margin-top: 4px;
  border: 0;
  color: #74838e;
  background: none;
  font-size: 11px !important;
}
.gs-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gs-caption output {
  font-size: 11px;
  color: #7f8a94;
  font-variant-numeric: tabular-nums;
}
.gs-control input[type="range"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  padding: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
}
.gs-control input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 5px;
  background: linear-gradient(
    to right,
    #718897 var(--fill),
    #e0e6ea var(--fill)
  );
}
.gs-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -6px;
  border-radius: 50%;
  border: 1px solid #c9d2d9;
  background: #fff;
  box-shadow: 0 1px 3px #2a3b4821;
}
.gs-control input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 5px;
  background: #dbe2e7;
}
.gs-control input[type="range"]::-moz-range-progress {
  height: 3px;
  background: #718897;
}
.gs-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid #c9d2d9;
  border-radius: 50%;
  background: #fff;
}
.gs-control:has(input:disabled) {
  opacity: 0.4;
}
.gs-select,
.gs-toggle {
  display: flex;
  clear: both;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}
.gs-select select {
  max-width: 150px;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  padding: 5px 7px;
  color: #536472;
  background: #fff9;
  font-size: 11px;
}
.gs-toggle {
  position: relative;
  font-size: 12px;
  min-height: 24px;
}
.gs-toggle input {
  position: absolute;
  right: 0;
  width: 32px;
  height: 22px;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.gs-switch {
  width: 31px;
  height: 19px;
  border-radius: 20px;
  background: #d8e0e6;
  padding: 2px;
  flex: none;
  box-sizing: border-box;
  transition: background 0.2s;
}
.gs-switch::after {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #26394920;
  transition: transform 0.2s;
}
.gs-toggle input:checked + .gs-switch {
  background: #617f90;
}
.gs-toggle input:checked + .gs-switch::after {
  transform: translateX(12px);
}
.gs-toggle input:focus-visible + .gs-switch {
  outline: 2px solid #547e9d;
  outline-offset: 3px;
}
.gs-hint {
  color: #98a1a8;
  font-size: 11px;
  line-height: 1.45;
  margin: 0;
}
.gs-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: none;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid #dde3e7;
  background: #f5f8fa80;
}
.gs-footer button {
  padding: 3px 0;
  font-size: 11px;
  border: 0;
  color: #74838e;
  background: none;
}
.gs-footer .gs-copy {
  grid-column: 1 / -1;
  min-height: 36px;
  border: 1px solid #cfdbe2;
  border-radius: 12px;
  background: #fff9;
  color: #344f60;
  font-size: 12px;
  font-weight: 500;
  transition: background 160ms ease;
}
.gs-footer .gs-copy:hover {
  background: #fff;
}
.gs-copy-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #74838e;
  font-size: 11px;
  text-align: center;
}
.gs-copy-text {
  grid-column: 1 / -1;
  width: 100%;
  height: 80px;
  padding: 8px;
  border: 1px solid #cfdbe2;
  border-radius: 8px;
  font: 11px/1.4 monospace;
  color: #344f60;
  background: white;
  resize: vertical;
  user-select: text;
  -webkit-user-select: text;
}
.glass-studio button:focus-visible,
.glass-studio input:focus-visible,
.glass-studio select:focus-visible {
  outline: 2px solid #547e9d;
  outline-offset: 3px;
}
@media (max-width: 650px) {
  .glass-studio {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .gs-trigger {
    height: 42px;
    font-size: 12px;
  }
  .gs-panel {
    width: min(340px, calc(100vw - 24px));
    max-height: 48dvh;
    border-radius: 20px;
    margin-bottom: 8px;
  }
  .gs-header {
    padding: 15px 18px 12px;
  }
  .gs-body {
    padding-inline: 18px;
  }
  .gs-control input[type="range"] {
    height: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gs-panel,
  .gs-trigger-plus,
  .gs-switch,
  .gs-switch::after {
    transition: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .gs-panel,
  .gs-trigger {
    background: #fbfcfd;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
