/* Glass folders (round G1) — core/glass-folder.js, docs/GLASS.md §1–§2. The CSS of the component «Glass Folder Cards»
   (docs/research/glass-folder-cards.src.txt), ported one to one, plus: tone through variables (`auto` follows
   [data-theme] of the page; milk glass in the light theme, smoked slate glass in the dark one), text that never shrinks
   below a readable size when the folder is small (--gf-k = width / 340), sheets with the name over a monospace line, the
   glowing edge of a selected folder, a drop target while a row is dragged, the platform focus colour and a calm rose-violet
   danger (no red). Motion — transform, opacity, filter only; prefers-reduced-motion — still. Prefix .gf- */
.gf-root {
  --gf-px: 0;
  --gf-py: 0;
  --gf-k: 1;
  --gf-ease: cubic-bezier(.2, .8, .2, 1);
  --gf-spring: cubic-bezier(.34, 1.36, .5, 1);
  --gf-hinge: 0deg;
  --gf-lift: 42px;
  --gf-spread: 0px;
  --gf-fan: 0deg;
  --gf-stack: 15px;
  /* milk glass */
  --gf-ink: #141416;
  --gf-ink-soft: rgba(20, 20, 22, .55);
  --gf-shade: rgba(16, 18, 24, .34);
  --gf-back: linear-gradient(180deg, #f5f4f9 0%, #e4e3ec 100%);
  --gf-back-rim: rgba(255, 255, 255, .45);
  --gf-paper: linear-gradient(180deg, #ffffff 0%, #f3f3f1 100%);
  --gf-paper-sh: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px rgba(0, 0, 0, .1), 0 10px 26px -8px rgba(10, 12, 20, .28);
  --gf-paper-sh-hi: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px rgba(0, 0, 0, .1), 0 22px 40px -12px rgba(10, 12, 20, .42);
  --gf-paper-ink: #18181b;
  --gf-paper-mut: rgba(24, 24, 27, .52);
  --gf-paper-line: rgba(24, 24, 27, .08);
  --gf-paper-line1: rgba(24, 24, 27, .14);
  --gf-tint: linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .5) 42%, rgba(252, 252, 252, .93) 100%);
  --gf-spec-blend: soft-light;
  --gf-spec-op: .9;
  --gf-rim-op: 1;
  /* «+» — the milk key of «···» with a violet plus (the black key of the original is too loud among the pale platform buttons) */
  --gf-add-c: var(--gf-sel);
  --gf-add-bg: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(232, 229, 245, .86) 100%);
  --gf-add-sh: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(40, 20, 120, .06), 0 0 0 1px color-mix(in srgb, var(--gf-sel) 22%, rgba(0, 0, 0, .12)), 0 10px 18px -8px color-mix(in srgb, var(--gf-sel) 40%, rgba(0, 0, 0, .3));
  --gf-more-c: #111113;
  --gf-more-bg: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(226, 226, 230, .82) 100%);
  --gf-more-sh: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(0, 0, 0, .06), 0 0 0 1px rgba(0, 0, 0, .16), 0 10px 18px -8px rgba(0, 0, 0, .3);
  --gf-menu-bg: rgba(252, 252, 253, .74);
  --gf-menu-sh: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 .5px rgba(0, 0, 0, .14), 0 24px 48px -16px rgba(10, 12, 20, .4);
  --gf-item: #18181b;
  --gf-item-hov: rgba(24, 24, 27, .07);
  --gf-danger: #b4307e;
  --gf-sel: var(--acc, #6d3fd6);
  --gf-glow: color-mix(in srgb, var(--gf-sel) 55%, #a78bfa);
  --gf-focus: var(--focus, #9667ec);
  position: relative;
  display: inline-block;
  flex: none;
  vertical-align: top;
  font-family: var(--font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  text-align: left;
}
/* smoked glass, tuned to the slate of the dark platform */
.gf-root[data-tone="dark"],
[data-theme="dark"] .gf-root[data-tone="auto"] {
  --gf-ink: #f2f4f8;
  --gf-ink-soft: rgba(236, 240, 247, .6);
  --gf-shade: rgba(0, 0, 0, .62);
  --gf-back: linear-gradient(180deg, #2a3242 0%, #121823 100%);
  --gf-back-rim: rgba(255, 255, 255, .16);
  --gf-paper: linear-gradient(180deg, #2c3442 0%, #1d2430 100%);
  --gf-paper-sh: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 .5px rgba(255, 255, 255, .08), 0 12px 28px -8px rgba(0, 0, 0, .7);
  --gf-paper-sh-hi: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 .5px rgba(255, 255, 255, .1), 0 24px 42px -12px rgba(0, 0, 0, .8);
  --gf-paper-ink: #f5f6f9;
  --gf-paper-mut: rgba(240, 243, 248, .62);
  --gf-paper-line: rgba(255, 255, 255, .08);
  --gf-paper-line1: rgba(255, 255, 255, .16);
  --gf-tint: linear-gradient(180deg, rgba(16, 21, 31, .18) 0%, rgba(13, 18, 27, .62) 46%, rgba(8, 11, 17, .94) 100%);
  --gf-spec-blend: screen;
  --gf-spec-op: .16;
  --gf-rim-op: .55;
  --gf-add-c: #ddd3ff;
  --gf-add-bg: linear-gradient(180deg, rgba(196, 181, 253, .22) 0%, rgba(167, 139, 250, .08) 100%);
  --gf-add-sh: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 0 1px rgba(196, 181, 253, .22), 0 10px 18px -8px rgba(0, 0, 0, .6);
  --gf-more-c: #f5f5f7;
  --gf-more-bg: linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .06) 100%);
  --gf-more-sh: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 18px -8px rgba(0, 0, 0, .6);
  --gf-menu-bg: rgba(28, 34, 46, .76);
  --gf-menu-sh: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 .5px rgba(255, 255, 255, .1), 0 24px 48px -16px rgba(0, 0, 0, .8);
  --gf-item: #f4f4f5;
  --gf-item-hov: rgba(255, 255, 255, .09);
  --gf-danger: #f5a3cf;
  --gf-glow: color-mix(in srgb, var(--gf-sel) 70%, #8b5cf6);
}
/* the frosted front over the violet glass: clearer at the top and faintly lilac, so the colour glows through it; the
   bottom stays milk (smoke at night) under the name */
.gf-root[data-violet] { --gf-tint: linear-gradient(180deg, rgba(255, 255, 255, .08) 0%, rgba(253, 251, 255, .4) 42%, rgba(252, 250, 255, .9) 100%); --gf-shade: rgba(54, 26, 132, .3); }
/* at night the paper inside a violet folder takes a violet cast (lit by the glass around it), not the grey of slate */
.gf-root[data-violet][data-tone="dark"],
[data-theme="dark"] .gf-root[data-violet][data-tone="auto"] {
  --gf-tint: linear-gradient(180deg, rgba(22, 15, 46, .14) 0%, rgba(16, 12, 36, .56) 46%, rgba(10, 8, 22, .93) 100%);
  --gf-paper: linear-gradient(180deg, #312b52 0%, #201c3a 100%);
  --gf-shade: rgba(2, 0, 12, .66);
}
/* the violet glass at night: the same shade, deeper; the glow under the tab sinks toward a saturated violet (toward
   black it would turn grey) */
.gf-root[data-tone="dark"] .gf-back--violet,
[data-theme="dark"] .gf-root[data-tone="auto"] .gf-back--violet {
  --gf-dk: 28%;
  --gf-bc: color-mix(in oklab, var(--gf-cc), #3b1c96 46%);
  background: linear-gradient(158deg, color-mix(in oklab, var(--gf-c1) 46%, #1b1145) 0%, color-mix(in oklab, var(--gf-c1) 22%, #120b30) 50%, #0c0822 100%);
}
.gf-root[data-tone="dark"] .gf-glint,
[data-theme="dark"] .gf-root[data-tone="auto"] .gf-glint { background: radial-gradient(closest-side, rgba(205, 188, 255, .26) 0%, rgba(205, 188, 255, .08) 46%, rgba(205, 188, 255, 0) 100%); }
.gf-root[data-tone="dark"] .gf-back--violet .gf-back-sheen,
[data-theme="dark"] .gf-root[data-tone="auto"] .gf-back--violet .gf-back-sheen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 9%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(90% 70% at 76% -6%, rgba(221, 206, 255, .12), rgba(221, 206, 255, 0) 62%),
    linear-gradient(0deg, rgba(4, 2, 18, .32) 0%, rgba(4, 2, 18, 0) 44%);
}
.gf-root:hover, .gf-root:focus-within { --gf-hinge: -11deg; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; z-index: 2; }
/* open: the stack opens wide enough for one readable name per sheet however small the folder */
.gf-root[data-open] { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 5deg; --gf-stack: max(30px, calc(22px / var(--gf-k))); z-index: 4; }
.gf-root[data-menu] { z-index: 6; }
/* a small folder: its text is larger than the stage scale (readable), so on hover the sheets rise a little higher — the
   name of the front sheet clears the raised tab of the glass */
.gf-root[data-small]:hover:not([data-open]), .gf-root[data-small]:focus-within:not([data-open]) { --gf-lift: -54px; --gf-stack: 12px; }
.gf-root[data-tile]:hover, .gf-root[data-tile]:focus-within { --gf-hinge: -9deg; }

.gf-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  height: 272px;
  transform-origin: 0 0;
}
.gf-tilt {
  position: absolute;
  inset: 0;
  cursor: pointer;
  transform: perspective(1400px) rotateX(calc(var(--gf-py) * -3deg)) rotateY(calc(var(--gf-px) * 4deg));
  transition: transform .9s var(--gf-ease);
}

.gf-shadow {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -6px;
  height: 60px;
  border-radius: 40px;
  background: var(--gf-shade);
  filter: blur(22px);
  transform: translateX(calc(var(--gf-px) * -8px));
  transition: transform .9s var(--gf-ease), opacity .9s var(--gf-ease);
}
/* the glow of a selected folder (and of a drop target): a soft halo behind the object */
.gf-halo {
  position: absolute;
  left: -6px;
  right: -6px;
  top: 14px;
  bottom: -12px;
  border-radius: 48px;
  background: radial-gradient(closest-side, var(--gf-glow), transparent);
  filter: blur(26px);
  opacity: 0;
  transform: scale(.94);
  transition: opacity .5s var(--gf-ease), transform .6s var(--gf-ease);
  pointer-events: none;
}

.gf-back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--gf-back);
}
.gf-art {
  position: absolute;
  left: -12px;
  top: -12px;
  max-width: none;
  object-fit: cover;
  transform: translate(calc(var(--gf-px) * -7px), calc(var(--gf-py) * -6px)) scale(1.02);
  transition: transform 1.1s var(--gf-ease), opacity 1.2s var(--gf-ease), filter 1.2s var(--gf-ease);
}
canvas.gf-art { opacity: 0; filter: blur(14px) saturate(.6); }
canvas.gf-art[data-ready] { opacity: 1; filter: none; }
canvas.gf-art[data-instant] { transition: transform 1.1s var(--gf-ease); }
.gf-back-sheen {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}

/* ---- the violet glass (round G2, docs/GLASS.md §8.1) ----------------------------
   The back of every folder (core/glass-folder.js → violetVars / violetHtml): the base — a gradient of the shade; three
   soft blobs — A, the main mass (top left), B, the counter mass (bottom right), C, the glow under the tab that breathes;
   a glint that travels under the top edge; the sheen above all. The blobs are radial gradients (no filter, no canvas):
   painted once, then only moved — translate, rotate, scale and opacity, each on its own period (a full loop of 14–20 s,
   ease in-out there and back: 15–19 s × the tempo), so the material never repeats in step; --gf-ph (0…1) shifts the
   phase of a folder, --gf-t (0.94…1.05) its tempo — every loop stays within 14–20 s. Dark theme — the same shade sunk toward a night violet (--gf-dk). */
.gf-back--violet {
  --gf-dk: 0%;
  --gf-night: #160d3a;
  --gf-sine: cubic-bezier(.37, 0, .63, 1);
  --gf-ba: color-mix(in oklab, var(--gf-ca), var(--gf-night) var(--gf-dk));
  --gf-bb: color-mix(in oklab, var(--gf-cb), var(--gf-night) var(--gf-dk));
  --gf-bc: color-mix(in oklab, var(--gf-cc), var(--gf-night) var(--gf-dk));
  background: linear-gradient(158deg, var(--gf-c0) 0%, color-mix(in oklab, var(--gf-c0), var(--gf-c1)) 46%, var(--gf-c1) 100%);
}
.gf-mat {
  position: absolute;
  inset: -14px;
  transform: translate(calc(var(--gf-px) * -7px), calc(var(--gf-py) * -6px));
  transition: transform 1.1s var(--gf-ease);
}
.gf-blob, .gf-glint {
  position: absolute;
  display: block;
  pointer-events: none;
}
.gf-blob { border-radius: 50%; }
.gf-blob--a {
  width: 300px;
  height: 246px;
  background: radial-gradient(closest-side, var(--gf-ba) 0%, color-mix(in oklab, var(--gf-ba) 72%, transparent) 38%, color-mix(in oklab, var(--gf-ba) 26%, transparent) 70%, transparent 100%);
  opacity: .92;
  animation:
    gf-a-move calc(8s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -16s) infinite alternate,
    gf-a-turn calc(9.5s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -19s) infinite alternate;
}
.gf-blob--b {
  width: 290px;
  height: 262px;
  background: radial-gradient(closest-side, var(--gf-bb) 0%, color-mix(in oklab, var(--gf-bb) 70%, transparent) 36%, color-mix(in oklab, var(--gf-bb) 24%, transparent) 70%, transparent 100%);
  opacity: .8;
  animation:
    gf-b-move calc(9s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -18s - 5s) infinite alternate,
    gf-b-turn calc(7.5s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -15s - 3s) infinite alternate;
}
.gf-blob--c {
  width: 230px;
  height: 180px;
  background: radial-gradient(closest-side, var(--gf-bc) 0%, color-mix(in oklab, var(--gf-bc) 66%, transparent) 40%, color-mix(in oklab, var(--gf-bc) 20%, transparent) 72%, transparent 100%);
  opacity: .82;
  animation:
    gf-c-move calc(8.5s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -17s - 7s) infinite alternate,
    gf-breathe calc(7.5s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -15s - 2s) infinite alternate;
}
/* the light that travels slowly under the top edge, as through thick glass */
.gf-glint {
  width: 190px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, .22) 46%, rgba(255, 255, 255, 0) 100%);
  opacity: .5;
  animation: gf-glint calc(9.25s * var(--gf-t)) var(--gf-sine) calc(var(--gf-ph) * -18.5s - 4s) infinite alternate;
}
.gf-root[data-still] .gf-blob, .gf-root[data-still] .gf-glint { animation-play-state: paused; }
@keyframes gf-a-move { from { translate: 0 0; } to { translate: 74px 44px; } }
@keyframes gf-a-turn { from { rotate: -10deg; scale: 1 1; } to { rotate: 20deg; scale: 1.16 .86; } }
@keyframes gf-b-move { from { translate: 0 0; } to { translate: -84px -42px; } }
@keyframes gf-b-turn { from { rotate: 12deg; scale: .9 1.08; } to { rotate: -18deg; scale: 1.14 .9; } }
@keyframes gf-c-move { from { translate: 0 0; } to { translate: -66px 30px; } }
@keyframes gf-breathe { from { opacity: .48; } to { opacity: .98; } }
@keyframes gf-glint { from { translate: -36px 0; opacity: .22; } to { translate: 84px 8px; opacity: .72; } }
/* the sheen of the violet glass: a bright lip at the top edge, a soft light across the upper half */
.gf-back--violet .gf-back-sheen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .08) 9%, rgba(255, 255, 255, 0) 26%),
    radial-gradient(90% 70% at 76% -6%, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 62%),
    linear-gradient(0deg, rgba(40, 16, 110, .14) 0%, rgba(40, 16, 110, 0) 40%);
}
/* a still piece of the violet glass on a picture sheet */
.gf-sheet-violet {
  display: block;
  background:
    radial-gradient(70% 80% at 18% 12%, var(--gf-ca), transparent 70%),
    radial-gradient(70% 80% at 86% 92%, var(--gf-cb), transparent 72%),
    radial-gradient(50% 50% at 72% 20%, var(--gf-cc), transparent 70%),
    linear-gradient(158deg, var(--gf-c0), var(--gf-c1));
}

.gf-rim {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  overflow: visible;
  pointer-events: none;
  fill: none;
}
.gf-back-rim { width: 340px; height: 272px; transition: translate 1s var(--gf-ease), opacity .9s var(--gf-ease); }
.gf-back-rim path { stroke: var(--gf-back-rim); stroke-width: 1; transition: stroke .4s var(--gf-ease); }

/* ---- files ---------------------------------------------------------------- */
.gf-files {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  /* nothing hangs out of the bottom of the pocket, however tall the stack */
  clip-path: inset(-400px -400px 10px -400px);
}
.gf-sheet-slot { display: contents; }
.gf-sheet {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  left: 34px;
  top: 96px;
  width: 272px;
  height: 184px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  background: var(--gf-paper);
  box-shadow: var(--gf-paper-sh);
  transform-origin: 50% 100%;
  transform:
    translate(calc(var(--gf-jx) + var(--gf-slot) * var(--gf-spread)), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1))
    rotate(calc(var(--gf-jr) + var(--gf-slot) * var(--gf-fan)));
  transition:
    transform .75s var(--gf-spring) calc(var(--gf-depth) * 40ms),
    box-shadow .4s var(--gf-ease),
    translate .9s var(--gf-ease),
    opacity .9s var(--gf-ease);
}
.gf-sheet--art { background: #1a1a1d; }
.gf-root[data-open] .gf-sheet:hover,
.gf-root[data-open] .gf-sheet:focus-visible {
  transform:
    translate(calc(var(--gf-jx) + var(--gf-slot) * var(--gf-spread)), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1 - 18px))
    rotate(calc(var(--gf-slot) * var(--gf-fan) * .6));
  box-shadow: var(--gf-paper-sh-hi);
  transition-delay: 0s;
}
.gf-sheet:focus-visible { outline: calc(2px / var(--gf-k)) solid var(--gf-focus); outline-offset: 2px; }
.gf-sheet-art {
  position: absolute;
  left: 0;
  top: 0;
  width: 272px;
  height: 184px;
  max-width: none;
  object-fit: cover;
  transition: opacity .9s var(--gf-ease), filter .9s var(--gf-ease);
}
.gf-sheet-svg { display: block; overflow: hidden; }
.gf-sheet-svg > svg, .gf-sheet-svg > img, .gf-sheet-svg > * { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
canvas.gf-sheet-art { opacity: 0; filter: blur(10px); }
canvas.gf-sheet-art[data-ready] { opacity: 1; filter: none; }
canvas.gf-sheet-art[data-instant] { transition: none; }
.gf-sheet--art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, .46) 0%, rgba(0, 0, 0, 0) 38%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  pointer-events: none;
}
/* the name on top, the monospace line under it — readable at any folder size */
.gf-sheet-head {
  position: absolute;
  left: max(14px, calc(9px / var(--gf-k)));
  right: max(14px, calc(9px / var(--gf-k)));
  top: max(11px, calc(6px / var(--gf-k)));
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: max(2px, calc(1px / var(--gf-k)));
  min-width: 0;
  white-space: nowrap;
}
.gf-sheet-name {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: max(12.5px, calc(11.5px / var(--gf-k)));
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--gf-paper-ink);
}
.gf-sheet-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: max(10px, calc(9.5px / var(--gf-k)));
  line-height: 1.3;
  letter-spacing: .02em;
  color: var(--gf-paper-mut);
}
.gf-sheet--art .gf-sheet-name { color: #fafafa; }
.gf-sheet--art .gf-sheet-meta { color: rgba(250, 250, 250, .7); }
.gf-lines {
  position: absolute;
  left: 14px;
  right: 14px;
  top: max(52px, calc(40px / var(--gf-k)));
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.gf-lines i {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--gf-paper-line);
}
.gf-lines i:first-child { height: 9px; margin-bottom: 4px; background: var(--gf-paper-line1); }

.gf-sheet--drop { animation: gf-drop .85s var(--gf-ease) both; }
@keyframes gf-drop {
  0% { translate: 0 -190px; rotate: -9deg; opacity: 0; }
  35% { opacity: 1; }
  72% { translate: 0 10px; rotate: 1deg; }
  100% { translate: 0 0; rotate: 0deg; opacity: 1; }
}

/* ---- front glass ----------------------------------------------------------- */
.gf-front {
  position: absolute;
  left: 0;
  top: 74px;
  width: 340px;
  height: 198px;
  z-index: 10;
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  transform-origin: 50% 100%;
  transform: perspective(760px) rotateX(var(--gf-hinge));
  transition: transform .8s var(--gf-spring), translate 1s var(--gf-ease), opacity 1s var(--gf-ease);
}
.gf-front--bump { animation: gf-bump .7s var(--gf-ease) .38s both; }
@keyframes gf-bump {
  0% { scale: 1; }
  35% { scale: 1.018 .975; }
  70% { scale: .996 1.006; }
  100% { scale: 1; }
}
.gf-tint { position: absolute; inset: 0; background: var(--gf-tint); }
.gf-spec {
  position: absolute;
  inset: 0;
  background: radial-gradient(260px 200px at calc(50% + var(--gf-px) * 46%) calc(30% + var(--gf-py) * 40%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 70%);
  mix-blend-mode: var(--gf-spec-blend);
  opacity: var(--gf-spec-op);
  pointer-events: none;
}
.gf-front-rim { width: 340px; height: 198px; }
.gf-front-rim .gf-rim-base { stroke-width: 2.4; opacity: var(--gf-rim-op); transition: stroke-width .3s var(--gf-ease); }
.gf-front-rim .gf-rim-sel { stroke: var(--gf-sel); stroke-width: 3.2; opacity: 0; transition: opacity .4s var(--gf-ease); }

.gf-hit {
  all: unset;
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}
.gf-hit:focus-visible ~ .gf-label .gf-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.gf-front:has(.gf-hit:focus-visible) .gf-rim-base { stroke-width: 5; }

.gf-label {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: max(4px, calc(2px / var(--gf-k)));
  max-width: 216px;
  pointer-events: none;
  color: var(--gf-ink);
}
.gf-root[data-place="bottom-left"] .gf-label { left: 28px; bottom: 32px; }
.gf-root[data-place="top-left"] .gf-label { left: 28px; top: 34px; }
.gf-root[data-place="top-right"] .gf-label { right: 32px; top: 52px; align-items: flex-start; }
.gf-root[data-action="none"] .gf-label { max-width: 290px; }
.gf-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: max(18px, calc(14.5px / var(--gf-k)));
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
  transition: color .4s var(--gf-ease);
}
.gf-meta {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: max(12px, calc(10.5px / var(--gf-k)));
  letter-spacing: .03em;
  color: var(--gf-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: gf-roll .5s var(--gf-ease) both;
}
@keyframes gf-roll {
  from { opacity: 0; translate: 0 7px; filter: blur(3px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}

/* ---- the key: + or ··· ------------------------------------------------------ */
.gf-key {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 12;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .35s var(--gf-spring), box-shadow .35s var(--gf-ease), opacity .6s var(--gf-ease) .7s, scale .7s var(--gf-spring) .7s;
}
.gf-key:hover { transform: translateY(-2px); }
.gf-key:active { transform: translateY(0) scale(.93); transition-duration: .12s; }
.gf-key:focus-visible { outline: calc(2px / var(--gf-k)) solid var(--gf-focus); outline-offset: 3px; }
.gf-key--add { color: var(--gf-add-c); background: var(--gf-add-bg); box-shadow: var(--gf-add-sh); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.gf-key--more {
  color: var(--gf-more-c);
  background: var(--gf-more-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--gf-more-sh);
}
.gf-key--more[aria-expanded="true"] { transform: scale(.96); }
.gf-glyph { display: block; max-width: none; fill: none; stroke: currentColor; stroke-linecap: round; }
.gf-glyph--plus { width: 26px; height: 26px; stroke-width: max(1.6px, calc(1.1px / var(--gf-k))); animation: gf-turn .6s var(--gf-spring); }
.gf-glyph--more { width: 30px; height: 12px; stroke-width: max(1.7px, calc(1.15px / var(--gf-k))); }
@keyframes gf-turn { from { rotate: -90deg; } to { rotate: 0deg; } }
/* a small folder: the outlined pills of «···» blur into «ooo» — filled dots read as dots */
.gf-root[data-small] .gf-glyph--more rect { fill: currentColor; stroke: none; }
.gf-root[data-small] .gf-glyph--more { width: 26px; }

/* ---- menu: counter-scaled, so it is always at the real size of the platform menus ---- */
.gf-menu {
  position: absolute;
  right: 22px;
  bottom: 90px;
  z-index: 20;
  min-width: 184px;
  padding: 6px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  background: var(--gf-menu-bg);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: var(--gf-menu-sh);
  transform-origin: 100% 100%;
  opacity: 0;
  visibility: hidden;
  transform: scale(calc(1 / var(--gf-k))) translateY(6px) scale(.94);
  transition: opacity .2s var(--gf-ease), transform .32s var(--gf-spring), visibility 0s .32s;
}
.gf-menu[data-open] { opacity: 1; visibility: visible; transform: scale(calc(1 / var(--gf-k))); transition-delay: 0s; }
.gf-menu-item {
  all: unset;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  color: var(--gf-item);
  cursor: pointer;
}
.gf-menu-item:hover, .gf-menu-item:focus-visible { background: var(--gf-item-hov); }
.gf-menu-item:focus-visible { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gf-focus) 60%, transparent); }
.gf-menu-item--danger { color: var(--gf-danger); }

/* ---- selected: a glowing edge; a drop target while a document is dragged ---- */
.gf-root[data-selected] .gf-halo { opacity: .62; transform: none; }
[data-theme="dark"] .gf-root[data-selected] .gf-halo { opacity: .5; }
.gf-root[data-selected] .gf-rim-sel { opacity: .95; }
.gf-root[data-selected] .gf-back-rim path { stroke: color-mix(in srgb, var(--gf-sel) 55%, transparent); stroke-width: 1.6; }
.gf-root[data-selected] .gf-title { color: color-mix(in srgb, var(--gf-sel) 62%, var(--gf-ink)); }
.is-fdrag .gf-root[data-folder-drop] { --gf-hinge: -6deg; }
.gf-root.is-dropzone { --gf-hinge: -18deg; --gf-lift: -24px; --gf-spread: 6px; --gf-stack: 12px; z-index: 3; }
.gf-root.is-dropzone .gf-halo { opacity: .8; transform: scale(1.02); }
.gf-root.is-dropzone .gf-rim-sel { opacity: 1; }

/* ---- entrance: the folder assembles itself ---------------------------------- */
.gf-root:not([data-entered]) .gf-back,
.gf-root:not([data-entered]) .gf-back-rim { translate: 0 22px; opacity: 0; }
.gf-root:not([data-entered]) .gf-sheet { translate: 0 -120px; opacity: 0; }
.gf-root:not([data-entered]) .gf-front { translate: 0 46px; opacity: 0; }
.gf-root:not([data-entered]) .gf-key { opacity: 0; scale: .6; }
.gf-root:not([data-entered]) .gf-shadow { opacity: 0; }
.gf-back { transition: translate 1s var(--gf-ease), opacity .9s var(--gf-ease); }
.gf-root[data-entered] .gf-sheet { transition-delay: calc(var(--gf-depth) * 40ms), 0s, calc(.18s + var(--gf-depth) * 90ms), calc(.18s + var(--gf-depth) * 90ms); }
.gf-root[data-entered] .gf-front { transition-delay: 0s, .42s, .42s; }

@media (prefers-reduced-motion: reduce) {
  .gf-root *, .gf-root *::before, .gf-root *::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
  .gf-tilt { transform: none; }
}

/* round G2: «···» — filled dots at every size (the outlined pills of the original read as «ooo» on the owner's screens) */
.gf-root .gf-glyph--more rect { fill: currentColor; stroke: none; }
.gf-root .gf-glyph--more { width: 26px; }
