/* Fillo design system v3 · glass.css. Liquid glass: the control and navigation layer that floats over content
   (Apple HIG, Materials: glass is never the content layer). One family, three materials:
     .f-glass           frosted. Blur 24, 70% tint. Anything with a paragraph.
     .f-glass--liquid   frosted body, a rim that refracts the backdrop (SVG displacement through backdrop-filter, Chromium;
                        other engines keep the frosted body), a specular edge, a light that follows the pointer at 180 ms,
                        a squeeze when pressed. Nothing on it moves by itself.
     .f-glass--clear    highly translucent: one icon button or one label over a photo, always with .f-glass--dim behind
                        white text. Never a paragraph.
   Rules and the measured legibility are in RULES.md section 9. Tints live in tokens.css (@group material). */
@layer f.components {
.f-glass--liquid, .f-glass--clear, .f-btn--glass {
  --f-lx: 28%; --f-ly: 18%;        /* where the light sits at rest; glass.js moves it with the pointer */
  --f-lens: ;                      /* glass.js sets url(#f-lens-n) where the engine can refract */
  position: relative; isolation: isolate;
  background: var(--f-glass-liquid);
  -webkit-backdrop-filter: blur(var(--f-glass-blur)) saturate(1.2);
  backdrop-filter: blur(var(--f-glass-blur)) saturate(1.2);
  border: 1px solid transparent;   /* the rim is drawn by ::before so it can carry a gradient */
  box-shadow: inset 0 1px 0 var(--f-glass-rim), inset 0 -1px 0 rgba(255,255,255,.14), inset 0 0 24px var(--f-glass-glow), var(--f-shadow-soft);
  transition: transform var(--f-dur-base) var(--f-spring), box-shadow var(--f-dur-base) var(--f-ease-out), border-radius var(--f-dur-slow) var(--f-ease-out);
}
.f-glass--liquid.has-lens, .f-glass--clear.has-lens, .f-btn--glass.has-lens {
  backdrop-filter: var(--f-lens) blur(var(--f-glass-blur-lens)) saturate(1.25);
}
/* the specular rim: a 1 px gradient ring, bright top-left, a faint return bottom-right */
.f-glass--liquid::before, .f-glass--clear::before, .f-btn--glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, var(--f-glass-rim) 0%, rgba(255,255,255,.28) 32%, rgba(255,255,255,.04) 55%, rgba(255,255,255,.45) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
/* the light: one soft ellipse under the pointer, behind the content */
.f-glass--liquid::after, .f-glass--clear::after, .f-btn--glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(62% 54% at var(--f-lx) var(--f-ly), var(--f-glass-light), transparent 72%);
}
/* pressed: the squeeze (buttons and links only) */
:is(button, a, [role="button"]):is(.f-glass--liquid, .f-glass--clear, .f-btn--glass):active { transform: scale(.985); box-shadow: inset 0 1px 0 var(--f-glass-rim), inset 0 0 32px var(--f-glass-glow), var(--f-contact); }
/* clear: for a label or an icon button over a photo. White text, the dim carries the contrast. */
.f-glass--clear { background: var(--f-glass-clear); color: #FFFFFF; }
.f-glass--clear.f-glass--dim { background: var(--f-glass-dim); }
.f-glass--clear.f-btn--icon { color: #FFFFFF; border-color: transparent; }
.f-glass--clear.f-btn--icon:hover { background: var(--f-glass-dim); }
.f-btn--glass { color: var(--f-text); }
.f-btn--glass:hover { box-shadow: inset 0 1px 0 var(--f-glass-rim), inset 0 0 24px var(--f-glass-glow), var(--f-shadow-lift); transform: translateY(-1px); }

/* Shaders (shaders.js): the host keeps its children above the canvas. Without WebGL the host shows a plain gradient. */
.f-shader { position: relative; overflow: hidden; background: var(--f-surface-2); }
.f-shader__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.f-shader > :not(.f-shader__canvas) { position: relative; z-index: 1; }
.f-shader--fallback { background: linear-gradient(180deg, var(--f-surface) 0%, var(--f-surface-2) 100%); }
.f-shader--fallback[data-shader="fill"] { background: linear-gradient(to top, var(--f-lime) 0 var(--f-level, 62%), var(--f-surface) var(--f-level, 62%)); }

/* Settings people choose win over the material */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .f-glass, .f-glass--liquid, .f-glass--clear, .f-btn--glass { background: var(--f-glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; --f-lens: ; }
  .f-glass--clear, .f-glass--clear.f-glass--dim { background: var(--f-glass-solid); color: var(--f-text); }
  .f-glass--liquid::after, .f-glass--clear::after, .f-btn--glass::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .f-glass--liquid, .f-glass--clear, .f-btn--glass { transition: none; }
}
}
