/* Home quotes: thick glass panels floating in depth (src/quotes.js, public/js/quotes.js).
   Each panel: a blurred body, a bright rim that fades around the edge, inner light, and a highlight that follows the
   pointer. The colour orbs give the glass something to bend. Without JS: a horizontal scroll-snap row. */
.quotes {
  --rim: color-mix(in srgb, white 92%, transparent);
  --rim-soft: color-mix(in srgb, white 14%, transparent);
  --sheen: color-mix(in srgb, white 46%, transparent);
  --pane: color-mix(in srgb, white 44%, transparent);
  --pane-2: color-mix(in srgb, white 22%, transparent);
  --drop: color-mix(in srgb, var(--ink) 22%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .quotes {
    --rim: color-mix(in srgb, white 58%, transparent); --rim-soft: color-mix(in srgb, white 6%, transparent);
    --sheen: color-mix(in srgb, white 14%, transparent);
    --pane: color-mix(in srgb, var(--bg) 46%, transparent); --pane-2: color-mix(in srgb, var(--bg) 30%, transparent);
    --drop: color-mix(in srgb, black 52%, transparent);
  }
}
:root[data-theme="dark"] .quotes {
  --rim: color-mix(in srgb, white 58%, transparent); --rim-soft: color-mix(in srgb, white 6%, transparent);
  --sheen: color-mix(in srgb, white 14%, transparent);
  --pane: color-mix(in srgb, var(--bg) 46%, transparent); --pane-2: color-mix(in srgb, var(--bg) 30%, transparent);
  --drop: color-mix(in srgb, black 52%, transparent);
}

.quotes__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; }
.quotes__filter, .quotes__controls { display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: var(--radius-pill); background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--shadow-glass), inset 0 1px 0 var(--rim-soft); }
:is(.quotes__filter, .quotes__controls)[hidden] { display: none; }
.quotes__filter button { min-height: 44px; padding: 0 1.1em; border: 0; border-radius: var(--radius-pill); background: none; color: var(--text); font: 600 .88rem/1 var(--font-body); cursor: pointer; transition: background .25s ease, box-shadow .25s ease; }
.quotes__filter button:hover { background: var(--glass-bg); }
.quotes__filter button[aria-pressed="true"] { background: var(--glass-bg-hover); box-shadow: inset 0 1px 0 var(--rim), 0 2px 10px var(--drop); }

.quotes__deck { position: relative; display: grid; justify-items: center; gap: 28px; }
.quotes__orb { position: absolute; border-radius: 50%; pointer-events: none; opacity: .5; }
.quotes__orb--1 { width: 270px; height: 270px; left: 7%; top: 2%; background: radial-gradient(circle at 32% 28%, var(--sand), var(--terracotta) 72%); }
.quotes__orb--2 { width: 200px; height: 200px; right: 9%; bottom: 14%; background: radial-gradient(circle at 32% 28%, var(--sand), var(--sky) 72%); }
.quotes__orb--3 { width: 110px; height: 110px; right: 17%; top: 0; background: radial-gradient(circle at 32% 28%, var(--sand), var(--ochre) 72%); }

.quotes__stage { list-style: none; margin: 0; padding: 8px 0 24px; width: 100%; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
.quote { --r: 36px; position: relative; flex: 0 0 min(560px, 86%); scroll-snap-align: center; border-radius: var(--r);
  background: linear-gradient(140deg, var(--pane), var(--pane-2) 55%, var(--pane));
  -webkit-backdrop-filter: blur(24px) saturate(125%); backdrop-filter: blur(24px) saturate(125%);
  box-shadow: 0 34px 80px -18px var(--drop), 0 8px 22px -8px var(--drop), inset 0 0 34px var(--rim-soft), inset 0 -14px 30px -20px var(--sheen); }
.quote[hidden] { display: none !important; }
/* rim: a 1.5px gradient stroke, brightest top-left and bottom-right like light through a thick edge */
.quote::before { content: ''; position: absolute; inset: 0; z-index: 2; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, var(--rim), var(--rim-soft) 34%, var(--rim-soft) 64%, var(--rim));
  -webkit-mask: linear-gradient(black 0 0) content-box exclude, linear-gradient(black 0 0); mask: linear-gradient(black 0 0) content-box exclude, linear-gradient(black 0 0); }
/* light: follows the pointer on the front panel */
.quote::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 75% at calc(50% + var(--px, -.6) * 42%) calc(50% + var(--py, -.9) * 46%), var(--sheen), transparent 70%); }
.quote__in { position: relative; z-index: 1; height: 100%; min-height: 340px; margin: 0; padding: clamp(28px, 5vw, 60px); display: flex; flex-direction: column; justify-content: center; gap: 22px; transition: opacity .35s ease; }
.quote__mark { height: .42em; font: 5.5rem/1 var(--font-display); color: var(--link); }
.quote blockquote { margin: 0; font: 400 clamp(1.5rem, 3.1vw, 2.35rem)/1.32 var(--font-display); letter-spacing: -.01em; color: var(--heading); overflow-wrap: anywhere; text-wrap: pretty; }
.quote--mid blockquote { font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.45; }
.quote--long blockquote { font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.6; }
.quote figcaption { display: grid; gap: 2px; line-height: 1.4; overflow-wrap: anywhere; }
.quote__who { font-weight: 700; color: var(--text); }
.quote__source { font-size: .92rem; color: var(--text); }

/* the deck: every panel shares one grid cell; --o (0 front … 3) sets how far back it floats */
.is-spatial .quotes__stage { --step: 34px; width: min(100%, 800px); display: grid; overflow: visible; padding: calc(var(--behind, 2) * var(--step)) 0 0; perspective: 1300px; perspective-origin: 50% 30%; touch-action: pan-y; }
.is-spatial .quote { grid-area: 1 / 1; min-width: 0;
  transform: translate3d(0, calc(var(--o) * var(--step) * -1.6), calc(var(--o) * -130px)); opacity: calc(1 - var(--o) * .16);
  transition: transform .7s var(--ease-out), opacity .5s ease; }
.is-spatial .quote:not(.is-front) { cursor: pointer; }
.is-spatial .quote:not(.is-front) .quote__in { opacity: 0; }
.is-spatial .quote.is-far { opacity: 0; pointer-events: none; }
.is-spatial .quote.is-front { transform: rotateX(calc(var(--py, 0) * -4deg)) rotateY(calc(var(--px, 0) * 5deg)); transition-duration: .5s; }

.quotes__controls { position: relative; z-index: 60; }
.quotes__controls button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; transition: background .25s ease; }
.quotes__controls button:hover { background: var(--glass-bg-hover); }
.quotes__controls svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quotes__controls p { min-width: 4.5em; margin: 0; text-align: center; font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
:is(.quotes__filter, .quotes__controls) button:focus-visible { border-radius: var(--radius-pill); outline-offset: 0; }

@media (max-width: 767px) {
  .quote { --r: 28px; }
  .quote__in { min-height: 300px; }
  .is-spatial .quotes__stage { --step: 22px; }
  .quotes__orb--1 { width: 190px; height: 190px; left: -8%; }
  .quotes__orb--2 { width: 150px; height: 150px; right: -6%; }
}
/* solid panels when glass isn't available or wanted */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .quote { background: var(--bg); } }
@media (prefers-reduced-transparency: reduce) { .quote, .quotes__filter, .quotes__controls { background: var(--bg); } .quote::after, .quotes__orb { display: none; } }
@media (prefers-reduced-motion: reduce) { .is-spatial .quote.is-front { transform: none; } }
