/* banter — Liquid Glass styles, grounded in Apple HIG (Adopting Liquid Glass)
 *
 * Liquid Glass is "a distinct functional layer for controls and navigation
 * elements." We model only what the HIG names. There is one material with
 * adaptive behavior — not a tier ladder. There is also a `.glassProminent`
 * button variant (the only documented variant we render).
 *
 * IMPORTANT: glass goes on chrome (toolbars, tab bars, sidebars, sheets,
 * popovers, control knobs). It does NOT go on cards, message bubbles,
 * or content surfaces.
 */

/* ---- the material ---- */
.lg {
  background: color-mix(in oklab, var(--paper) 62%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(24px);
  backdrop-filter: saturate(1.6) blur(24px);
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, white 50%, transparent),
    0 1px 0 color-mix(in oklab, var(--ink) 6%, transparent),
    0 8px 24px -8px color-mix(in oklab, var(--ink) 22%, transparent);
}

/* sheet at full height becomes more opaque (HIG: half→full transition) */
.lg-opaque {
  background: color-mix(in oklab, var(--paper) 92%, transparent);
}

/* ---- shape: ConcentricRectangle (HIG: rounded shapes concentric to containers) ---- */
.lg-concentric { border-radius: 18px; }   /* nested controls */
.lg-window     { border-radius: 12px; }   /* window corners */
.lg-sheet      { border-radius: 22px; }   /* sheets (increased corner radius per HIG) */
.lg-pill       { border-radius: 999px; }  /* buttons, search */

/* ---- accessibility-aware fallbacks (system handles these automatically; we mirror) ---- */
@media (prefers-reduced-transparency: reduce) {
  .lg { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
}
@media (prefers-contrast: more) {
  .lg { border-color: var(--ink); }
}

/* ---- scroll edge effect: content fades as it passes under a top toolbar ---- */
.lg-scroll-edge {
  position: relative;
}
.lg-scroll-edge::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 56px;
  pointer-events: none;
  background: linear-gradient(to bottom,
    color-mix(in oklab, var(--paper) 90%, transparent) 0%,
    transparent 100%);
}

/* ---- reference-app surfaces (NOT glass — these are content) ---- */
/* Window-level styling per Figma: 26px corner radius, floating shadow + 1px hairline border. */
.app-canvas {
  background: var(--paper);
  border-radius: 12px;
  border: 1px solid var(--rule);
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(20,17,15,0.30);
}
.app-canvas-window {
  border-radius: 26px;
  border: none;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.18),
    0 16px 48px rgba(0,0,0,0.22);
}

/* HIG: traffic lights live on the window */
.tl { display: inline-flex; gap: 8px; }
.tl span { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.10); }
.tl span:nth-child(1) { background: #FF5F56; }
.tl span:nth-child(2) { background: #FFBD2E; }
.tl span:nth-child(3) { background: #27C93F; }

/* SF-ish system label sizes */
.sys-large    { font-size: 17px; line-height: 1.3; }
.sys-body     { font-size: 13px; line-height: 1.35; }
.sys-caption  { font-size: 11px; line-height: 1.3; color: var(--ink-mute); }

/* HIG callout / api badge */
.api {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 6px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.api b { font-weight: 600; color: var(--ink); }

.callout {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 14px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-soft);
  font-style: italic;
}

/* `.spec-row` lives inside `KitSection`'s right column (the 1fr cell of
   the section's 200px / 1fr header grid). The negative `margin-left`
   pulls the row back to the shell's outer left edge so its own 200px
   label rail aligns with the page's kicker rail — making mono labels
   like "WHERE GLASS LIVES" / "ACCESSIBILITY" scannable down a single
   left edge regardless of which section they're in. The magic number
   `248px` matches `KitSection`'s rail (200px) + grid gap (48px). */
.spec-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  margin-left: -248px;
}
.spec-row:first-child { border-top: 0; }
.spec-row .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); padding-top: 2px; }
.spec-row .body { color: var(--ink-soft); font-size: 16px; line-height: 1.6; max-width: 78ch; }

/* a "wallpaper" only used for one demo — we explicitly call out it's NOT how Liquid Glass usually works */
.demo-wall {
  background:
    radial-gradient(60% 80% at 20% 20%, #FFB58A 0%, transparent 60%),
    radial-gradient(50% 70% at 80% 30%, #B7C8FF 0%, transparent 55%),
    radial-gradient(60% 70% at 50% 100%, #F4D78A 0%, transparent 55%),
    #E8DFD2;
}

/* ---- macOS 26 toolbar items (grounded in Figma kit values) ----
   The pattern: NO bar fill. Content paper runs edge-to-edge. Toolbar items
   live in grouped Liquid Glass pills floating above the content. Each pill
   has its own translucent material backing (a stack of subtle layers per
   the Figma "Mode=Light, State=Default" material) and a soft drop shadow.
   Buttons inside the pill are borderless. Items that share context group
   into one pill; separate pill groups are spaced by ToolbarSpacer. */

.lg-pill-group {
  /* The Liquid Glass material — Figma values: stacked semi-transparent fills
     plus a 0.2 black "glass effect" layer that subtly darkens content beneath. */
  background:
    linear-gradient(color-mix(in oklab, var(--paper) 55%, transparent), color-mix(in oklab, var(--paper) 55%, transparent)),
    color-mix(in oklab, var(--ink) 8%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-radius: 100px;
  border: 0.5px solid color-mix(in oklab, var(--ink) 8%, transparent);
  box-shadow:
    inset 0 0.5px 0 color-mix(in oklab, white 50%, transparent),
    0 1px 1px color-mix(in oklab, var(--ink) 6%, transparent),
    0 8px 24px -8px color-mix(in oklab, var(--ink) 16%, transparent);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  height: 28px;
  box-sizing: border-box;
}
.lg-pill-btn {
  height: 24px;
  min-width: 28px;
  padding: 0 6px;
  border: none;
  background: transparent;
  border-radius: 100px;
  color: var(--ink);
  font-family: var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 100ms ease;
}
.lg-pill-btn:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.lg-pill-btn:active,
.lg-pill-btn[aria-expanded="true"] { background: color-mix(in oklab, var(--ink) 10%, transparent); }
.lg-pill-btn-wide { padding: 0 10px; }

/* ---- Chip popover — anchored under a toolbar pill button ---- */
.lg-popover {
  position: absolute;
  z-index: 9;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(28px);
  backdrop-filter: saturate(1.6) blur(28px);
  border: 0.5px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 12px;
  box-shadow:
    0 1px 1px color-mix(in oklab, var(--ink) 6%, transparent),
    0 16px 40px -8px color-mix(in oklab, var(--ink) 28%, transparent);
  padding: 6px;
  font-family: var(--sans);
}
.lg-menu-row {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.lg-menu-row:hover { background: color-mix(in oklab, var(--primary) 90%, white); color: white; }

@media (prefers-reduced-transparency: reduce) {
  .lg-pill-group, .lg-popover {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--paper);
  }
}

.hig-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease;
}
.hig-icon:hover {
  background: color-mix(in oklab, var(--ink) 8%, transparent);
}
.hig-icon:active {
  background: color-mix(in oklab, var(--ink) 14%, transparent);
}

.hig-prominent {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 7px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 0 rgba(0,0,0,0.05);
  transition: filter 120ms ease, transform 80ms ease;
}
.hig-prominent:hover { filter: brightness(1.05); }
.hig-prominent:active { transform: translateY(0.5px); }
