/* Stack Menu: glass stack folders, shared by the homepage and the Stack library page. */
/* ---------- Stack library: glass folders (adapted from the Glass Folder Cards component) ---------- */
.gf-cell { width: 100%; max-width: 260px; }
.gf-root {
  --gf-px: 0; --gf-py: 0;
  --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;
  --gf-ink: #141416; --gf-ink-soft: rgba(20, 20, 22, .6);
  position: relative; display: block; width: 100%;
  font-family: Geist, Inter, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent; isolation: isolate;
}
.gf-root[data-tone="dark"] { --gf-ink: #f5f5f7; --gf-ink-soft: rgba(245, 245, 247, .62); }
/* Hover lifts the files far enough that every sheet's name and type clears the glass */
.gf-root:hover, .gf-root:focus-within { --gf-hinge: -11deg; --gf-lift: -50px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 28px; }
.gf-root[data-open] { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 5deg; --gf-stack: 30px; }
/* Desktop (mouse): hovering a multi-file folder fans it fully open, so one click on a file opens it */
@media (hover: hover) and (pointer: fine) {
  :not([data-single-file]) > .gf-cell > .gf-root:hover { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 5deg; --gf-stack: 30px; }
  /* Single-file folders (recommendation page): the guide rises a little higher and the glass leans a little further, so more of the sheet shows */
  [data-single-file] > .gf-cell > .gf-root:hover, [data-single-file] > .gf-cell > .gf-root:focus-within { --gf-hinge: -15deg; --gf-lift: -68px; }
}
.gf-stage { position: absolute; left: 0; top: 0; width: 340px; height: 272px; transform-origin: 0 0; }
.gf-tilt { position: absolute; inset: 0; 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: rgba(16, 18, 24, .3); filter: blur(22px); transform: translateX(calc(var(--gf-px) * -8px)); transition: transform .9s var(--gf-ease); }
.gf-root[data-tone="dark"] .gf-shadow { background: rgba(0, 0, 0, .62); }
.gf-back { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #f3f3f4 0%, #e3e3e6 100%); }
.gf-root[data-tone="dark"] .gf-back { background: linear-gradient(180deg, #2a2a2e 0%, #121214 100%); }
.gf-art { position: absolute; left: -12px; top: -12px; max-width: none; 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); opacity: 0; filter: blur(14px) saturate(.6); }
.gf-art[data-ready] { opacity: 1; filter: none; }
.gf-back-sheen { position: absolute; inset: 0; pointer-events: none; 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%); }
.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; }
.gf-back-rim path { stroke: rgba(255, 255, 255, .45); stroke-width: 1; }
.gf-root[data-tone="dark"] .gf-back-rim path { stroke: rgba(255, 255, 255, .16); }

.gf-files { position: absolute; inset: 0; z-index: 5; pointer-events: none; clip-path: inset(-400px -400px 10px -400px); }
.gf-sheet-slot { display: contents; }
.gf-sheet {
  box-sizing: border-box; position: absolute; left: 34px; top: 96px; width: 272px; height: 184px;
  border-radius: 16px; overflow: hidden; pointer-events: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f0 100%);
  box-shadow: 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);
  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);
}
.gf-root[data-tone="dark"] .gf-sheet { background: linear-gradient(180deg, #2c2c30 0%, #1c1c1f 100%); box-shadow: 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-root[data-open] .gf-sheet:hover,
:not([data-single-file]) > .gf-cell > .gf-root:hover .gf-sheet:hover {
  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: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1.5px rgba(23, 23, 23, .28), 0 22px 40px -12px rgba(10, 12, 20, .42);
  transition-delay: 0s;
}
/* Hovering a single file outlines it, to signal it will open its own page (no action wired yet) */
.gf-sheet { cursor: pointer; }
.gf-sheet:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1.5px rgba(23, 23, 23, .28), 0 10px 26px -8px rgba(10, 12, 20, .28); }
.gf-root[data-tone="dark"] .gf-sheet:hover,
.gf-root[data-tone="dark"][data-open] .gf-sheet:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 1.5px rgba(237, 237, 237, .3), 0 12px 28px -8px rgba(0, 0, 0, .7); }
.gf-sheet-head { position: absolute; left: 14px; right: 14px; top: 11px; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; white-space: nowrap; }
.gf-sheet-name { overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 500; color: #18181b; }
.gf-sheet-meta { flex: none; font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace; font-size: 12.5px; letter-spacing: .02em; color: rgba(24, 24, 27, .6); }
.gf-root[data-tone="dark"] .gf-sheet-name { color: #fafafa; }
.gf-root[data-tone="dark"] .gf-sheet-meta { color: rgba(250, 250, 250, .66); }
.gf-lines { position: absolute; left: 14px; right: 14px; top: 40px; display: flex; flex-direction: column; gap: 9px; }
.gf-lines i { display: block; height: 5px; border-radius: 3px; background: rgba(24, 24, 27, .08); }
.gf-lines i:first-child { height: 9px; margin-bottom: 4px; background: rgba(24, 24, 27, .14); }
.gf-root[data-tone="dark"] .gf-lines i { background: rgba(255, 255, 255, .08); }
.gf-root[data-tone="dark"] .gf-lines i:first-child { background: rgba(255, 255, 255, .16); }

.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); }
.gf-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .5) 42%, rgba(252, 252, 252, .93) 100%); }
.gf-root[data-tone="dark"] .gf-tint { background: linear-gradient(180deg, rgba(18, 18, 20, .18) 0%, rgba(14, 14, 16, .62) 46%, rgba(8, 8, 10, .94) 100%); }
.gf-spec { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .9; 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%); }
.gf-root[data-tone="dark"] .gf-spec { mix-blend-mode: screen; opacity: .16; }
.gf-front-rim { width: 340px; height: 198px; }
.gf-front-rim path { stroke-width: 2.4; transition: stroke-width .3s var(--gf-ease); }
.gf-root[data-tone="dark"] .gf-front-rim { opacity: .55; }
.gf-hit { position: absolute; inset: 0; z-index: 1; cursor: pointer; background: transparent; border: 0; padding: 0; }
.gf-hit:focus-visible { outline: none; }
.gf-front:has(.gf-hit:focus-visible) .gf-front-rim path { stroke-width: 5; }
.gf-hit:focus-visible ~ .gf-label .gf-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.gf-label { position: absolute; left: 28px; bottom: 32px; z-index: 2; display: flex; flex-direction: column; gap: 4px; max-width: 240px; pointer-events: none; color: var(--gf-ink); }
.gf-title { font-size: 18px; font-weight: 500; line-height: 1.15; letter-spacing: -.012em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-meta { font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .03em; color: var(--gf-ink-soft); white-space: nowrap; }

@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; }
}

/* ---------- Single-file mode tooltip (data-single-file): a short stack description, desktop hover and keyboard focus ---------- */
/* Pages that scale folders set --gf-tip-scale (1 / scale) on the cell so the tooltip stays full size */
[data-single-file] .gf-cell { position: relative; }
.gf-tip {
  position: absolute; left: 50%; top: 0; z-index: 40; width: max-content; max-width: 240px;
  padding: 10px 12px; border-radius: 6px; background: var(--ink); color: var(--canvas);
  font-size: 13px; line-height: 18px; font-weight: 400; text-align: left;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .3);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform-origin: 50% 100%; transform: translate(-50%, calc(-100% + 4px)) scale(var(--gf-tip-scale, 1)); transition: opacity .12s, transform .12s, visibility .12s;
}
.gf-tip b { display: block; margin-bottom: 2px; font-weight: 600; }
@media (hover: hover) {
  .gf-cell:hover > .gf-tip { opacity: 1; visibility: visible; transform: translate(-50%, -100%) scale(var(--gf-tip-scale, 1)); transition-delay: .3s; }
}
.gf-cell:has(.gf-hit:focus-visible) > .gf-tip { opacity: 1; visibility: visible; transform: translate(-50%, -100%) scale(var(--gf-tip-scale, 1)); }
@media (prefers-reduced-motion: reduce) { .gf-tip { transition: none; } }

/* Touch screens (single-file mode): no hover lift, so the first tap opens the guide instead of "hovering" */
@media (hover: none) {
  [data-single-file] .gf-root:hover, [data-single-file] .gf-root:focus-within { --gf-hinge: 0deg; --gf-lift: 42px; --gf-spread: 0px; --gf-fan: 0deg; --gf-stack: 15px; }
  [data-single-file] .gf-tilt, [data-single-file] .gf-shadow { transform: none; }
}
