@import url("fonts.css");
@import url("layout.css");
/* Playground panel font: Neue Haas Grotesk Display Pro 65 Medium */
@font-face {
  font-family: "Panel Haas";
  src:
    local("Neue Haas Grotesk Display Pro 65 Medium"),
    local("NHaasGroteskDSPro-65Md"),
    url("fonts/HaasGrotDisp-65Medium.otf") format("opentype");
  font-weight: 500;
}

:root {
  /* Figma text styles */
  --font-focal: "Focal", "Focal Trial", system-ui, sans-serif;
  --font-focal-text: "Focal Text", "Focal Text Trial", system-ui, sans-serif;
  --font-davinci: "DaVinci", "TRJN DaVinci", Georgia, serif;

  --black: #000;
  --white: #fff;

  /* hover playground, driven by main.js */
  --hover-blur: 12px;
  --hover-duration: 500ms;
  --hover-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --media-pad-top: 100px;
  --light-strength: 60%;
  --light-size: 360px;
  --blur-feather: 25px;
  /* gradient blur: blur amount and position at each end */
  --blur-start: 10px;
  --blur-start-at: 15%;
  --blur-end-at: 75%;
  /* mesh gradient: how far the blobs move with the cursor */
  --drift: 0.6;
  /* how much blur a nearby (not hovered) card gets at the closest point */
  --near-blur: 0.6;
  --box-feather: 0px;
  /* hover image box (see .card__overlay) */
  --ov-w: 50%;
  --ov-h: 100%;
  --ov-ratio: auto;
  --ov-px: 1;
  --ov-py: 0.5;
  --ov-inset: 0px;
  --fade-start: 30%;
  --fade-strength: 100%;
  --reach: 160px;
  /* how the product shot mixes into the gradient on hover */
  --shot-blend: multiply;
}

/* Registered so they can transition on hover */
/* swap "blend": the blurred copy's mask stops, animated on hover */
@property --blend-a {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}
@property --blend-b {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 55%;
}
@property --feather {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
@property --mix {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
/* cursor position in the box, 0–1; eased so the mesh trails the cursor */
@property --nx {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.5;
}
@property --ny {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.5;
}
/* strength of the nearby blur (0 when the cursor is far or on the card) */
@property --nearmix {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--plp-bg, var(--white)); /* PLP panel: Page > Background */
  color: var(--black);
  font-family: var(--font-focal);
  font-weight: var(--ft-weight);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
img {
  display: block;
}

/* ---------- Header (Focal Text S 14) ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  padding: 0 16px;
  background: transparent;
  font-family: var(--font-focal-text);
  font-size: var(--ft-size, 14px);
  line-height: var(--ft-leading, 1.3);
  letter-spacing: var(--ft-tracking, 0.03em);
}
.header__left {
  display: flex;
  align-items: flex-start;
  min-width: 50%; /* grows past the half when the nav needs it */
  padding: 12px 0;
}
.header__logo {
  width: 170px;
  flex-shrink: 0;
  padding-top: 1px;
}
.header__nav {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  white-space: nowrap;
}
.header__right {
  flex: 1;
  justify-content: flex-end;
  padding: 12px 0;
}

/* ---------- Title (DaVinci XL 2) ---------- */
.page-title {
  margin: 0;
  padding: 138px 10px 0; /* title top at y=180, minus the 42px header */
  min-height: 347px; /* list starts at y=389 in the design */
  font-family: var(--font-davinci);
  font-weight: var(--dv-weight);
  font-size: var(--dv-title, 64px);
  line-height: var(--dv-leading);
  letter-spacing: var(--dv-tracking);
  text-align: center;
}

/* ---------- Listing (Focal S 16) ---------- */
.listing {
  display: flex;
  flex-direction: column;
  row-gap: 40px;
  column-gap: 16px;
  padding-bottom: 100px;
  font-size: calc(var(--ft-size, 14px) * 16 / 14);
  line-height: calc(var(--ft-leading, 1.3) - 0.1);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}
.toolbar__sort {
  display: flex;
  align-items: center;
  font-family: var(--font-focal-text);
  font-size: var(--ft-size, 14px);
  line-height: calc(var(--ft-leading, 1.3) - 0.3);
  letter-spacing: calc(var(--ft-tracking, 0.03em) - 0.01em);
}

/* Category / sort dropdowns (Component 194, 10618:51972) */
.dropdown {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 2px;
  font-family: var(--font-focal-text);
  font-size: var(--ft-size, 14px);
  line-height: calc(var(--ft-leading, 1.3) - 0.3);
  letter-spacing: calc(var(--ft-tracking, 0.03em) - 0.01em);
  white-space: nowrap;
  background-color: transparent;
  transition: background-color 200ms ease;
}
.dropdown:hover,
.dropdown:focus-visible {
  background-image: linear-gradient(90deg, rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.03));
}
.dropdown__icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--white);
  overflow: hidden;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 32px;
  column-gap: 16px;
  padding: 0 16px 16px;
}

/* ---------- Product card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    --feather var(--hover-duration) var(--hover-ease),
    --mix var(--hover-duration) var(--hover-ease),
    --nx 900ms cubic-bezier(0.2, 0.7, 0.2, 1),
    --ny 900ms cubic-bezier(0.2, 0.7, 0.2, 1),
    --nearmix 300ms ease-out;
}

.card__media {
  /* "Background to color" */
  position: relative;
  isolation: isolate;
  padding: var(--media-pad-top) 20px 0;
  border-radius: 3px;
  overflow: hidden;
}

/* Cursor-driven gradient (component 10322:55136). main.js sets --angle (points at the
   cursor), --mx/--my (cursor position in the box) and --nx/--ny (0–1).
   The top layer is the "light": a more saturated spot that follows the cursor.
   Under it, either a mesh of three blobs that drift with --nx/--ny (some follow the
   cursor, some move against it) or the component's single linear sweep. */
.card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
  --light: radial-gradient(
    circle var(--light-size) at var(--mx, 50%) var(--my, 50%),
    color-mix(
      in srgb,
      var(--c-light, transparent) var(--light-strength),
      transparent
    ),
    transparent
  );
  --dx: calc((var(--nx) - 0.5) * var(--drift));
  --dy: calc((var(--ny) - 0.5) * var(--drift));
  background-image:
    var(--light), var(--fade),
    radial-gradient(
      70% 90% at calc(20% + var(--dx) * 80%) calc(25% + var(--dy) * 80%),
      var(--b1),
      transparent 70%
    ),
    radial-gradient(
      65% 85% at calc(82% - var(--dx) * 60%) calc(35% + var(--dy) * 40%),
      var(--b2),
      transparent 70%
    ),
    radial-gradient(
      80% 70% at calc(48% + var(--dx) * 40%) calc(95% - var(--dy) * 60%),
      var(--b3),
      transparent 75%
    ),
    linear-gradient(var(--b0), var(--b0));
}
[data-shape="linear"] .card__media::before {
  background-image:
    var(--light), var(--fade),
    linear-gradient(
      var(--angle, 150deg),
      var(--c-weak, #f4f4f4) 10%,
      var(--c-strong, #e6e6e6) 70%
    );
}
[data-shape="linear"][data-gradient="neutral"] .card__media::before {
  background-image:
    var(--light), var(--fade),
    linear-gradient(var(--angle, 150deg), var(--b0) 10%, var(--b1) 70%);
}

/* Feathered box: the colored area fades out over --box-feather at every edge */
.card__media::before {
  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent,
      #000 var(--box-feather),
      #000 calc(100% - var(--box-feather)),
      transparent
    ),
    linear-gradient(
      transparent,
      #000 var(--box-feather),
      #000 calc(100% - var(--box-feather)),
      transparent
    );
  mask-image:
    linear-gradient(
      to right,
      transparent,
      #000 var(--box-feather),
      #000 calc(100% - var(--box-feather)),
      transparent
    ),
    linear-gradient(
      transparent,
      #000 var(--box-feather),
      #000 calc(100% - var(--box-feather)),
      transparent
    );
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Fade to white: a white wash over the gradient (under the light), from
   --fade-start to full --fade-strength at the far end */
.card__media::before {
  --fade-white: color-mix(in srgb, #fff var(--fade-strength), transparent);
  --fade: linear-gradient(transparent, transparent);
}
[data-fade="bottom"] .card__media::before {
  --fade: linear-gradient(
    to bottom,
    transparent var(--fade-start),
    var(--fade-white)
  );
}
[data-fade="top"] .card__media::before {
  --fade: linear-gradient(
    to top,
    transparent var(--fade-start),
    var(--fade-white)
  );
}
[data-fade="edges"] .card__media::before {
  --fade: radial-gradient(
    closest-side,
    transparent var(--fade-start),
    var(--fade-white)
  );
}
[data-fade="away"] .card__media::before {
  --fade: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    transparent var(--fade-start),
    var(--fade-white) calc(var(--fade-start) + 40%)
  );
}

/* Base colors */
[data-gradient="colored"] .card__media::before {
  --b0: var(--c-strong, #eee);
  --b1: var(--c-deep, #e6e6e6);
  --b2: var(--c-alt1, #ebebeb);
  --b3: var(--c-alt2, #efefef);
}
/* Neutral: greys, only the light carries the product color */
[data-gradient="neutral"] .card__media::before {
  --b0: #f6f6f5;
  --b1: #e4e4e2;
  --b2: #ebebe9;
  --b3: #efefed;
}

/* Product size (panel: Thumbnails > Product size, --shot-scale): the frame keeps its
   shape and stays centered; above 1 it overflows the box (clipped by it) */
.card__frame {
  position: relative;
  width: calc(var(--shot-scale, 1) * 100%);
  margin-left: calc((1 - var(--shot-scale, 1)) * 50%);
}
.card__shot {
  width: 100%;
  aspect-ratio: 1600 / 900;
  object-fit: contain; /* a few shots (e.g. Selce-T) aren't 16:9 */
}

/* Shots with a white background instead of a cut-out always multiply, so the white drops out */
.card--opaque .card__frame img {
  mix-blend-mode: multiply;
}
/* On hover the shot blends into the gradient (only on hover: modes like luminosity
   would grey the product against the white resting background) */
.card:hover .card__frame img,
.card:focus-within .card__frame img {
  mix-blend-mode: var(--shot-blend);
}

/* ---------- Blur ----------
   Hover: --mix goes 0 → 1. Gradient styles cross-fade the shot
   (blurred by --blur-start) into a copy blurred by --hover-blur through a --ramp mask:
   the ramp is written with --off/--on so the same shape masks both layers in reverse.
   --feather fades the edges so the blur doesn't end in a hard line.
   Nearby (not hovered): a separate blurred copy, .card__near, is masked by a radial
   gradient centred on the cursor (--fx/--fy, relative to the frame): strongest at the
   cursor, gone at --reach. main.js sets --near to 1 while the cursor is within reach. */
.card {
  --mix: 0;
  --nearmix: calc(var(--near, 0) * var(--near-blur));
  --feather: calc(var(--blur-feather) * var(--near, 0));
}
.card:hover,
.card:focus-within {
  --mix: 1;
  --feather: var(--blur-feather);
}

.card__frame img {
  --edge-x: linear-gradient(
    to right,
    transparent,
    #000 var(--feather),
    #000 calc(100% - var(--feather)),
    transparent
  );
  --edge-y: linear-gradient(
    transparent,
    #000 var(--feather),
    #000 calc(100% - var(--feather)),
    transparent
  );
  --near-ramp: radial-gradient(
    circle at var(--fx, -9999px) var(--fy, -9999px),
    var(--near-on),
    var(--near-off) var(--reach)
  );
  -webkit-mask-image: var(--ramp), var(--edge-x), var(--edge-y);
  mask-image: var(--ramp), var(--edge-x), var(--edge-y);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.card__frame .card__shot {
  --off: #000;
  --on: rgb(0 0 0 / calc(1 - var(--mix)));
  /* fades out under the nearby blur, so sharp edges don't show through it */
  --near-on: rgb(0 0 0 / calc(1 - var(--nearmix)));
  --near-off: #000;
  -webkit-mask-image:
    var(--ramp), var(--near-ramp), var(--edge-x), var(--edge-y);
  mask-image: var(--ramp), var(--near-ramp), var(--edge-x), var(--edge-y);
  filter: blur(calc(var(--blur-start) * var(--mix)));
}
.card__frame .card__near {
  --near-on: #000;
  --near-off: transparent;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: var(--nearmix);
  filter: blur(var(--hover-blur));
  -webkit-mask-image: var(--near-ramp), var(--edge-x), var(--edge-y);
  mask-image: var(--near-ramp), var(--edge-x), var(--edge-y);
}
.card__blur {
  --off: transparent;
  --on: #000;
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: var(--mix);
  filter: blur(var(--hover-blur));
}

/* Full: the whole shot, no copy */
[data-blur-mode="full"] .card__shot {
  --ramp: linear-gradient(#000, #000);
  filter: blur(calc(var(--hover-blur) * var(--mix)));
}
[data-blur-mode="full"] .card__blur {
  display: none;
}

/* Directional ramps: blur grows along --blur-angle */
.card__frame img,
.card__rest-cursor {
  --ramp: linear-gradient(
    var(--blur-angle),
    var(--off) var(--blur-start-at),
    var(--on) var(--blur-end-at)
  );
}
/* cursor-driven styles use the trailing "blur cursor": --bangle, --bnx/--bny (see main.js) */
[data-blur-mode="toward"] .card {
  --blur-angle: var(--bangle, 90deg);
}
[data-blur-mode="away"] .card {
  --blur-angle: calc(var(--bangle, 90deg) + 180deg);
}
[data-blur-mode="overlay"] .card {
  --blur-angle: 90deg;
}
[data-blur-mode="overlay"][data-side="left"] .card {
  --blur-angle: 270deg;
}
[data-blur-mode="bottom"] .card {
  --blur-angle: 180deg;
}
[data-blur-mode="top"] .card {
  --blur-angle: 0deg;
}
/* cursor-related but vertical only: turns smoothly from "stronger at top" to "stronger at bottom" */
[data-blur-mode="vertical"] .card {
  --blur-angle: calc(var(--bny, 0.5) * 180deg);
}

/* Focus band: sharp at the cursor's height, blurrier above and below (tilt-shift).
   starts at / ends at are distances from the cursor. */
[data-blur-mode="band"] :is(.card__frame img, .card__rest-cursor) {
  --band-y: calc(var(--bny, 0.5) * 100%);
  --ramp: linear-gradient(
    var(--on) calc(var(--band-y) - var(--blur-end-at)),
    var(--off) calc(var(--band-y) - var(--blur-start-at)),
    var(--off) calc(var(--band-y) + var(--blur-start-at)),
    var(--on) calc(var(--band-y) + var(--blur-end-at))
  );
}
/* Focus spot: sharp around the cursor, blurrier further away */
[data-blur-mode="spot"] :is(.card__frame img, .card__rest-cursor) {
  --ramp: radial-gradient(
    circle at calc(var(--bnx, 0.5) * 100%) calc(var(--bny, 0.5) * 100%),
    var(--off) var(--blur-start-at),
    var(--on) var(--blur-end-at)
  );
}

/* Overlay: size and position from the panel. --ov-px/--ov-py (0, 0.5, 1) place it
   left/center/right and top/middle/bottom; translate pulls it back by its own size so
   the inset is kept on whichever edge it's against. */
.card__overlay {
  position: absolute;
  left: calc(var(--ov-px) * 100% + var(--ov-inset) * (1 - 2 * var(--ov-px)));
  top: calc(var(--ov-py) * 100% + var(--ov-inset) * (1 - 2 * var(--ov-py)));
  translate: calc(var(--ov-px) * -100%) calc(var(--ov-py) * -100%);
  width: var(--ov-w);
  height: var(--ov-h);
  aspect-ratio: var(--ov-ratio);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--hover-duration) var(--hover-ease),
    transform var(--hover-duration) var(--hover-ease),
    clip-path var(--hover-duration) var(--hover-ease);
}
.card__overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Placeholder: no ambient/detail shots exist yet, so the overlay shows a close crop of the product */
.card__overlay img.is-placeholder {
  object-fit: contain;
  transform: scale(2.4);
}


/* Caption (Focal Text S 14 CTA) */
.card__caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-focal-text);
  font-size: var(--ft-size, 14px);
  line-height: calc(var(--ft-leading, 1.3) - 0.3);
  letter-spacing: var(--ft-tracking, 0.03em);
}
.card__caption p {
  margin: 0;
}
/* "Novità 2026" tag next to the name (Figma 10873:46116) */
.card__name {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card__tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: var(--ft-xs-size, 10px);
  line-height: var(--ft-leading, 1.3);
  letter-spacing: calc(var(--ft-tracking, 0.03em) - 0.01em);
  white-space: nowrap;
}
/* tinted with the product's own color: --c-light is the saturated version of the
   photo's color that main.js sets on the card; the Figma warm/brown are fallbacks */
.card__tag {
  background: color-mix(in srgb, var(--c-light, var(--tag-fallback)) var(--tag-strength, 75%), transparent);
}
/* Tag styles (panel: body[data-tag-style]); strokes are inset shadows so the size
   doesn't change */
[data-tag-style="grey"] .card__tag {
  background: rgb(0 0 0 / 0.05);
}
[data-tag-style="colored-stroke"] .card__tag {
  box-shadow: inset 0 0 0 0.7px color-mix(in srgb, var(--c-light, var(--tag-fallback)), #000 35%);
}
[data-tag-style="white-stroke"] .card__tag {
  background: #fff;
  box-shadow: inset 0 0 0 0.7px #000;
}
.card__tag--warm {
  --tag-fallback: rgb(229 164 96);
}
.card__tag--brown {
  --tag-fallback: rgb(142 122 103);
}

/* ---------- Hover state ---------- */
.card:hover .card__media::before,
.card:focus-within .card__media::before {
  opacity: 1;
}
.card:hover .card__overlay,
.card:focus-within .card__overlay {
  opacity: 1;
}

/* motion variants (resting state → hover state) */
[data-anim="slide"][data-side="right"] .card__overlay {
  transform: translateX(100%);
}
[data-anim="slide"][data-side="left"] .card__overlay {
  transform: translateX(-100%);
}
[data-anim="slide"][data-side="center"] .card__overlay {
  transform: translateY(100%);
}
[data-anim="slide"] .card__overlay {
  opacity: 1;
}

[data-anim="wipe"] .card__overlay {
  opacity: 1;
  clip-path: inset(0 0 0 100%);
}
[data-anim="wipe"][data-side="left"] .card__overlay {
  clip-path: inset(0 100% 0 0);
}
[data-anim="wipe"][data-side="center"] .card__overlay {
  clip-path: inset(0 50% 0 50%);
}

[data-anim="rise"] .card__overlay {
  transform: translateY(24px);
}

.card:hover .card__overlay,
.card:focus-within .card__overlay {
  transform: none;
  clip-path: inset(0 0 0 0);
}

/* Hover background "Solid color" (panel: Gradient > Solid): the picked color, still
   with the cursor light on top */
:root {
  --hover-bg: #e8e2da;
}
body[data-gradient="solid"] .card__media::before {
  background-image: var(--light), linear-gradient(var(--hover-bg), var(--hover-bg));
}

/* Swap (panel: body[data-swap]): a resting layer (.card__rest) covers the card with
   the hover image. hidden: on hover it fades out and the usual hover effect plays
   underneath, unchanged. corner: it stays, and the product fades in small in the
   bottom-right corner. */
:root {
  --swap-scale: 35; /* % of the image width */
}
.card__rest {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
body:is([data-swap="corner"], [data-swap="hidden"], [data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"]) .card__rest {
  display: block;
}
.card:is(:hover, :focus-within) .card__rest {
  opacity: 0;
}
.card__rest-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* not full: the hover image sits in its own box (panel: Hover image at rest,
   placed like .card__overlay) on the card's background, which hides the product
   underneath */
:root {
  --rest-px: 1;
  --rest-py: 0.5;
  --rest-w: 50%;
  --rest-h: 100%;
  --rest-inset: 0px;
}
[data-rest-pos="box"] .card__rest {
  background: inherit;
}
[data-rest-pos="box"][data-box="none"] .card__rest {
  background: var(--page-bg, var(--plp-bg, #fff));
}
/* the zoomed placeholder crop would spill out of the box */
[data-rest-pos="box"] .card__rest-bg.is-placeholder {
  transform: none;
  object-fit: cover;
}
[data-rest-pos="box"] .card__rest-bg {
  position: absolute;
  left: calc(var(--rest-px) * 100% + var(--rest-inset) * (1 - 2 * var(--rest-px)));
  top: calc(var(--rest-py) * 100% + var(--rest-inset) * (1 - 2 * var(--rest-py)));
  translate: calc(var(--rest-px) * -100%) calc(var(--rest-py) * -100%);
  width: var(--rest-w);
  height: var(--rest-h);
}
.card__rest-bg.is-placeholder {
  object-fit: contain;
  transform: scale(2.4);
  background: var(--box-color, #fafafa);
}
.card__rest-shot {
  display: none;
  position: absolute;
  right: var(--box-pad, 20px);
  bottom: var(--box-pad-b, 20px);
  width: calc((100% - 2 * var(--box-pad, 20px)) * var(--swap-scale) / 100 * var(--shot-scale, 1));
  aspect-ratio: 1600 / 900;
  object-fit: contain;
  object-position: right bottom;
}
/* corner: the hover image stays on hover; the small product fades in on hover only */
[data-swap="corner"] .card .card__rest {
  opacity: 1;
}
[data-swap="corner"] .card__rest-shot {
  display: block;
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
[data-swap="corner"] .card:is(:hover, :focus-within) .card__rest-shot {
  opacity: 1;
}
/* Swap "blend": the hover image stays, full size; on hover the product (with its
   cursor-reactive blur) fades in at the center, full width. At rest a blurred copy of the image fades in from the bottom
   (--blend-from → --blend-to); on hover the image gets the cursor-reactive blur and a color
   from the product (body[data-blend-color], mixed with --blend-mode) washes over it. */
:root {
  --blend-blur: 24px;
  --blend-from: 0%;
  --blend-to: 55%;
  --blend-mode: soft-light;
  --blend-tint: 70%;
  --blend-bright: 1;
  --blend-opacity: 1;
}
.card__rest-blur,
.card__rest-tint {
  display: none;
}
[data-swap="blend"] .card .card__rest {
  overflow: hidden;
  background: inherit; /* the card's background, seen through a fainter image */
  opacity: 1; /* stays on hover */
}
[data-swap="blend"][data-box="none"] .card .card__rest {
  background: var(--page-bg, var(--plp-bg, #fff));
}
[data-swap="blend"] .card .card__rest-bg {
  position: absolute;
  inset: 0;
  translate: none;
  width: 100%;
  height: 100%;
}
/* blend / reveal: on hover the image brightens (--blend-bright) as it blurs; the
   blur layers above sample the brightened image */
body:is([data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"]) .card__rest-bg {
  filter: brightness(calc(1 + (var(--blend-bright) - 1) * var(--mix)));
}
/* and fades toward the card's background (--blend-opacity); the blur layers above
   blur that mix */
[data-swap="blend"] .card .card__rest-bg {
  opacity: calc(1 - (1 - var(--blend-opacity)) * var(--mix));
}

[data-swap="blend"] .card__rest-blur {
  display: block;
  position: absolute;
  inset: 0;
  /* a backdrop blur of the image underneath: unlike a blurred copy it doesn't go
     soft and transparent at the card's edges, so there's no feathering there */
  -webkit-backdrop-filter: blur(var(--blend-blur));
  backdrop-filter: blur(var(--blend-blur));
  --blend-a: var(--blend-from);
  --blend-b: var(--blend-to);
  -webkit-mask-image: linear-gradient(to top, #000 var(--blend-a), transparent var(--blend-b));
  mask-image: linear-gradient(to top, #000 var(--blend-a), transparent var(--blend-b));
  /* on hover it gives way to the cursor-reactive blur (Blur panel: mode, starts/ends at) */
  opacity: calc(1 - var(--mix));
}
body:is([data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"]) .card__rest-tint {
  display: block;
  position: absolute;
  inset: 0;
  background: var(--c-deep);
  mix-blend-mode: var(--blend-mode);
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
[data-blend-color="strong"] .card__rest-tint {
  background: var(--c-strong);
}
[data-blend-color="light"] .card__rest-tint {
  background: var(--c-light);
}
[data-blend-color="solid"] .card__rest-tint {
  background: var(--hover-bg);
}
body:is([data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"]) .card:is(:hover, :focus-within) .card__rest-tint {
  opacity: var(--blend-tint);
}
/* the product: centered, edge to edge, sharp, only on hover */
[data-swap="blend"] .card__rest-shot {
  display: block;
  z-index: 1;
  left: calc((1 - var(--shot-scale, 1)) * 50%);
  right: auto;
  /* Image position (--box-y: 0 top, 0.5 center, 1 bottom) within the paddings */
  top: calc(var(--box-pad-t, 20px) + (100% - var(--box-pad-t, 20px) - var(--box-pad-b, 20px)) * var(--box-y, 1));
  bottom: auto;
  translate: 0 calc(var(--box-y, 1) * -100%);
  width: calc(var(--shot-scale, 1) * 100%); /* edge to edge at size 1: no side padding */
  object-position: center;
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
[data-swap="blend"] .card:is(:hover, :focus-within) .card__rest-shot {
  opacity: 1;
}
/* the image's cursor-reactive blur: a backdrop blur masked by the same --ramp as the
   product blur (Blur panel: mode, starts/ends at), faded in with --mix on hover.
   In this mode main.js measures the cursor against the whole card, not the shot. */
.card__rest-base,
.card__rest-cursor {
  display: none;
}
/* Same amounts as the product blur: the whole image gets "Blur at start"
   (--blur-start); along the ramp it rises to "Hover blur" (--hover-blur) */
body:is([data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"]) .card__rest-base {
  display: block;
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--blur-start));
  backdrop-filter: blur(var(--blur-start));
  opacity: var(--mix);
}
body:is([data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"]) .card__rest-cursor {
  --off: transparent;
  --on: #000;
  display: block;
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--hover-blur));
  backdrop-filter: blur(var(--hover-blur));
  opacity: var(--mix);
  -webkit-mask-image: var(--ramp);
  mask-image: var(--ramp);
}
[data-blur-mode="full"] .card__rest-cursor {
  --ramp: linear-gradient(#000, #000);
}
/* Swaps "reveal" and "shotblur": at rest the card shows only the product (its own
   frame, lifted above the resting layer and centered; the layer's background is the
   card's, hiding the usual hover effect underneath). On hover the hover image fades
   in behind the product, full size.
   - reveal: the image blurs and tints like "blend"; the product stays sharp.
   - shotblur: the image stays sharp; the product gets its usual cursor blur. */
body:is([data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"]) .card .card__rest {
  overflow: hidden;
  background: inherit;
  opacity: 1;
}
body:is([data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"])[data-box="none"] .card .card__rest {
  background: var(--page-bg, var(--plp-bg, #fff));
}
body:is([data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"]) .card .card__rest-bg {
  position: absolute;
  inset: 0;
  translate: none;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
body:is([data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"]) .card:is(:hover, :focus-within) .card__rest-bg {
  opacity: var(--reveal-opacity, 1);
}
:is([data-swap="reveal"], [data-swap="silhouette"]) {
  --reveal-opacity: var(--blend-opacity);
}
body:is([data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"]) .card__frame {
  z-index: 3;
}
/* reveal: no blur on the product */
:is([data-swap="reveal"], [data-swap="silhouette"]) .card__frame img {
  --mix: 0;
  --nearmix: 0;
  --feather: 0px;
}
/* Cursor light over the hover image in the swaps that keep it on hover (corner,
   blend, reveal, shotblur): the same spot as the hover gradient's top layer
   (.card__media::before --light), which the image would otherwise cover. Under the
   product. Panel: "Cursor light over the image" (body[data-swap-light]). */
.card__rest-light {
  display: none;
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
body:is([data-swap="corner"], [data-swap="blend"], [data-swap="reveal"], [data-swap="silhouette"], [data-swap="shotblur"]):not([data-swap-light="false"])
  .card__rest-light {
  display: block;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle var(--light-size) at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--c-light, transparent) var(--light-strength), transparent),
    transparent
  );
}
.card:is(:hover, :focus-within) .card__rest-light {
  opacity: 1;
}
/* Swap "silhouette": like "reveal", but on hover the product turns into a flat
   silhouette (its cut-out shape, filled with body[data-sil-color]) in front of the
   blurred, tinted image. main.js sets --shot-url (the shot, used as the mask). */
.card__sil {
  display: none;
}
/* Two layers, both masked to the shot's shape:
   - glass (::before): a blur/brightness of what's behind, inside the shape
     (--sil-backdrop, --sil-bright);
   - fill (.card__sil-fill): --sil-fill at --sil-opacity, blurred by --sil-blur. Its
     mask sits on a child (::before) so the blur spreads past the shape's edge.
   Each fades in on its own: an opacity on a shared parent would cut the glass off
   from the image behind. Transparent fill + backdrop blur = a glass cut-out. */
:root {
  --sil-opacity: 1;
  --sil-blur: 0px;
  --sil-backdrop: 0px;
  --sil-bright: 1;
}
/* It sits over the shot's frame but outside it: the frame's images use blend modes,
   which make it an isolated group, and a backdrop blur inside it would see nothing
   of the image behind. Placed like the frame in the grid-4 box (at the Image
   position, between the paddings); in the large layouts the frame is at the top. */
[data-swap="silhouette"] .card__sil {
  --sil-fill: #000;
  display: block;
  position: absolute;
  z-index: 4;
  left: calc(var(--box-pad) + (100% - 2 * var(--box-pad)) * (1 - var(--shot-scale, 1)) / 2);
  width: calc((100% - 2 * var(--box-pad)) * var(--shot-scale, 1));
  top: calc(var(--box-pad-t) + (100% - var(--box-pad-t) - var(--box-pad-b)) * var(--box-y, 1));
  translate: 0 calc(var(--box-y, 1) * -100%);
  aspect-ratio: 1600 / 900;
  pointer-events: none;
}
[data-swap="silhouette"][data-thumb^="large"] .card__sil {
  left: calc((1 - var(--shot-scale, 1)) * 50%);
  width: calc(var(--shot-scale, 1) * 100%);
  top: 0;
  translate: none;
  aspect-ratio: 696 / 293;
}
[data-swap="silhouette"] .card__sil::before,
.card__sil-fill,
.card__sil-fill::before {
  content: "";
  position: absolute;
  inset: 0;
}
[data-swap="silhouette"] .card__sil::before,
.card__sil-fill::before {
  -webkit-mask: var(--shot-url) center / contain no-repeat;
  mask: var(--shot-url) center / contain no-repeat;
}
[data-swap="silhouette"] .card__sil::before {
  -webkit-backdrop-filter: blur(var(--sil-backdrop)) brightness(var(--sil-bright));
  backdrop-filter: blur(var(--sil-backdrop)) brightness(var(--sil-bright));
}
.card__sil-fill {
  filter: blur(var(--sil-blur));
}
.card__sil-fill::before {
  background: var(--sil-fill);
  opacity: var(--sil-opacity);
}
[data-swap="silhouette"] .card__sil::before,
.card__sil-fill {
  opacity: 0;
  transition: opacity var(--hover-duration) var(--hover-ease);
}
[data-swap="silhouette"] .card:is(:hover, :focus-within) .card__sil::before,
[data-swap="silhouette"] .card:is(:hover, :focus-within) .card__sil-fill {
  opacity: 1;
}
[data-sil-color="white"] .card__sil {
  --sil-fill: #fff;
}
[data-sil-color="deep"] .card__sil {
  --sil-fill: var(--c-deep);
}
[data-sil-color="light"] .card__sil {
  --sil-fill: var(--c-light);
}
[data-sil-color="solid"] .card__sil {
  --sil-fill: var(--hover-bg);
}
[data-swap="silhouette"] .card__frame img {
  transition: opacity var(--hover-duration) var(--hover-ease);
}
[data-swap="silhouette"] .card:is(:hover, :focus-within) .card__frame img {
  opacity: 0;
}
.card--opaque .card__rest-shot {
  mix-blend-mode: multiply;
}

/* ---------- Playground controls ---------- */
.controls,
.controls button,
.controls select,
.controls input {
  font-family: "Panel Haas", "Neue Haas Grotesk Display Pro", "Helvetica Neue", sans-serif;
  font-weight: 500;
}
.controls {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 240px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: var(--white);
  border: 1px solid var(--black);
  font-size: 13px;
}
.controls__toggle {
  width: 100%;
  padding: 8px 10px;
  text-align: left;
}
.controls__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 10px;
}
.controls h2 {
  margin: 6px 0 -2px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #777;
}
.controls[data-collapsed] .controls__body {
  display: none;
}
.controls[hidden] {
  display: none;
}
.controls__head {
  display: flex;
}
.controls__toggle {
  flex: 1;
}
.controls__close {
  padding: 8px 10px;
}
.controls__hint {
  margin: 0;
  color: #777;
}
.controls label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.controls output {
  margin-left: auto;
}
.controls small {
  color: #777;
}
.controls select,
.controls input {
  flex: 1 0 100%;
  min-width: 0;
  max-width: 100%;
  font: inherit;
}
.controls .controls__check {
  display: flex;
  align-items: center;
  gap: 6px;
}
.controls .controls__check input {
  flex: none;
  width: auto;
  margin: 0;
}
.presets {
  display: grid;
  gap: 6px;
}
.presets__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.presets__actions button {
  padding: 3px 0;
  border: 1px solid #ccc;
  border-radius: 3px;
}
.controls__export {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--black, #000);
  border-radius: 3px;
}
.controls__export:hover {
  background: var(--black, #000);
  color: #fff;
}
.presets__actions button:hover {
  border-color: var(--black);
}
.controls hr {
  width: 100%;
  margin: 2px 0;
  border: 0;
  border-top: 1px solid #ddd;
}

/* ---------- Thumbnail layouts (panel: body[data-thumb]) ----------
   large-a: Figma 10704:57653 · large-b: Figma 10820:41600. Two columns, 120px
   between rows, the shot fills a 696×293 frame (contained), captions in Focal Text M 26. */
/* PLP (index.html only: other pages have no data-thumb): a background box behind
   every shot (Thumbnails panel: a color, a two-color gradient, or the image's own
   color, main.js --c-box/--c-box2); in the 4-column grid the box has the chosen shape
   (4:5 by default, or fits the image) with the shot at the bottom (or center/top) */
:root {
  --box-color: #fafafa;
  --box-color2: #c8c8c8;
  --box-angle: 180deg;
  --box-align: end;
  --box-ratio: 4 / 5;
  --box-pad: 20px;
  --box-pad-t: 20px;
  --box-pad-b: 20px;
}
:is([data-thumb], [data-plp-cards])[data-box="solid"] .card__media {
  background: var(--box-color);
}
:is([data-thumb], [data-plp-cards])[data-box="gradient"] .card__media {
  background: linear-gradient(in oklab var(--box-angle), var(--box-color), var(--box-color2));
}
:is([data-thumb], [data-plp-cards])[data-box="image"] .card__media {
  background: var(--c-box, var(--box-color));
}
:is([data-thumb], [data-plp-cards])[data-box="image-gradient"] .card__media {
  background: linear-gradient(in oklab var(--box-angle), var(--c-box, var(--box-color)), var(--c-box2, var(--box-color2)));
}
:is([data-thumb="grid4"], [data-plp-cards]) .card__media {
  display: grid;
  align-content: var(--box-align);
  aspect-ratio: var(--box-ratio); /* "auto": as tall as the image + paddings */
  padding: var(--box-pad-t) var(--box-pad) var(--box-pad-b);
}

[data-thumb^="large"] .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 120px 16px;
}
[data-thumb^="large"] .card {
  gap: 16px;
}
[data-thumb^="large"] .card__media {
  padding: 0;
}
[data-thumb^="large"] .card__shot {
  aspect-ratio: 696 / 293;
}
[data-thumb^="large"] .card__caption {
  gap: 4px;
  font-size: var(--ft-m-size, 26px);
  line-height: var(--ft-m-leading, 1);
  letter-spacing: var(--ft-m-tracking, 0.01em);
}
/* large-a: credit small, tag above the name */
[data-thumb="large-a"] .card__caption p:last-child {
  font-size: var(--ft-size, 14px);
  line-height: var(--ft-leading, 1.3);
  letter-spacing: var(--ft-tracking, 0.03em);
}
[data-thumb="large-a"] .card__name {
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 6px;
}
[data-thumb^="large"] .card__tag {
  letter-spacing: calc(var(--ft-tracking, 0.03em) - 0.01em);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .header__left {
    width: auto;
    flex: 1;
  }
  .header__logo {
    width: auto;
    padding-right: 16px;
  }
  .header__left .header__nav {
    display: none;
  }
  .page-title {
    padding-top: 80px;
    min-height: 0;
    padding-bottom: 80px;
    font-size: 48px;
  }
  :root {
    --media-pad-top: 60px;
  }
}
@media (max-width: 480px) {
  .grid,
  [data-thumb^="large"] .grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --hover-duration: 0ms;
  }
}
