/* Languid — Art Store
   Built from Figma "Art Store" › Product Page (1:950), Min Height (1:1125)
   and the cart-state frames. Spacing follows the 8-point grid; the few
   non-8 values (6, 12, 13) are taken directly from the Figma frames. */

:root {
  --bg: #f7f5ef;            /* surface/elevated */
  --surface: #eeeade;
  --line: #dad6ce;
  --ink: #000;
  --green: #34a87f;        /* primary */
  --green-deep: #2b9971;   /* green count pill on a white button */
  --green-step: #158c63;   /* minus / plus pill */
  --green-step-hover: #127754;
  --green-rule: #1fb05b;   /* the footer's bottom border */
  --pill: #ededed;
  --pill-ink: #767676;
  --foot-ink: #a59f8d;

  --max-w: 100vw;          /* full bleed; the gutter alone insets the content */
  --buy-h: 173px;         /* price + sizes + cart bar; JS keeps it exact */
  --gutter: 16px;
  --gap: 16px;
  /* Figma's 1360 content width, scaled up to the 1820 max */
  --content-w: calc(min(100vw, var(--max-w)) - 2 * var(--gutter));
  --radius-control: 0px;    /* Product Page frame is square; state frames use 4px */

  --font-display: "Amarante", "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (min-width: 640px)  { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/20px var(--font-body);
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-size: 12px; line-height: 14px; font-weight: 500;
  letter-spacing: 2.88px; text-transform: uppercase; opacity: .4;
}

/* ---------- Header (80px, divider inset by the gutter) ---------- */
/* Floating nav (Figma "Floating Nav header example"): the bar stays pinned
   and the page scrolls under it. The bar itself is full-bleed so its fill
   still reaches the viewport edges past the 1820 content cap, while the
   contents stay on the grid. */
.header-bar { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.header { position: relative; height: 80px; display: flex; align-items: center; }
.header::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  border-bottom: 1px solid var(--line);
}
.header__logo { display: block; width: 72px; height: 48px; flex: none; mix-blend-mode: multiply; }
.header__logo img { width: 72px; height: 48px; object-fit: contain; }
.header__tagline { margin-left: 24px; white-space: nowrap; display: none; }
.header__nav { margin-left: auto; display: flex; gap: 24px; font-weight: 700; text-transform: uppercase; }
.header__nav a, .more__all { transition: color .15s; }
.header__nav a:hover, .more__all:hover { color: var(--green); }
.cart {
  position: relative; margin-left: 24px; width: 48px; height: 24px; flex: none;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--ink); border-radius: 999px;
  font-weight: 500; line-height: 1;
  transition: background-color .15s, color .15s;
}
.cart.is-filled { background: var(--green); color: #fff; border-color: transparent; }
@media (min-width: 768px) {
  .header__tagline { display: block; }
  .header__nav { gap: 40px; }
  .cart { margin-left: 40px; }
}

/* ---------- Product: gallery + side ---------- */
.product { padding-top: 40px; padding-bottom: 40px; }

/* 4:3, the ratio the mockups are uploaded at, so nothing is cropped. */
.gallery { position: relative; aspect-ratio: 4 / 3; background: var(--bg); overflow: hidden; }
.gallery__track {
  position: absolute; inset: 0; display: flex;
  gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; }
.gallery__bar { display: none; }
.gallery__thumbs { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 8px; }
.thumb { width: 80px; height: 80px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border: 2px solid var(--green); }

.product__side { display: flex; flex-direction: column; min-width: 0; }
.panel {
  flex: 1 0 auto; background: var(--surface); padding: 24px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.copy { display: flex; flex-direction: column; gap: 32px; }        /* title -> body */
.copy__head { display: flex; flex-direction: column; gap: 24px; }  /* eyebrow -> title */
.title {
  font: 400 clamp(56px, 5.56vw, 80px)/1 var(--font-display);
  letter-spacing: -.05em; overflow-wrap: anywhere;
}
@supports (text-box: trim-both cap alphabetic) {
  .title, .price, .more__title, .listing__kicker, .listing__title { text-box: trim-both cap alphabetic; }
}
@supports not (text-box: trim-both cap alphabetic) {
  .title, .listing__title { line-height: .8; }
  .price { line-height: .75; }
}
.copy__body > * + * { margin-top: 20px; }

.details__item { display: flex; flex-direction: column; gap: 6px; }
.details__item strong { font-weight: 700; }
.details__rule { display: flex; align-items: flex-end; padding-bottom: 16px; }
.details__rule span { flex: 1; border-bottom: 1px solid rgba(0,0,0,.24); }
.details__rule svg { flex: none; display: block; overflow: visible; }

.buy { margin-top: 40px; display: flex; flex-direction: column; gap: 40px; }
.buy__cost { display: flex; align-items: flex-end; gap: 16px; }
.price { font-size: 40px; font-weight: 500; letter-spacing: -2px; line-height: normal; white-space: nowrap; }
.buy__note { font-size: 12px; line-height: 14px; opacity: .48; white-space: nowrap; }
.buy__note span { box-shadow: 0 3px 0 -2px currentColor; padding-bottom: 2px; }
.buy__ctas { display: flex; flex-direction: column; gap: var(--gap); }

.sizes { display: flex; gap: 8px; }
.size {
  flex: 1 1 0; min-width: 0; height: 40px; padding: 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; border: 0; border-radius: var(--radius-control);
  font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.size[aria-pressed="true"],
.size:hover:not(:disabled) { background: var(--ink); color: #fff; }
.size:disabled { opacity: .4; cursor: not-allowed; }
.size__count {
  flex: none; width: 40px; padding: 4px 0; border-radius: 999px; text-align: center;
  background: var(--pill); color: var(--pill-ink); font-weight: 400; line-height: 13px;
}
.size__count.is-on { background: var(--green-deep); color: #fff; font-weight: 500; }
.size[aria-pressed="true"] .size__count.is-on,
.size:hover:not(:disabled) .size__count.is-on { background: var(--green); }

.add {
  width: 100%; height: 48px; padding: 6px 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-control);
  font-size: 16px; font-weight: 500; line-height: 19px; color: #fff;
  transition: background-color .15s;
}
.add--empty { background: var(--ink); }
.add--empty:hover:not(:disabled) { background: #262626; }
.add--filled { background: var(--green); }
.add:disabled, .add[aria-busy="true"] { opacity: .72; }
.add__label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.add__step {
  flex: none; width: 40px; height: 24px; border-radius: 999px;
  display: grid; place-items: center; background: var(--green-step); color: #fff;
  transition: background-color .15s;
}
.add__step:hover { background: var(--green-step-hover); }

@media (min-width: 640px) {
  .sizes { gap: var(--gap); }
  .size { padding: 0 12px; }
  .panel { padding: 40px; }
}

/* Desktop: 777 / 583 split of the content width (Figma's 1360, scaled).
   Height flexes with the viewport between the Min Height frame (777) and
   the Product Page frame (990): header 80 + 40 above, 40 below. Both bounds
   scale with the gallery so the proportions hold at any max width.
   The Min Height frame also leaves the More Prints band showing below the
   fold, so --peek is held back from the product: at that frame's 1040px
   viewport, 1040 - 80 header - 80 padding - 104 peek lands on the 777 floor
   and the band starts at 937, exactly as drawn. */
@media (min-width: 1024px) {
  .product {
    --gallery-w: calc(var(--content-w) * 777 / 1360);
    --gallery-h: calc(var(--gallery-w) * 3 / 4);   /* the lead image, at 4:3 */
    padding-top: 40px;
    display: grid; grid-template-columns: minmax(0, 777fr) minmax(0, 583fr);
    --peek: 104px;
    min-height: calc(clamp(var(--gallery-h), 100svh - 160px - var(--peek), var(--gallery-h) * 990 / 777) + 80px);
  }
  .gallery { aspect-ratio: auto; min-height: var(--gallery-h); }
  .gallery__track { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y proximity; overscroll-behavior: auto; }
  .gallery__track img { flex: none; }
  .gallery__bar { display: block; position: absolute; top: 8px; bottom: 8px; right: 8px; width: 1px; pointer-events: none; }
  .gallery__bar span { position: absolute; left: 0; width: 1px; background: #fff; mix-blend-mode: difference; }
  .panel { padding: 40px 40px 40px 80px; }   /* 40px surface strip + 40px padding */
  .buy { margin-left: 40px; }

  /* The buy block rests flush with the foot of the image, and rides 40px above
     the fold while the image still runs past it. The description gives up the
     slack between Copy and Details so the two never collide:
     120 header+padding + 40 gap + the block + 40 clearance. */
  .product__side { gap: 40px; }
  .panel { flex: 1 1 auto; min-height: min-content;
           max-height: calc(100svh - 200px - var(--buy-h)); }
  /* 40px of clearance when the viewport can spare it, giving it back as the
     window gets short so the block never rides up over the description. */
  .buy { margin-top: auto; position: sticky; z-index: 1;
         bottom: clamp(0px, calc(100svh - 160px - var(--panel-h, 520px) - var(--buy-h)), 40px); }
  .sizes { gap: 8px; }
}
@media (min-width: 1280px) { .sizes { gap: var(--gap); } }

/* ---------- Large screens: both images at 3/4, copy and CTAs at 1/4 ----------
   The gallery stops being a scroller and simply lays its images out two up, so
   the thumbnails and the scroll bar have nothing left to do. The copy column
   still stretches to the foot of the images, which keeps the sticky buy block
   and its clearance working exactly as before. */
@media (min-width: 1600px) {
  .product {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: 40px;
    min-height: 0;
  }
  .gallery { aspect-ratio: auto; min-height: 0; overflow: visible; background: none; }
  .gallery__track {
    position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    overflow: visible; scroll-snap-type: none;
  }
  .gallery__track img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  /* a print with a single image centres in the pair rather than leaving a hole */
  .gallery__track img:only-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 4px); }
  .gallery__thumbs, .gallery__bar { display: none; }
  .panel { padding: 40px; }        /* no cream strip to allow for here */
  .buy { margin-left: 0; }
}

.shop-message { padding: 96px 0 120px; font-size: 16px; line-height: 24px; }

/* ---------- More prints ---------- */
.more { background: var(--surface); padding: 40px 0 80px; }
.more__head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.more__title { font-size: 24px; font-weight: 500; letter-spacing: -1.2px; line-height: normal; white-space: nowrap; }
.more__title b { font-weight: 900; }
.more__controls { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.more__arrows { display: flex; gap: 40px; }
.more__arrows button { width: 16px; height: 16px; display: grid; place-items: center; }
.more__arrows button:disabled { opacity: .24; cursor: default; }
.more__all { font-weight: 700; white-space: nowrap; }
.more__track {
  --cols: 1.25; --card-gap: 16px;
  margin-top: 40px; display: flex; gap: var(--card-gap);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.more__track::-webkit-scrollbar { display: none; }
.card { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--card-gap)) / var(--cols)); min-width: 0; scroll-snap-align: start; }
.card a { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
/* `isolate` keeps the soft-light border blending against the artwork alone,
   and gives the two pseudo-elements a stacking context of their own so the
   hover rule can sit on top of the border. */
.card__media { position: relative; display: block; width: 100%; isolation: isolate; }
.card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--line); }
/* Black at soft light: reads as a darker edge of whatever colour it crosses,
   so one rule works on the pale, the red and the blue alike. */
.card__media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  /* inset shadow, not `border`: Chrome floors a fractional border-width to
     whole pixels, so a 2.5px border would paint at 2px. */
  box-shadow: inset 0 0 0 2.5px #000; mix-blend-mode: soft-light;
}
.card__media::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 2;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;        /* in step with the pill below */
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px;
  background: #fff; border-radius: 999px; line-height: 13px; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;   /* in step with the rule above */
}
.chip svg { flex: none; }
.card a:hover .chip, .card a:focus-visible .chip { background: var(--ink); color: #fff; }
.card a:hover .card__media::after,
.card a:focus-visible .card__media::after { transform: scaleX(1); }
@media (min-width: 640px)  { .more__track { --cols: 2.25; --card-gap: 24px; } }
@media (min-width: 1024px) {
  .more__track { --cols: 4; --card-gap: 40px; margin-top: 40px; }
  /* arrows start on the 4th column, "View all" ends on it */
  .more__controls { width: calc((100% - 3 * 40px) / 4); }
}

/* ---------- All prints (Figma "Product List Page", 65:2019) ----------
   1440 frame, 40px gutters: three 437.33 columns with 24px gutters, each card
   a 4:3 image, 12px, then the 25px title pill. 40px from the header rule to
   the kicker, 16px to the title, 40px to the grid, 96px to the footer. The
   big tile is two columns by two rows — 899x754 at that width, which is two
   card blocks plus the 24px between them. */
.listing { padding-top: 40px; padding-bottom: 96px; }
.listing__kicker {
  font-size: 24px; font-weight: 500; letter-spacing: -1.2px; line-height: normal;
  white-space: pre; margin-left: 8px;      /* the frame indents the kicker 8px */
}
.listing__title {
  font: 400 clamp(56px, 5.56vw, 80px)/normal var(--font-display);
  letter-spacing: -.05em; margin-top: 16px; overflow-wrap: anywhere;
}
.grid {
  --cols: 1;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 24px; margin-top: 40px;
}
@media (min-width: 640px)  { .grid { --cols: 2; } }
@media (min-width: 1024px) { .grid { --cols: 3; } }

.tile { position: relative; }
.tile__link { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.tile__media {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3;
  background: var(--surface); overflow: hidden; isolation: isolate;
}
.tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* The editorial tile fills both rows. It isn't a product, so it carries no
   title pill and no hover rule. */
.tile--big { grid-column: 1 / -1; }
.tile--big .tile__media { aspect-ratio: 899 / 754; }
/* no card treatment on the editorial image: no soft-light edge, no hover rule */
.tile--big .tile__media::before,
.tile--big .tile__media::after { display: none; }
@media (min-width: 1024px) {
  .tile--big { grid-column: span 2; grid-row: span 2; }
  .tile--big .tile__link, .tile--big .tile__media { height: 100%; }
  .tile--big .tile__media { aspect-ratio: auto; }
}

/* same soft-light edge and hover rule as the carousel cards */
.tile__media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 0 2.5px #000; mix-blend-mode: soft-light;
}
.tile__media::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 2;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.tile:hover .tile__media::after, .tile:focus-within .tile__media::after { transform: scaleX(1); }
.tile:hover .chip, .tile:focus-within .chip { background: var(--ink); color: #fff; }



/* ---------- Howdy (Figma "Howdy _ Desktop" 72:4861 / "Howdy_Mobile" 73:9991) ----
   The artwork is the measure of this page: it takes half the screen, and the
   copy and the sign-off hang off its two edges — body flush left, the
   Enjoy!/arrow/Instagram group flush right. Everything below the artwork keeps
   the frame's own sizes and spacing, so only the picture scales.

   The floor of 637px is the frame's own composition width. Below ~1274px of
   viewport, half the screen is narrower than the body (434) and the sign-off
   (195) side by side, and the two would collide; holding at 637 keeps the
   layout the frame drew and meets 50vw exactly where it overtakes it. */
.howdy {
  display: grid; place-items: center;
  min-height: calc(100svh - 80px - 164px);
  padding-block: 40px;
}
.howdy__block { position: relative; width: max(637px, 50vw); }

.howdy__art { position: relative; }
.howdy__lede { display: block; width: 100%; }
.howdy__lede img { display: block; width: 100%; height: auto; }

/* The two tiles ride on top of the lede at their own resolution instead of
   being baked into it. The composition is scaled up past 1274px — half the
   screen against a 637px frame — and the butterflies box's 1px rule comes out
   of a 3x raster as mush at that size. These are 7x and 5x, placed as a share
   of the lede's own 637x199.6 so they scale with it. The desktop lede has both
   tiles erased; the phone lede still carries them, and is not scaled up. */
.howdy__eyes, .howdy__flies { position: absolute; }
.howdy__eyes  { left: 55.41601%; top: 0;         width: 25.11774%; height: auto; }  /* 353,0  160x86 */

/* The box's rule is drawn here rather than carried in the raster. It is 1px in
   a 637px frame, so at half a 1920 screen it lands on 1.5 CSS px however much
   resolution the artwork has — three device pixels of ramp, which is the blur.
   As a border it snaps to the device grid and stays a hairline. The artwork is
   cropped to the inside of the rule; the radius is the frame's 12px, tracking
   the composition (0.9419vw is 12/276 of this box at 50vw). */
.howdy__flies {
  left: 1.25589%; top: 51.10220%; width: 45.68289%; aspect-ratio: 291 / 86;
  overflow: hidden; background: #f2eedf;
  border-radius: max(12px, 0.9419vw);
}
/* The rule is drawn by the pseudo-element rather than as a border on the box
   itself: a 1px border never scales, so it would throw the artwork's own
   percentages out by a fraction at wide viewports. This way the box measures
   exactly 291 x 86 of the composition and the rule still snaps to the device
   grid as a hairline. */
.howdy__flies::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid #dfd9c8; border-radius: inherit;
}
/* the butterflies arrive with no box of their own, placed where the frame
   draws them: a 241 x 61 field at 26,13 inside the box */
.howdy__flies img {
  position: absolute; left: 8.93471%; top: 15.11628%;
  width: 82.81787%; height: auto;
}

/* 20px from the bottom of the butterflies box to the top of the copy. The box
   ends at 188 of the lede's 199.33, so the artwork's own tail below it —
   1.77919% of the block, since it scales — comes out of the margin. The copy
   stays 14px at every width, so the 20px is a fixed 20px, not a scaled one. */
.howdy__foot { position: relative; margin-top: calc(20px - 1.82104%); min-height: 96px; }

/* 1.25589% is the frame's 8px of 637 — the same inset the butterflies box
   sits on, so the copy and the box share a left edge at every width */
.howdy__body {
  margin-left: 1.25589%;
  width: 434px; max-width: min(434px, calc(100% - 211px));
  font-size: 14px; line-height: normal; text-align: justify;
}

/* 16px between the pieces, measured off Enjoy!'s rotated bounds (which reach
   ~1.5px past the "!" itself) and off the arrow's two ends.

   The group is pinned so the mark's centre sits on the period of "Languid." —
   621.5 of the artwork's 637, hence the 2.4333%. Pinning it to the artwork's
   right edge instead would hold at the frame's own width and then drift right
   as the artwork grows, by 7px at a 1920 viewport. */
.howdy__sign {
  position: absolute; right: calc(2.4333% - 16px); top: 64px;
  width: 197.88px; height: 32px;
}
.howdy__sign > * { position: absolute; }
/* The word is centred in a frame it doesn't fill and turns about that frame's
   centre, so the frame's centre is the word's optical centre whatever the word
   is. Placed from the screenshot: the ink sits 11px clear of the arrow and its
   centre lands just above the arrow's line. */
.howdy__signoff {
  left: 22.9px; top: 3.44px; width: 32px; height: 24px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  transform: rotate(-13.33deg);
}
.howdy__arrow { left: 61.88px; top: 11px; width: 88px; height: 10px; color: var(--ink); }
.howdy__ig { left: 165.88px; top: 0; width: 32px; height: 32px; }
/* Ellipse 28: a 26x12 oval under the mark, carrying the drop shadow. Measured
   off the frame's own render, the shadow is 0/7/10 at 32% black. The oval's own
   body never shows — the mark covers it in both states, resting and lifted — so
   it is filled with the page colour rather than the frame's placeholder grey,
   which would only ever surface as a smudge if the mark changed shape. */
.howdy__ig::before {
  content: ""; position: absolute; left: 3px; top: 15px; width: 26px; height: 12px;
  border-radius: 50%; background: var(--bg);
  box-shadow: 0 7px 10px rgba(0, 0, 0, .32);
}
/* only the mark moves: 5px up, which brings its bottom level with the oval's */
.howdy__ig img {
  position: relative; display: block; width: 32px; height: 32px;
  transition: transform .2s ease;
}
.howdy__ig:hover img, .howdy__ig:focus-visible img { transform: translateY(-5px); }
@media (prefers-reduced-motion: reduce) { .howdy__ig img { transition: none; } }

/* ---------- Howdy ring ----------------------------------------------------
   A cylinder of photos under the sign-off. Its radius, panel size and
   perspective are all worked out in js/ring.js from the width of the block it
   sits in, so the band always spans the composition exactly; what is left here
   is only the look. ------------------------------------------------------- */
.ring {
  margin-top: 16px;
  overflow: hidden;              /* the end panels run to the block's edges */
  touch-action: pan-y;           /* vertical scrolling still passes through */
  cursor: grab;
  user-select: none;
}
.ring.is-dragging { cursor: grabbing; }
.ring:focus-visible { outline: 2px solid var(--green); outline-offset: 8px; }

.ring__stage { position: relative; perspective-origin: 50% 50%; }
.ring__spin { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }

.ring__panel {
  position: absolute; left: 50%; top: 50%; margin: 0;
  aspect-ratio: 534 / 745;       /* the photos' own proportions */
  backface-visibility: hidden;   /* the far half of the ring drops out */
}
/* the radius goes on the photo and its overlay rather than on the panel: a
   clip on the panel risks flattening it out of the 3D context */
.ring__panel img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: 8px;
  -webkit-user-drag: none;
}
/* an overlay rather than a filter: a filter on a panel flattens it out of the
   3D context and the ring collapses into a flat strip */
.ring__shade {
  position: absolute; inset: 0; background: #000; opacity: 0;
  border-radius: 8px; pointer-events: none;
}

/* the nav marks the page you are on */
.header__nav a.is-current { color: var(--green); }


/* ---------- Not found ----------------------------------------------------
   Served by the host for any path the site doesn't have. The page itself is
   one file, so this only catches mistyped URLs. ------------------------- */
.lost {
  display: grid; align-content: center; justify-items: start;
  min-height: calc(100svh - 80px - 164px);
  padding-block: 40px;
}
.lost__body { max-width: 42ch; margin: 24px 0 0; }
.lost__back {
  margin-top: 32px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 2px solid var(--green);
  padding-bottom: 2px; transition: color .15s;
}
.lost__back:hover { color: var(--green); }
@media (max-width: 639px) {
  .lost { min-height: calc(100svh - 72px - 123px); }
}

/* ---------- Footer ---------- */
/* Full-bleed black band, 164px tall. The script mark sits at the left with the
   © and year tucked against it; the wizard and the rights line stack at the
   right. Everything is drawn at a fixed size, as in the frame — the band simply
   gets wider, it does not scale. */
/* 164 tall all in: 158 of black with the 6px green rule inside the bottom. */
.footer { background: var(--ink); overflow: hidden; border-bottom: 6px solid var(--green-rule); }
.footer__inner {
  height: 158px; padding-top: 43px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  color: var(--surface); font-weight: 300; line-height: 1;
}
.footer__brand { position: relative; flex: none; width: 185px; height: 79px; margin-left: -3px; }
/* The supplied mark carries the © and sits level — its baseline runs parallel to
   the year line beneath it. 182x71, the size the frame draws it at. */
.footer__script { position: absolute; left: 0; top: 8px; width: 182px; height: auto; }
.footer__year { position: absolute; left: 99px; top: 61px; font-size: 10px;
                text-transform: capitalize; white-space: nowrap; }
.footer__right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.footer__wizard { display: block; width: 111px; height: auto; }
.footer__rights { font-size: 10px; text-transform: capitalize; white-space: nowrap; }
.footer__m { display: none; }

/* Moving between prints: cross-fade rather than snapping to the top.
   View Transitions where supported, a plain fade-in everywhere else. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
@keyframes product-in { from { opacity: 0 } to { opacity: 1 } }
.product.is-entering, .more.is-entering, #listing.is-entering { animation: product-in .3s ease both; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .product.is-entering, .more.is-entering { animation: none !important; }
}

/* ---------- Mobile (Figma "Full Page" / "Resting" / "Scrolling", 402 wide) ----------
   24px gutters, a 72px header, a full-bleed 4:3 gallery with the thumbnails in
   a row of four beneath it, the cream panel running edge to edge, and the buy
   block pinned to the foot of the viewport while the product is in view.
   Everything below sits on the 8-point grid the frames are drawn on. */
@media (max-width: 639px) {
  :root { --gutter: 24px; }

  .header { height: 72px; }

  /* the gallery bleeds, so the section drops its gutters and the blocks that
     need an inset carry their own */
  /* the 32px below the product sits on the band, not as section padding:
     Chrome stops a sticky element at its container's content box, so padding
     here would lift the buy block early as the section ends */
  .product { padding: 40px 0 0; }
  .more { margin-top: 32px; }

  .gallery {
    aspect-ratio: auto; overflow: visible; background: none;
    display: flex; flex-direction: column; gap: 8px;
  }
  .gallery__track { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  .gallery__thumbs {
    position: static; flex-direction: row; gap: 8px; margin: 0 8px;
  }
  .thumb {
    flex: 1 1 0; width: auto; height: auto; aspect-ratio: 4 / 3;
    border: 0; background: var(--surface);
  }
  /* the marker has to paint over the image, so it is a layer of its own: an
     inset shadow on .thumb sits under the <img> that fills it */
  .thumb { position: relative; }
  .thumb[aria-current="true"] { border: 0; }
  .thumb[aria-current="true"]::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: inset 0 0 0 2px var(--green);
  }

  /* `contents` lifts the panel and the buy block up to be children of the
     product section, so the sticky block below has the gallery's height to
     travel through: a sticky element can only move inside its own container,
     and the side column ends exactly where the block does. */
  .product__side { display: contents; }
  .panel { margin-top: 8px; padding: 24px 24px 40px; }   /* 8px under the thumbnails */
  .copy { gap: 24px; }             /* title -> body */
  .copy__head { gap: 16px; }       /* eyebrow -> title */

  /* price + sizes + cart ride the bottom of the screen, on the page colour so
     the description scrolls underneath */
  .buy {
    position: sticky; bottom: 0; z-index: 5;
    margin-top: 0; padding: 24px; gap: 24px;
    background: var(--bg);
  }
  .price { font-size: 32px; letter-spacing: -1.6px; }
  .sizes { gap: 16px; }

  .more { padding: 40px 0 56px; }   /* heading 40 from the top, 56 to the footer */
  .more__arrows { display: none; }
  .more__track {
    --cols: 1.75; --card-gap: 16px;
    margin-inline: calc(var(--gutter) * -1);   /* the carousel bleeds too */
  }
  /* The leading card's pill holds 12px off the edge while its card scrolls
     past, then travels with the card once the two are right-aligned — which
     is what sticky does on its own, since the card is the constraint box.
     Cards further along start past 12px, so they are never pinned. */
  .card .chip { position: sticky; left: 12px; }

  /* 32 above the 59.18 lockups and 32 below, the last 4 of which is the rule */
  .footer { border-bottom-width: 4px; }
  .footer__inner { height: 119px; padding-top: 32px; }
  .footer__brand, .footer__right { display: none; }
  .footer__m { display: block; height: auto; }
  .footer__m--left  { width: 128.34px; }                          /* 642 / 5 */
  .footer__m--right { width: 91px; margin-right: -2px; }          /* 455 / 5, nudged so its ink meets the 24px gutter */

  /* ---- All prints (Figma "PLP", 72:4480) ----
     One column of 4:3 cards on 12px gutters, 12px from a card to its pill and
     12px on to the next card. The heading column tightens: 24 from the header
     rule, 8 between the two lines, 24 down to the grid. */
  .listing { padding-top: 40px; padding-bottom: 56px; }
  .listing__kicker { font-size: 18px; letter-spacing: -.9px; }   /* same -.05em */
  .listing__title { margin-top: 8px; }
  .grid { --cols: 1; gap: 12px; margin-top: 24px; margin-inline: -12px; }
  .tile--big { margin-inline: -12px; }            /* the editorial image bleeds */
  .tile--big .tile__media { aspect-ratio: 402 / 492; }

}

/* The phone keeps its own composition: the artwork there is already near
   full-bleed, so half the screen would be unreadable. Its own width needs more
   room than a 640px viewport leaves once the gutters are taken, so it carries
   on up to 768. */
@media (max-width: 767px) {
  .howdy { min-height: calc(100svh - 72px - 123px); padding-block: 40px; }
  .howdy__block { width: 297px; }
  /* the phone artwork's own bounds reach a little past the content column on
     the left; anchoring on the red tile keeps it aligned with the frame */
  .howdy__lede { width: 303.3px; margin: -1.7px 0 0 -6px; }
  .howdy__eyes, .howdy__flies { display: none; }
  .howdy__foot { margin-top: 14.8px; min-height: 167px; }
  /* the phone box already starts at the column edge, so the copy does too */
  .howdy__body { margin-left: 0; width: 297px; max-width: 100%; }
  /* same 16px spacing, and the mark again centred on the period — 288.33 of the
     phone artwork, which sits 6px left of the column, so 282.33 of 297 */
  .howdy__sign { right: -1.33px; top: 134px; width: 184.88px; height: 33px; }
  .howdy__arrow { left: 61.88px; width: 75px; }
  .howdy__ig { left: 152.88px; top: 1px; }
}
