/* Glass / Sunset surface language. Load after tokens.css.
   The host owns the backdrop. Surfaces add edges and restrained transparent tint.
   .glass-panel: clear | data-depth="section" | data-depth="well"
   .glass-divider: fine | data-treatment="section" | data-treatment="waypoint" */
:root,
[data-host="dark"] {
  --surface-edge: rgb(247 247 248 / 0.28);
  --surface-edge-quiet: rgb(247 247 248 / 0.17);
  --surface-edge-strong: rgb(247 247 248 / 0.38);
  --surface-highlight: rgb(255 255 255 / 0.12);
  --surface-section-fill: rgb(247 247 248 / 0.035);
  --surface-well-fill: rgb(0 0 0 / 0.18);
  --surface-well-shadow: rgb(0 0 0 / 0.16);
  --surface-muted: #b5b6bf;
  --surface-cue: var(--electric-teal);
  --surface-radius: 14px;
  --surface-padding: 20px;
}
[data-host="light"] {
  --surface-edge: rgb(23 23 25 / 0.24);
  --surface-edge-quiet: rgb(23 23 25 / 0.15);
  --surface-edge-strong: rgb(23 23 25 / 0.34);
  --surface-highlight: rgb(255 255 255 / 0.72);
  --surface-section-fill: rgb(255 255 255 / 0.1);
  --surface-well-fill: rgb(23 23 25 / 0.045);
  --surface-well-shadow: rgb(23 23 25 / 0.06);
  --surface-muted: #5b5c64;
  --surface-cue: #087d7b;
}

.glass-panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--glass-edge, var(--surface-edge-quiet));
  border-radius: var(--surface-radius);
  background: var(--glass-face, linear-gradient(transparent, transparent));
  box-shadow: var(--glass-bevel, inset 0 1px 0 var(--surface-highlight)), var(--glass-shadow-small, 0 3px 9px rgb(0 0 0 / .04));
  color: inherit;
}
.glass-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: var(--glass-rim, linear-gradient(135deg, var(--surface-highlight), transparent 40%));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: .65;
  pointer-events: none;
}
.glass-panel[data-depth="section"] {
  background: var(--glass-face, linear-gradient(transparent, transparent)), var(--surface-section-fill);
  box-shadow: var(--glass-bevel, inset 0 1px 0 var(--surface-highlight)), var(--glass-shadow, 0 6px 18px rgb(0 0 0 / .07));
}
.glass-panel[data-depth="section"]::before { opacity: 1; }
.glass-panel[data-depth="well"] {
  border-color: var(--surface-edge-quiet);
  border-radius: calc(var(--surface-radius) - 4px);
  background: linear-gradient(165deg, var(--surface-well-fill), transparent 65%);
  box-shadow: inset 0 2px 5px var(--surface-well-shadow), inset 0 -1px 0 var(--surface-highlight);
}
.glass-panel[data-depth="well"]::before { opacity: .25; }
.glass-panel__header,
.glass-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 16px var(--surface-padding);
}
.glass-panel__header { padding-bottom: 0; }
.glass-panel__body { min-width: 0; padding: var(--surface-padding); }
.glass-panel__footer { border-top: 1px solid var(--surface-edge-quiet); }
.glass-panel__header > :last-child,
.glass-panel__footer > :last-child { flex-shrink: 0; }

.glass-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--surface-edge-quiet);
}
.glass-divider:is([data-treatment="section"], [data-treatment="waypoint"]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: auto;
  min-height: 44px;
  padding: 0;
  background: transparent;
}
.glass-divider__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}
.glass-divider > :is(a, button) { flex-shrink: 0; margin-left: auto; }
.glass-divider[data-treatment="waypoint"] .glass-divider__label::before {
  content: "";
  flex: 0 0 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--surface-cue);
}

/* Style-kit specimens. Proximity groups context; material supplies the boundary. */
.surface-library { margin-top: 64px; }
.surface-library > .section-heading > a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 44px; color: var(--surface-muted); font-size: 13px; white-space: nowrap; }
.surface-library > .section-heading > a:hover { color: inherit; text-decoration: underline; }
.surface-intro { max-width: 65ch; color: var(--surface-muted); font-size: 14px; line-height: 1.65; }
.surface-specimens { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.surface-depths { display: grid; gap: 22px; }
.surface-depth-row { display: grid; grid-template-columns: minmax(108px, .38fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.surface-depth-label h3 { font-size: 14px; font-weight: 550; }
.surface-depth-label p { margin-top: 5px; color: var(--surface-muted); font-size: 13px; line-height: 1.5; }
.surface-sample { display: flex; align-items: center; gap: 12px; min-height: 100px; padding: 18px; }
.surface-sample .component-title { flex: 1; }
.surface-sample .component-title h4 { margin: 0; font-size: 14px; font-weight: 550; }
.surface-sample .component-title p { margin-top: 4px; color: var(--surface-muted); font-size: 13px; line-height: 1.5; }
.surface-sample .submenu-button { flex-shrink: 0; min-height: 44px; padding: 0 12px; font-size: 13px; }
.surface-library [data-accent] { fill: currentColor; fill-opacity: .2; }
.surface-library [data-accent-stroke] { stroke: currentColor; }
.surface-grouping { min-width: 0; }
.surface-grouping > h3 { font-size: 16px; font-weight: 550; line-height: 1.4; }
.surface-grouping__intro { margin-top: 8px; max-width: 52ch; color: var(--surface-muted); font-size: 14px; line-height: 1.6; }
.surface-group-example { margin-top: 24px; padding: 24px; }
.surface-group-example .component-title h4 { margin: 0; font-size: 15px; font-weight: 550; }
.surface-group-example .component-title p { margin-top: 5px; color: var(--surface-muted); font-size: 13px; line-height: 1.5; }
.surface-group-example__content { display: grid; gap: 22px; margin-top: 30px; }
.surface-group-example__content p { display: grid; gap: 4px; font-size: 13px; line-height: 1.6; }
.surface-group-example__content strong { font-weight: 550; }
.surface-group-example__content span { color: var(--surface-muted); }
.surface-rule { margin-top: 28px; color: var(--surface-muted); font-size: 13px; line-height: 1.65; }
@media (max-width: 1100px) {
  .surface-specimens { gap: 32px; }
  .surface-depth-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .surface-depth-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
  .surface-depth-label p { margin-top: 0; text-align: right; }
}
@media (max-width: 820px) {
  .surface-specimens { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .surface-depth-row { grid-template-columns: 140px minmax(0, 1fr); gap: 24px; }
  .surface-depth-label { display: block; }
  .surface-depth-label p { margin-top: 5px; text-align: left; }
  .surface-group-example__content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 580px) {
  .surface-library { margin-top: 48px; }
  .surface-depth-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .surface-depth-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
  .surface-depth-label p { max-width: 22ch; margin-top: 0; text-align: right; }
  .surface-sample { min-height: 96px; padding: 16px; gap: 8px; }
  .surface-sample .component-title { gap: 8px; }
  .surface-sample .component-glyph { flex-basis: 20px; }
  .surface-sample .component-glyph svg { width: 20px; height: 20px; }
  .surface-group-example { padding: 20px; }
  .surface-group-example__content { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
