/* =============================================================
   Homepage product grid — frosted dark glass cards (home.js)
   Each card is a dark glass tile: the art in a rounded frame, and a
   blurred glass panel floating over its lower edge. Soft coloured light
   sits behind the grid so the glass has something to frost.
   Keeps .gal's column breakpoints (3 → 2 at 960px → 1 at 560px).
   ============================================================= */
.gal-glass {
  --gl-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  isolation: isolate;
  gap: 28px;
  background: none;
  border: none;
}

/* Ambient light behind the cards: warm orange and a violet counter-glow. */
.gal-glass::before {
  content: "";
  position: absolute;
  inset: -6% -4%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 18% 22%, rgba(255, 107, 53, .28), transparent 70%),
    radial-gradient(34% 28% at 82% 48%, rgba(140, 90, 255, .22), transparent 70%),
    radial-gradient(40% 30% at 42% 88%, rgba(255, 107, 53, .16), transparent 70%);
  filter: blur(40px);
}
/* Where the grid is the full width of a phone, the glow's 4% overhang on
   each side poked past the screen: Chrome widened the whole page to fit it
   and Safari let it be dragged sideways. It stays inside the grid there. */
@media (max-width: 760px) { .gal-glass::before { inset: -6% 0; } }

.gl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .02) 45%, rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 24px 50px -30px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  transition: transform .5s var(--gl-ease), border-color .4s ease, box-shadow .5s ease;
  /* backwards, not both: a finished animation holding transform:none would
     override the hover lift below. */
  animation: gl-in .8s var(--gl-ease) backwards;
  animation-delay: calc(var(--gl-i, 0) * 70ms);
}
@keyframes gl-in {
  from { opacity: 0; transform: translateY(22px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Gradient rim that lights up orange on hover. */
.gl-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 107, 53, .9), rgba(255, 212, 0, .35) 40%, rgba(140, 90, 255, .5) 80%, rgba(255, 107, 53, .7));
  -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 exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

/* A slow sheen that sweeps across the glass on hover. */
.gl-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .10) 45%, transparent 60%);
  background-size: 250% 100%;
  background-position: 120% 0;
  opacity: 0;
  z-index: 5;
}

.gl-card:hover {
  transform: translateY(-8px);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 34px 60px -30px rgba(0, 0, 0, .95),
    0 0 50px -18px rgba(255, 107, 53, .45);
}
.gl-card:hover::before { opacity: 1; }
.gl-card:hover::after { opacity: 1; animation: gl-sheen 1.1s ease forwards; }
@keyframes gl-sheen { from { background-position: 120% 0; } to { background-position: -40% 0; } }

/* ---- the art ---- */
.gal-glass .gl-media {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #121211;
}
.gal-glass .gl-media img {
  transition: transform .9s var(--gl-ease), filter .6s ease;
}
.gal-glass .gl-card:hover .gl-media img { transform: scale(1.06); }

/* Server-rendered cards (/shop, wishlist, product pages) wrap the photo in
   a link; it fills the frame. The wishlist heart sits top-right, so the
   multi-image badge moves over beside it. */
.gl-link { display: block; width: 100%; height: 100%; }
.gal-glass a.gl-buy { text-decoration: none; }

/* The existing multi-image badge (⧉), restyled as glass to match. */
.gal-glass .has-slides .piece-frame::after,
.gal-glass .gl-card.has-slides .piece-frame::after {
  top: 12px; right: 12px;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(10, 10, 10, .45);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
/* Beside the wishlist heart rather than under it (more specific than the rule above). */
.gal-glass .gl-card.has-slides .piece-frame:has(.wish-form)::after { top: 20px; right: 62px; }

.gl-tag {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--body);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tx);
  background: rgba(10, 10, 10, .45);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.gl-tag.hot  { color: #0A0A0A; background: rgba(255, 107, 53, .9); border-color: rgba(255, 190, 150, .6); }
.gl-tag.new  { color: #0A0A0A; background: rgba(163, 230, 53, .9); border-color: rgba(220, 255, 170, .6); }
.gl-tag.sale { color: var(--tx); background: rgba(231, 56, 67, .85); border-color: rgba(255, 160, 165, .5); }

/* ---- frosted info panel, floating over the bottom of the art ----
   On hover it grows upward to make room for the button: the top margin
   moves up by exactly what the bottom padding gains, so the card's height
   never changes and nothing else in the row moves. */
.gl-card { --gl-btn: 52px; }
.gl-body {
  position: relative;
  z-index: 4;
  margin: -58px 10px 2px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 22, 20, .55), rgba(12, 12, 11, .8));
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 16px 30px -18px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
          backdrop-filter: blur(16px) saturate(150%);
  transition: margin-top .5s var(--gl-ease), padding-bottom .5s var(--gl-ease);
}
.gl-card:hover .gl-body,
.gl-card:focus-within .gl-body {
  margin-top: calc(-58px - var(--gl-btn));
  padding-bottom: calc(16px + var(--gl-btn));
}

.gl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gl-name {
  min-width: 0;
  font-family: var(--head);
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gl-name a { color: var(--tx); }
.gl-name a:hover { color: var(--acc); }
.gl-price { flex: none; font-family: var(--head); font-size: 1.2rem; color: var(--tx); }
.gl-price s { color: var(--tx3); font-family: var(--body); font-weight: 400; font-size: .8rem; margin-left: 6px; }
/* Same Raleway SemiBold credit line as every other "by [partner]" (site.css). */
.gl-by { font-family: 'Raleway', var(--body); font-weight: 600; font-size: .9rem; line-height: 1.3; color: var(--acc); margin-top: 4px; }

/* The button sits in the room the panel makes at its bottom: hidden until
   hover on desktop, always there on touch. */
.gal-glass .gl-buy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  top: auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  opacity: 0;
  transform: translateY(10px);
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF6B35, #FF8A4C);
  color: #0A0A0A;
  font-family: var(--body);
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: none;
  transition: opacity .25s ease, transform .45s var(--gl-ease), background .25s ease, box-shadow .3s ease;
}
.gal-glass .gl-buy span { transition: transform .3s var(--gl-ease); }
.gal-glass .gl-card:hover .gl-buy,
.gal-glass .gl-card:focus-within .gl-buy {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: .12s, .08s, 0s, 0s;
}
.gal-glass .gl-buy:hover { background: linear-gradient(135deg, #FFD400, #FFB000); box-shadow: 0 8px 22px -8px rgba(255, 190, 0, .6); }
.gal-glass .gl-buy:hover span { transform: translateX(4px); }
.gal-glass .gl-buy:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

.gl-chip { display: none; }

/* ---- touch screens: the photo leads ----
   At rest the card is the art plus a small glass price tag. Tapping the card
   (home.js adds .is-revealed) pops the frosted panel up over the photo with
   the name, partner, price and button. */
@media (hover: none) {
  .gl-card:hover { transform: none; }
  .gl-card:hover::before, .gl-card:hover::after { opacity: 0; animation: none; }

  .gl-chip {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 13px;
    border-radius: 999px;
    font-family: var(--head);
    font-size: 1rem;
    letter-spacing: .02em;
    color: var(--tx);
    background: rgba(10, 10, 10, .45);
    border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
            backdrop-filter: blur(12px) saturate(140%);
    transition: opacity .25s ease, transform .35s var(--gl-ease);
  }
  .gl-chip i {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-style: normal;
    font-family: var(--body);
    font-weight: 800;
    font-size: .95rem;
    line-height: 1;
    color: #0A0A0A;
    background: var(--acc);
  }

  /* The panel floats over the photo instead of sitting under it. */
  .gl-card .gl-body,
  .gl-card:hover .gl-body,
  .gl-card:focus-within .gl-body {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    margin: 0;
    padding-bottom: calc(16px + var(--gl-btn));
    opacity: 0;
    transform: translateY(14px) scale(.96);
    transform-origin: 50% 100%;
    pointer-events: none;
    transition: opacity .25s ease, transform .45s var(--gl-ease);
  }
  .gal-glass .gl-buy,
  .gal-glass .gl-card:hover .gl-buy,
  .gal-glass .gl-card:focus-within .gl-buy { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }

  .gl-card.is-revealed .gl-body {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .gl-card.is-revealed .gl-chip { opacity: 0; transform: translateY(6px); }
  .gl-card.is-revealed {
    border-color: rgba(255, 107, 53, .45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 40px -16px rgba(255, 107, 53, .5);
  }
  .gl-card.is-revealed .gl-media img { transform: scale(1.04); }
}

@media (max-width: 960px) {
  .gal-glass { gap: 20px; }
}
@media (max-width: 560px) {
  .gal-glass { gap: 18px; }
  .gl-card { border-radius: 22px; }
  .gl-name { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-card, .gl-card::after, .gl-body, .gal-glass .gl-media img, .gal-glass .gl-buy { animation: none !important; transition: none !important; }
  .gl-card:hover, .gl-card:hover .gl-body { transform: none; }
}

/* Slower devices: keep the look, drop the blur work. */
.perf-lite .gl-card, .perf-lite .gl-body, .perf-lite .gl-tag {
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
}
.perf-lite .gl-body { background: rgba(14, 14, 13, .92); }
.perf-lite .gal-glass::before { filter: none; opacity: .6; }

/* Phones and tablets: the frost without the blur. Each card was three
   backdrop blurs (card, panel, price chip) re-blurring whatever was behind
   them on every frame of a scroll — 27 on the homepage's nine cards, and
   the slowest thing a phone's GPU can be asked to do, Safari worst of all.
   The card keeps its own tint; the panel and chip go a little more opaque,
   as perf-lite already does on slow desktops.  */
@media (hover: none) and (pointer: coarse) {
  .gl-card, .gl-body, .gl-chip, .gl-tag,
  .gal-glass .has-slides .piece-frame::after, .gal-glass .gl-card.has-slides .piece-frame::after {
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }
  .gl-body { background: rgba(14, 14, 13, .92); }
  .gl-chip { background: rgba(14, 14, 13, .86); }
  .gal-glass::before { filter: none; opacity: .6; }
}
