/* Projects as glass folders in a zigzag (assets/js/ux/glass-folder.js).
   The folder styles are ported from "Glass Folder Cards" on 21st.dev and set in the page tokens.
   Without JavaScript a folder is a plain card with a link list; everything below .gf--live / .trail--live is the
   built folder. --gf-k scales a folder (stage 340 × 272 plus 54 px above for the rising sheets). */

/* ---- section ---------------------------------------------------------------- */
.trail { --gf-k: 1; --trail-gap: clamp(120px, 14vw, 240px); position: relative; z-index: 2; padding: 14vh var(--margin) 8vh; overflow-x: clip; }
.trail__head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 8vh; }
.trail__head h2 { font: 800 clamp(34px, 5vw, 84px)/1 var(--sans); letter-spacing: -.04em; }
.trail__head .mono { color: var(--ink-faint); }
.trail__grid { position: relative; z-index: 1; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); max-width: 1080px; margin: 0 auto; }

/* Zigzag: folder 1 left, 2 right half a folder lower, 3 left, 4 right. */
.trail--live .trail__grid { --row: calc(190px * var(--gf-k)); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: var(--row);
  column-gap: var(--trail-gap); row-gap: 0; justify-items: center; }
.trail--live .gf:nth-of-type(1) { grid-area: 1 / 1 / span 2; }
.trail--live .gf:nth-of-type(2) { grid-area: 2 / 2 / span 2; }
.trail--live .gf:nth-of-type(3) { grid-area: 3 / 1 / span 2; }
.trail--live .gf:nth-of-type(4) { grid-area: 4 / 2 / span 2; }

@media (max-width: 900px) {
  .trail--live .trail__grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; row-gap: 56px; justify-items: start; max-width: 540px; }
  .trail--live .gf:nth-of-type(n) { grid-area: auto; }
  .trail--live .gf:nth-of-type(even) { justify-self: end; }
}
@media (max-width: 600px) { .trail { --gf-k: .9; } }
@media (max-width: 380px) { .trail { --gf-k: .8; } }

/* ---- folder without JavaScript: a card with a link list ----------------------- */
.gf { position: relative; }
/* Set like .mono, but not a label: the line ("Website · Konzept") belongs to the text (llms-full.txt keeps it). */
.gf-meta { font: 500 11px/1.45 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.gf:not(.gf--live) { padding: 22px 24px 24px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 18px; }
.gf:not(.gf--live) .gf-title { margin: 0; font: 600 20px/1.2 var(--sans); letter-spacing: -.01em; }
.gf:not(.gf--live) .gf-meta { margin: 6px 0 14px; color: var(--ink-faint); }
.gf:not(.gf--live) .gf-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.gf:not(.gf--live) .gf-list a { text-underline-offset: 3px; }
.gf:not(.gf--live) .gf-list a:hover { color: var(--gold); }
.gf:not(.gf--live) .gf-key { display: none; }
.gf:not(.gf--live)[data-tone="dark"] { background: var(--bg-sunk); }

/* ---- built folder ----------------------------------------------------------------- */
.gf--live {
  --gf-px: 0;
  --gf-py: 0;
  --gf-ease: cubic-bezier(.2, .8, .2, 1);
  --gf-spring: cubic-bezier(.34, 1.36, .5, 1);
  --gf-lean: 0;
  --gf-lift: 42px;
  --gf-spread: 0px;
  --gf-fan: 0deg;
  --gf-stack: 15px;
  --gf-ink: #17191D;
  --gf-ink-soft: #545A66;
  width: calc(340px * var(--gf-k));
  height: calc(326px * var(--gf-k));
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.gf--live[data-tone="dark"] { --gf-ink: #F5F5F7; --gf-ink-soft: #A6A6AB; }
/* Lean on hover (real hover only, so a tap leaves nothing behind) and on keyboard focus (a mouse click focuses the
   button too, which :focus-within would hold in the lean). */
.gf--live:has(:focus-visible) { --gf-lean: .45; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; }
@media (hover: hover) { .gf--live:hover { --gf-lean: .45; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; } }
.gf--live[data-open] { --gf-lean: 1; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 5deg; --gf-stack: 30px; }

.gf-stage { position: absolute; left: 0; top: 0; width: 340px; height: 272px; transform-origin: 0 0;
  transform: translateY(calc(54px * var(--gf-k))) scale(var(--gf-k)); }
/* Follows the pointer in 2D as well (the original rotates in 3D, see the front glass below). */
.gf-tilt { position: absolute; inset: 0;
  transform: translate(calc(var(--gf-px) * 4px), calc(var(--gf-py) * 3px)) rotate(calc(var(--gf-px) * .8deg));
  transition: transform .9s var(--gf-ease); }

.gf-shadow { position: absolute; left: 18px; right: 18px; bottom: -6px; height: 60px; border-radius: 40px; background: rgb(0 0 0 / .7);
  filter: blur(22px); transform: translateX(calc(var(--gf-px) * -8px)); transition: transform .9s var(--gf-ease), opacity .9s var(--gf-ease); }
.gf--live[data-tone="dark"] .gf-shadow { background: rgb(0 0 0 / .8); }

.gf-back { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #F3F3F4 0%, #E2E2E6 100%); }
.gf--live[data-tone="dark"] .gf-back { background: linear-gradient(180deg, #2E2E32 0%, #141416 100%); }
.gf-art { position: absolute; left: -12px; top: -12px; width: 364px; height: 296px; 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); }
canvas.gf-art { opacity: 0; }
canvas.gf-art[data-ready] { opacity: 1; }
.gf-back-sheen { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgb(255 255 255 / .22) 0%, rgb(255 255 255 / 0) 22%),
    radial-gradient(120% 80% at 80% 0%, rgb(255 255 255 / .16), rgb(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: rgb(255 255 255 / .45); stroke-width: 1; }
.gf--live[data-tone="dark"] .gf-back-rim path { stroke: rgb(255 255 255 / .16); }

/* ---- files ------------------------------------------------------------------------- */
/* Nothing hangs out of the bottom of the pocket, however tall the stack. */
.gf-files { position: absolute; inset: 0; z-index: 5; pointer-events: none; clip-path: inset(-400px -400px 10px -400px); }
.gf--live .gf-list { margin: 0; padding: 0; list-style: none; }
.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: linear-gradient(180deg, #FFFFFF 0%, #F2F2F0 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), 0 0 0 .5px rgb(0 0 0 / .1), 0 10px 26px -8px rgb(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), translate .9s var(--gf-ease), opacity .9s var(--gf-ease);
}
.gf--live[data-tone="dark"] .gf-sheet { background: linear-gradient(180deg, #2C2C30 0%, #1E1E21 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 0 0 .5px rgb(255 255 255 / .08), 0 12px 28px -8px rgb(0 0 0 / .7); }
.gf-sheet--art { background: #17191D; }
.gf--live[data-open] .gf-sheet:hover,
.gf--live[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: inset 0 1px 0 rgb(255 255 255 / .9), 0 0 0 .5px rgb(0 0 0 / .1), 0 22px 40px -12px rgb(10 12 20 / .42);
  transition-delay: 0s;
}
.gf-sheet:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gf-sheet-art { position: absolute; left: 0; top: 0; width: 272px; height: 184px; max-width: none; object-fit: cover; object-position: top; }
.gf-sheet--art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgb(0 0 0 / .72) 0, rgb(0 0 0 / .45) 34px, rgb(0 0 0 / 0) 70px); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2); }
.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: 600 12.5px/1.3 var(--sans); letter-spacing: -.005em; color: #17191D; }
.gf-sheet-meta { flex: none; font: 500 10px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #545A66; }
.gf--live[data-tone="dark"] .gf-sheet-name, .gf-sheet--art .gf-sheet-name { color: #FFFFFF; }
.gf--live[data-tone="dark"] .gf-sheet-meta { color: #A6A6AB; }
.gf-sheet--art .gf-sheet-meta { color: #FFFFFF; }
.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: rgb(23 25 29 / .08); }
.gf-lines i:first-child { height: 9px; margin-bottom: 4px; background: rgb(23 25 29 / .14); }
.gf--live[data-tone="dark"] .gf-lines i { background: rgb(255 255 255 / .08); }
.gf--live[data-tone="dark"] .gf-lines i:first-child { background: rgb(255 255 255 / .16); }

/* ---- front glass, leaning forward from its bottom edge -------------------------------------
   The original tips the glass with a 3D rotateX. At a device pixel ratio of 2 Chromium then paints the sheets over
   the glass and drops most of the blur (any 3D rotation in the folder does), so the lean is a 2D scale here:
   a little wider and shorter, which reads the same. */
.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: scale(calc(1 + var(--gf-lean) * .04), calc(1 - var(--gf-lean) * .1));
  transition: transform .8s var(--gf-spring), translate 1s var(--gf-ease), opacity 1s var(--gf-ease); }
.gf-tint { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(255 255 255 / .16) 0%, rgb(255 255 255 / .5) 42%, rgb(252 252 252 / .93) 100%); }
.gf--live[data-tone="dark"] .gf-tint { background: linear-gradient(180deg, rgb(18 18 20 / .18) 0%, rgb(14 14 16 / .62) 46%, rgb(8 8 10 / .94) 100%); }
.gf-spec { position: absolute; inset: 0; pointer-events: none; opacity: .9; mix-blend-mode: soft-light;
  background: radial-gradient(260px 200px at calc(50% + var(--gf-px) * 46%) calc(30% + var(--gf-py) * 40%), rgb(255 255 255 / .5), rgb(255 255 255 / 0) 70%); }
.gf--live[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--live[data-tone="dark"] .gf-front-rim { opacity: .55; }

.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-front-rim path { stroke-width: 5; }

.gf-label { position: absolute; left: 28px; bottom: 30px; z-index: 2; display: flex; flex-direction: column; gap: 6px; max-width: 200px; pointer-events: none; color: var(--gf-ink); }
.gf-label .gf-title { margin: 0; font: 600 19px/1.15 var(--sans); letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-label .gf-meta { margin: 0; color: var(--gf-ink-soft); white-space: nowrap; }

/* ---- key: only "Dein Projekt" has one, a link that starts the enquiry ------------------- */
.gf-key { 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; color: var(--gold-ink); text-decoration: none;
  background: radial-gradient(120% 90% at 50% 0%, #FFE58A 0%, var(--gold) 55%, var(--gold-deep) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -3px 8px rgb(120 70 0 / .3), 0 0 0 1px rgb(0 0 0 / .5), 0 14px 26px -8px rgb(255 170 0 / .45);
  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 svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: transform .5s var(--gf-spring); }
.gf-key:hover { transform: translateY(-2px); }
.gf-key:hover svg { transform: rotate(90deg); }
.gf-key:active { transform: translateY(0) scale(.93); transition-duration: .12s; }
.gf-key:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- entrance: the folder assembles itself the first time it is on screen ------------------ */
.gf--live:not([data-entered]) .gf-back,
.gf--live:not([data-entered]) .gf-back-rim { translate: 0 22px; opacity: 0; }
.gf--live:not([data-entered]) .gf-sheet { translate: 0 -120px; opacity: 0; }
.gf--live:not([data-entered]) .gf-front { translate: 0 46px; opacity: 0; }
.gf--live:not([data-entered]) .gf-key { opacity: 0; scale: .6; }
.gf--live:not([data-entered]) .gf-shadow { opacity: 0; }
/* Not there yet: nothing in it takes a press (Tab still reaches it, and focus makes it assemble). */
.gf--live:not([data-entered]) { pointer-events: none; }
.gf-back, .gf-back-rim { transition: translate 1s var(--gf-ease), opacity .9s var(--gf-ease); }
.gf--live[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--live[data-entered] .gf-front { transition-delay: 0s, .42s, .42s; }

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