/* Gradients (2026-11-25) · the collection page's own rules: the hero, the Mosaic, and the Gradients half of the viewer.
   Sits on top of v2.css, shelf.css and menu.css; nothing here touches the other collections. */

/* ==========================================================================
   The hero: Aura, as made, drawn wide behind the words
   ========================================================================== */
.band--gradients { --sh: 1, 2, 17; background: #010211; }
.ghero { position: absolute; inset: 0; }
.ghero__poster, .ghero__cv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ghero__cv { opacity: 0; transition: opacity .5s ease-out; }
.ghero.is-drawn .ghero__cv { opacity: 1; }
.band--gradients .band__shade {
  background: linear-gradient(to right, rgba(1, 2, 17, 0.88) 0%, rgba(1, 2, 17, 0.55) 34%, rgba(1, 2, 17, 0) 60%);
}
/* the two sliders: bottom right, as on Shaders; in the card from the start, see-through until Aura is moving */
.page-gradients .band--gradients .sctl { top: auto; bottom: 24px; right: 24px; width: 232px; gap: 8px; transition: opacity .45s ease-out; }
.page-gradients .band--gradients .sctl.is-wait { opacity: 0; pointer-events: none; }
.page-gradients .band--gradients .sctl__val { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
/* the headline is one line here: the line under it comes straight after (the other pages hold two lines for theirs) */
@media (min-width: 641px) { .page-gradients .band .h1 { min-height: 0; max-width: none; } }
@media (max-width: 900px) {
  .band--gradients .band__shade { background: linear-gradient(to right, rgba(1, 2, 17, 0.95) 0%, rgba(1, 2, 17, 0.8) 50%, rgba(1, 2, 17, 0) 94%); }
}
@media (max-width: 640px) {
  .page-gradients .band--gradients .sctl { bottom: 14px; right: 14px; }
  .band--gradients .band__shade {
    background: linear-gradient(to bottom, rgba(1, 2, 17, 0.96) 0%, rgba(1, 2, 17, 0.9) calc(100% - 262px), rgba(1, 2, 17, 0) calc(100% - 120px));
  }
}

/* ==========================================================================
   The Mosaic: one block per structure, in the shape that suits it
   ========================================================================== */
#browse:has(.gmosaic) { padding-top: 28px; }
.gmosaic { --cols: 4; --ratio: 1; gap: 14px; grid-auto-rows: calc((100cqw - (var(--cols) - 1) * 14px) / var(--cols)); }
.gmo { border-radius: 16px; background: #0a0a0c; cursor: pointer; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.gmo::after { display: none; } /* no dark fade along the foot: the picture runs clean to the edge */
.gmo--wide { grid-column: span 2; }
.gmo--tall { grid-row: span 2; }
@media (hover: hover) { .gmo:hover { transform: translateY(-2px); } }
.gmo__still, .gmo__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; }
.gmo__cv { opacity: 0; transition: opacity .3s ease-out; }
.gmo.is-drawn .gmo__cv { opacity: 1; }
.gmo.is-drawn .gmo__still { visibility: hidden; }
.tile.gmo:hover > img { transform: none; }

/* the whole block opens the viewer; it lies under the name and the pills */
.gmo__hit { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: inherit; }
.gmo__hit:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }

/* at rest: the name, the number, and Free where it is */
.gmo__ttl { position: absolute; z-index: 2; left: 16px; top: 14px; display: flex; align-items: baseline; gap: 8px; pointer-events: none; }
.gmo__ttl b { font-family: var(--font-head); font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }
.gmo__ttl span { font-size: 10px; font-weight: 600; letter-spacing: .18em; color: rgba(243, 238, 231, 0.6); font-variant-numeric: tabular-nums; }
.gmo__ttl em {
  align-self: center; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--ink); background: rgba(12, 10, 9, 0.45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.gmo__ttl em::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
/* a pale top: the name in dark ink */
.gmo.is-pale .gmo__ttl b { color: #0b0b0e; text-shadow: none; }
.gmo.is-pale .gmo__ttl span { color: rgba(11, 11, 14, 0.55); }

/* on hover: two frosted pills, bottom left. Wide blocks: side by side. Square and tall: the controls pill above the colours. */
.gmo__pills { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: flex; gap: 6px; align-items: center; pointer-events: none; }
.gmo:not(.gmo--wide) .gmo__pills { flex-direction: column-reverse; align-items: flex-start; }
.gmo__pill {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px;
  background: rgba(12, 12, 14, 0.52); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  opacity: 0; transform: translateY(4px); visibility: hidden;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .22s;
}
.gmo__ctl { padding: 0 12px 0 10px; transition-delay: .04s; color: #fff; cursor: pointer; }
.gmo__ctl svg { flex: none; }
.gmo__pill span { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.65); white-space: nowrap; }
.gmo__ctl span { font-weight: 600; color: #fff; }
.gmo__sw { display: flex; gap: 4px; }
.gmo__sw button {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--c); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.gmo__sw button:hover { transform: scale(1.15); }
.gmo__sw button.is-on { box-shadow: 0 0 0 1.5px rgba(12, 12, 14, 0.6), 0 0 0 3px #fff; }
.gmo__sw button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) {
  .gmo:hover .gmo__pill { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .gmo:hover .gmo__pills { pointer-events: auto; }
}
/* a keyboard on the block (the pills come with it, so Tab reaches the colours) or a first tap on a phone */
.gmo:focus-within .gmo__pill, .gmo.is-armed .gmo__pill { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.gmo:focus-within .gmo__pills, .gmo.is-armed .gmo__pills { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  .gmo, .gmo__pill, .gmo__cv, .ghero__cv { transition: none; }
  .gmo:hover { transform: none; }
}

/* tablets: three across */
@media (max-width: 1100px) { .gmosaic { --cols: 3; } }
/* phones: two across. Wide blocks take the full row, tall ones two rows. */
@media (max-width: 640px) {
  #browse:has(.gmosaic) { padding-top: 20px; }
  .gmosaic { --cols: 2; gap: 10px; grid-auto-rows: calc((100cqw - 10px) / 2); }
  .gmo { border-radius: 14px; }
  .gmo__ttl { left: 12px; top: 11px; gap: 6px; }
  .gmo__ttl b { font-size: 16px; }
  /* stacked on every block: the colours at the foot, the controls pill above them */
  .gmo__pills, .gmo:not(.gmo--wide) .gmo__pills { left: 6px; bottom: 6px; gap: 5px; flex-direction: column-reverse; align-items: flex-start; }
  .gmo__pill { height: 36px; padding: 0 10px 0 5px; gap: 6px; }
  .gmo__pal { height: 48px; padding: 0 12px 0 4px; }
  /* swatches a fingertip wide, spaced so a tap lands on the one meant: three on a narrow block, four on a wide one */
  .gmo__sw { gap: 6px; }
  .gmo__sw button { width: 40px; height: 40px; }
  .gmo:not(.gmo--wide) .gmo__sw button:nth-child(n+4) { display: none; }
  .gmo:not(.gmo--wide) .gmo__pal { padding-right: 4px; }
  .gmo--wide .gmo__sw button { width: 44px; height: 44px; }
  .gmo--wide .gmo__pal { height: 52px; }
  .gmo__ctl { padding: 0 10px 0 9px; }
}
@media (max-width: 640px) {
  .gmo:not(.gmo--wide) .gmo__pal > span { display: none; } /* on a narrow block the colours need the room */
}

/* ==========================================================================
   The viewer: a Gradients piece opens in the shader viewer (v2.js sets
   data-gr beside data-sh and data-fil, so the slim panel, the bars, the gate
   and the Export list are theirs). Only the stage is the collection's own:
   one wide picture, and the strip of variations under it.
   ========================================================================== */
.stage[data-gr] { --grw: 780px; }
.gr { display: flex; flex-direction: column; gap: 12px; width: min(var(--grw), 100cqw, calc((100cqh - 104px) * 16 / 9)); }
.gr[hidden] { display: none; }
.gr__pic {
  position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 9; border-radius: 14px; background: #050506;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -28px rgba(0, 0, 0, 0.95);
}
.gr__cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.gr__mode {
  position: absolute; z-index: 1; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px 0 8px; border-radius: 999px; background: rgba(12, 10, 9, 0.5);
  font-size: 11.5px; font-weight: 500; line-height: 1; letter-spacing: .01em; color: rgba(243, 238, 231, 0.78);
  pointer-events: none; -webkit-user-select: none; user-select: none;
}
.gr__mode::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #34d399; }

.gr__strip { display: flex; gap: 8px; align-items: stretch; }
.gr__vars { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.gr__var {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 9px;
  background: #0b0b0d; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(243, 238, 231, 0.06);
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s ease-out, transform .15s ease-out;
}
.gr__var canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gr__var span {
  position: absolute; z-index: 1; left: 5px; bottom: 4px; font-size: 10px; font-weight: 600; letter-spacing: .02em; color: #fff;
  padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.42); /* a small dark chip, so it reads on pale variations too */
}
.gr__var:hover { transform: translateY(-1px); }
.gr__var[aria-pressed="true"] { outline-color: var(--ink); }
.gr__var:focus-visible { outline-color: var(--ink); }
.gr__var--empty { background: transparent; cursor: default; box-shadow: inset 0 0 0 1px rgba(243, 238, 231, 0.12); border: 0; }
.gr__var--empty:hover { transform: none; }
dialog.sheet[data-big] .stage[data-gr] { --grw: 100vmax; }

/* the panel: a colour set is a swatch, eight to a row; the name of the one showing sits beside the heading */
dialog.sheet[data-gr] .grsw { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-bottom: 4px; }
.side__sub { margin-left: 8px; color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; }
dialog.sheet[data-gr] .row--off { color: var(--faint); }
dialog.sheet[data-gr] .row__note { margin-left: auto; padding-right: 8px; font-size: 12px; color: var(--faint); }
/* a Pro piece without Pro: its row of colour sets and its three controls are Pro's (the label says so); the demo
   moves them, a press answers with the nudge. The variations under the picture stay everyone's. */
dialog.sheet[data-gr] .grlock { display: flex; align-items: center; }
dialog.sheet[data-gr] .grlock .pro { margin-left: auto; }
dialog.sheet[data-gr] .grsw--try > i { opacity: .8; transition: opacity .3s ease-out, box-shadow .2s ease-out; }
dialog.sheet[data-gr] .grsw--try > i.on { opacity: 1; }
dialog.sheet[data-gr] .grsw--try + .bar { margin-top: 8px; }
/* styling mode (Dan's Mac only, ?style): the bar under the strip that saves a variation's look */
.gr__style { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(253, 186, 116, 0.1); box-shadow: inset 0 0 0 1px rgba(253, 186, 116, 0.35); }
.gr__style-t { flex: 1 1 auto; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--ink); }
.gr__style .btn:disabled { opacity: .4; cursor: default; }
/* the demo's named cursor travels over the whole viewer (panel and strip), so it sits above both */
dialog.sheet > .grcur { z-index: 60; }
@media (prefers-reduced-motion: reduce) { .gr__var { transition: none; } .gr__var:hover { transform: none; } }

/* phones and upright tablets: a wide picture and a strip need more height than the shader's square, so the stage
   takes a little more of the screen (the controls still scroll beneath it) */
@media (max-width: 900px) and (min-height: 560px) {
  dialog.sheet[data-gr]:has(.side__body .bar) .stage { height: clamp(360px, 60dvh, 520px); }
  dialog.sheet[data-gr]:has(.side__body .bar):has(.stage[data-view="code"]) .stage { height: auto; }
  /* the colour sets six to a row, each the size of a fingertip */
  dialog.sheet[data-gr] .grsw { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; } /* 6px: each swatch stays a full 44px to tap at 375 */
}
/* phones: the picture runs the panel's full width, on the same edges as the name and the switch above it, and the
   stage is exactly as tall as the picture and the strip need */
@media (max-width: 640px) and (min-height: 560px) {
  dialog.sheet[data-gr]:has(.side__body .bar) .stage { height: calc(176px + (100vw - 56px) * 9 / 16); }
}
/* phones: previous and next sit at the end of the variations row rather than on a row of their own, and on a short
   phone (760 tall or less) the picture is a little less tall (2:1), so the controls below get room to work in
   (2026-11-26: they had about 160px on a 667-tall phone; about 240 now, as on Shaders) */
@media (max-width: 640px) {
  .stage[data-gr] { grid-template-rows: auto minmax(0, 1fr); }
  .stage[data-gr] .mbar--bot { position: absolute; right: 18px; bottom: 7px; padding: 0; }
  .stage[data-gr] .pvsteps { gap: 0; }
  .stage[data-gr] .pvsteps__n { display: none; }
  .stage[data-gr] .gr__strip { margin-right: 96px; }
}
@media (max-width: 640px) and (max-height: 760px) {
  .stage[data-gr] .gr__pic { aspect-ratio: 2 / 1; }
}
@media (max-width: 640px) and (min-height: 560px) and (max-height: 760px) {
  dialog.sheet[data-gr]:has(.side__body .bar) .stage { height: calc(176px + (100vw - 56px) / 2); }
}
@media (max-width: 640px) {
  .stage[data-gr] .stage__view { padding: 6px 20px; }
  .gr { width: 100cqw; gap: 10px; }
  .gr__strip { gap: 6px; height: 46px; }
  /* one row that slides sideways; its far edge fades so it says there is more */
  .gr__vars {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; padding: 2px; margin: -2px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .gr__vars::-webkit-scrollbar { display: none; }
  .gr__var { flex: none; width: 72px; height: 44px; aspect-ratio: auto; }
  .gr__var--empty { display: none; }
}

/* styling mode: the colour editor under the colour sets (Dan's Mac only, ?style) */
dialog.sheet[data-gr] .grx { margin: 10px 0 14px; padding: 10px; border-radius: 10px; background: rgba(253, 186, 116, 0.08); box-shadow: inset 0 0 0 1px rgba(253, 186, 116, 0.3); display: grid; gap: 10px; }
dialog.sheet[data-gr] .grx__name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
dialog.sheet[data-gr] .grx input[type="text"] { font: inherit; font-size: 12.5px; color: var(--ink); background: rgba(127, 127, 127, 0.12); border: 0; border-radius: 6px; padding: 5px 7px; min-width: 0; }
dialog.sheet[data-gr] .grx__name input { flex: 1 1 auto; }
dialog.sheet[data-gr] .grx__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
dialog.sheet[data-gr] .grx__c { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 6px; align-items: center; font-size: 11.5px; }
dialog.sheet[data-gr] .grx__c input[type="color"] { grid-row: span 2; width: 28px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
dialog.sheet[data-gr] .grx__l { opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.sheet[data-gr] .grx__l i { font-style: normal; opacity: .7; }
dialog.sheet[data-gr] .grx__h { width: 100%; font-variant-numeric: tabular-nums; text-transform: uppercase; padding: 3px 5px !important; }
dialog.sheet[data-gr] .grx__btns { display: flex; flex-wrap: wrap; gap: 6px; }
dialog.sheet[data-gr] .grx__save { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
dialog.sheet[data-gr] .grx .btn:disabled { opacity: .4; cursor: default; }
dialog.sheet[data-gr] .grx__note { margin: 0; font-size: 11.5px; opacity: .7; }
/* the colour sets in one run; the two-colour sets follow under their own small name, a little apart */
dialog.sheet[data-gr] .grsw > .grsw__g { grid-column: 1 / -1; aspect-ratio: auto; border-radius: 0; box-shadow: none; font-size: 11.5px; color: var(--faint); margin: 10px 0 -2px; }
dialog.sheet[data-gr] .grsw > .grsw__g:first-child { margin-top: 0; }
dialog.sheet[data-gr] .grx select { font: inherit; font-size: 12.5px; color: var(--ink); background: rgba(127, 127, 127, 0.12); border: 0; border-radius: 6px; padding: 5px 7px; flex: 1 1 auto; }

/* a variation you have changed: a small dot after its name (your changes are kept while you are on the page) */
.gr__var.is-yours span::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 4px; border-radius: 50%; vertical-align: 1px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
