/* Will Bower — site styles.
   All measurements come from the Figma file (1798px frame). Above that width the
   layout stops growing; below it, spacing scales down fluidly with the viewport. */

@font-face {
  font-family: 'Aktiv Grotesk';
  src: url('/fonts/AktivGrotesk-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aktiv Grotesk';
  src: url('/fonts/AktivGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --max: 1798px;
  --px: clamp(16px, 2.725vw, 49px);      /* 49px page gutter */
  --py: clamp(20px, 1.891vw, 34px);      /* 34px top/bottom */
  --section-gap: clamp(48px, 5.395vw, 97px);
  --grid-col-gap: clamp(16px, 2.225vw, 40px);
  --grid-row-gap: clamp(40px, 3.337vw, 60px);
  --detail-gap: clamp(24px, 2.725vw, 49px);
  --white: #fff;
  --black: #000;
  /* motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);     /* long, soft settle */
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .25s;
  --t-med: .5s;
  --t-slow: .9s;
}

.theme-light { --bg: #f5f5f5; --fg: #000; }
.theme-dark  { --bg: #202020; --fg: #fff; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Aktiv Grotesk', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-slow) var(--ease-out), color var(--t-slow) var(--ease-out);
}
h1, h2, p, ul, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.regular { font-weight: 400; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.u { text-decoration: underline; text-underline-position: from-font; }

/* ---------- Page frame ---------- */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--py) var(--px);
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.page--fill { min-height: 100vh; min-height: 100dvh; }
.page--fill .main { flex: 1; display: flex; align-items: center; justify-content: center; }

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-left: 3px; /* logo sits 3px in from the grid in the design */
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}
.logo { font-size: 18.46px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 31px; align-items: center; font-size: 14.46px; letter-spacing: -0.01em; }
.nav a, .nav button { line-height: 1; text-transform: uppercase; font-weight: 700; }
.logo, .nav a, .nav button, .footer a, .caption__link, .about__body a, .cart__name a, .cart__remove, .cart__close { transition: opacity var(--t-fast) ease; }
.nav a:hover, .logo:hover, .cart-toggle:hover { opacity: .6; }

.footer {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.footer a { text-decoration: underline; text-underline-position: from-font; text-decoration-skip-ink: none; }

/* ---------- Artwork frame (white mount with the piece centred) ---------- */

.art {
  position: relative;
  display: block;
  background: var(--white);
  border-radius: 3px;
  aspect-ratio: 826.642 / 777.968;
}
.art__inner {
  position: absolute;
  /* 100px mount on a 826.642 × 777.968 frame */
  inset: 12.854% 12.097%;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art img {
  /* contain the piece without letterboxing, so corners round on the actual image */
  width: min(100cqw, 100cqh * var(--ar, 1));
  height: auto;
  aspect-ratio: var(--ar, 1);
  border-radius: 3px;
}
a.art img { transition: transform 1.1s var(--ease-out), opacity var(--t-slow) var(--ease-out); }
a.art:hover img { transform: scale(1.025); }
.art { transition: box-shadow var(--t-med) var(--ease-out); }
a.art:hover { box-shadow: 0 18px 50px -30px rgba(0, 0, 0, .35); }

/* ---------- Home catalogue ---------- */

.catalogue {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 827.467px));
  gap: var(--grid-row-gap) var(--grid-col-gap);
}
.module { display: flex; flex-direction: column; gap: 25.575px; }
.caption { display: flex; flex-direction: column; align-items: flex-start; gap: 8.25px; line-height: 1; }
.caption__title { font-size: 14.46px; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; }
.caption__link {
  font-size: 15.794px;
  letter-spacing: -0.01em;
  text-transform: capitalize;
  text-decoration: underline;
  text-underline-position: from-font;
  line-height: 1;
}
.caption__link:hover { opacity: .6; }
.empty { font-size: 14.46px; text-transform: uppercase; }

/* ---------- Artwork detail ---------- */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1045.489fr) minmax(0, 605.511fr);
  gap: var(--detail-gap);
  align-items: start;
}
.art--detail { border-radius: 3.794px; }
.art--detail img { border-radius: 3.794px; }

.info { border: 1px solid var(--fg); padding: 40px; }
.info__title {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 100px;
  border-bottom: 1px solid var(--fg);
  text-transform: uppercase;
  line-height: 1.3;
}
.info__name { font-size: 23.797px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.3; }
.info__meta { font-size: 14.6px; letter-spacing: 0.02em; line-height: 1.3; }
.info__body { display: flex; flex-direction: column; gap: 31.619px; padding: 40px 0 20px; }
.info__desc { font-size: 14.46px; letter-spacing: 0.02em; line-height: 1.4; }
.info__desc p + p { margin-top: 9px; }

.trim, .options .option > span, .add__text, .cart__name, .cart__price, .cart__total, .cart__checkout {
  text-box: trim-both cap alphabetic;
}

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 7px 0;
  font-size: 14.46px;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: .3;
  transition: opacity .35s var(--ease-out);
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:hover { opacity: .6; }
.option:has(input:checked) { opacity: 1; }
.option:has(input:focus-visible) { outline: 1px solid currentColor; outline-offset: 4px; }
.option--sold, .option--sold:hover { opacity: .3; cursor: not-allowed; }
.option__label { letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; }
.option__price { letter-spacing: -0.01em; }

.add {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
}
.add__icon { width: 18.546px; height: 18.546px; flex: none; }
.add__text {
  font-size: 16.46px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-position: from-font;
  white-space: nowrap;
}
.add:hover { opacity: .6; }
.add:disabled { opacity: .3; cursor: not-allowed; }
.add:disabled .add__text { text-decoration: none; }
.add, .add__icon { transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease-out); }
.add:hover .add__icon { transform: rotate(90deg); }
.add.is-added .add__icon { transform: rotate(180deg) scale(1.15); }

/* ---------- About / text pages ---------- */

.about {
  display: flex;
  align-items: flex-start;
  gap: 60px;
  padding: 60px;
  background: var(--white);
  color: var(--black);
  border-radius: 3px;
}
.about__photo { flex: none; width: 174px; height: 140px; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; border-radius: 4px; }
.about__text { width: 362px; display: flex; flex-direction: column; gap: 20px; }
.about--legal .about__text { width: 560px; max-width: 100%; }
.about__section { display: flex; flex-direction: column; gap: 10px; }
.about__section h1, .about__section h2 { font-size: 14.46px; font-weight: 700; line-height: 1.4; }
.about__body { font-size: 13.46px; letter-spacing: 0.02em; line-height: 1.4; }
.about__body p + p { margin-top: 9px; }
.about__body--legal h2 { font-size: 14.46px; font-weight: 700; line-height: 1.4; margin-top: 22px; }
.about__body--legal h2 + p { margin-top: 4px; }
.about__body--legal > :first-child { margin-top: 0; }
.about__body a { text-decoration: underline; text-underline-position: from-font; text-decoration-skip-ink: none; }
.about__body a:hover { opacity: .6; }

/* ---------- Cart drawer ---------- */

.cart-shade {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--black);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease-out), visibility 0s var(--t-med);
}
.cart {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 11;
  width: min(571px, 100vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 50px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--white);
  color: var(--black);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .7s var(--ease-out), visibility 0s .7s;
}
.is-cart-open .cart-shade { opacity: .7; visibility: visible; transition: opacity var(--t-med) var(--ease-out); }
.is-cart-open .cart { transform: none; visibility: visible; transition: transform .7s var(--ease-out); }
.is-cart-open body { overflow: hidden; }

.cart__head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; }
.cart__title { font-size: 18.46px; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; }
.cart__close { display: none; font-size: 14.46px; text-transform: uppercase; text-decoration: underline; text-underline-position: from-font; line-height: 1; }

.cart__contents {
  border-top: 1px solid var(--black);
  padding: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 31.619px;
}
.cart__lines, .cart__items { display: flex; flex-direction: column; gap: 12px; }
.cart__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 7px 0;
  font-size: 14.46px;
  text-transform: uppercase;
  line-height: 1;
}
.cart__item-left { display: flex; align-items: center; gap: 15px; min-width: 0; }
.cart__name { letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart__name a:hover { opacity: .6; }
.cart__remove { flex: none; width: 16px; height: 16px; display: grid; place-items: center; }
.cart__remove:hover { opacity: .5; }
.cart__price { letter-spacing: -0.01em; white-space: nowrap; }
.cart__total {
  display: flex;
  justify-content: flex-end;
  padding: 7px 0;
  font-size: 18.46px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-position: from-font;
}
.cart__total[hidden] { display: none; }
.cart__empty { padding: 7px 0; font-size: 14.46px; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; opacity: .5; }
.cart__empty[hidden] { display: none; }
.cart__checkout {
  width: 100%;
  padding: 20px 40px;
  background: var(--black);
  color: var(--white);
  font-size: 16.46px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: uppercase;
  transition: opacity var(--t-fast) ease, background-color var(--t-med) var(--ease-out);
}
.cart__checkout:hover { opacity: .85; }
.cart__checkout:disabled { opacity: .25; cursor: not-allowed; }
.cart__error { font-size: 13.46px; letter-spacing: 0.02em; line-height: 1.4; color: #b3261e; }
.cart__error[hidden] { display: none; }

/* ---------- Zoom ---------- */

.art--zoomable { cursor: zoom-in; }
.art--zoomable img { transition: transform 1.1s var(--ease-out), opacity var(--t-slow) var(--ease-out); }
.art--zoomable:hover img { transform: scale(1.01); }
.art__zoom {
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--black);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  opacity: .45;
  transition: opacity var(--t-fast) ease;
  pointer-events: none;
}
.art__zoom svg { width: 14px; height: 14px; flex: none; }
.art--zoomable:hover .art__zoom, .art--zoomable:focus-visible .art__zoom { opacity: 1; }
.art--zoomable:focus-visible { outline: 1px solid var(--fg); outline-offset: 6px; }

.zoom {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #161616;
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease-out), visibility 0s var(--t-med);
  font-family: 'Aktiv Grotesk', 'Helvetica Neue', Arial, sans-serif;
}
.is-zoom-open .zoom { opacity: 1; visibility: visible; transition: opacity var(--t-med) var(--ease-out); }
.is-zoom-open body { overflow: hidden; }
.zoom__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}
.zoom.is-zoomed .zoom__stage { cursor: grab; }
.zoom.is-zoomed.is-dragging .zoom__stage { cursor: grabbing; }
.zoom__img {
  max-width: none;
  border-radius: 3px;
  transform-origin: center;
  will-change: transform;
  -webkit-user-drag: none;
}
.zoom__img.is-animating { transition: transform .55s var(--ease-out); }
.zoom__close {
  position: absolute;
  top: calc(28px + env(safe-area-inset-top, 0px));
  right: calc(var(--px) + env(safe-area-inset-right, 0px));
  font-size: 14.46px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-position: from-font;
  line-height: 1;
  transition: opacity var(--t-fast) ease;
}
.zoom__close:hover { opacity: .6; }
.zoom__bar {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: rgba(32, 32, 32, .85);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 3px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.zoom__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 18px;
  line-height: 1;
  border-radius: 2px;
  transition: background-color var(--t-fast) ease;
}
.zoom__btn:hover { background: rgba(255, 255, 255, .12); }
.zoom__btn--text { font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; }
.zoom__level { min-width: 52px; text-align: center; font-size: 13px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.zoom__hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(28px + env(safe-area-inset-top, 0px));
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  opacity: .5;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease-out);
}
.zoom.is-zoomed .zoom__hint { opacity: 0; }
@media (max-width: 600px) { .zoom__hint { display: none; } .art__zoom { right: 12px; bottom: 10px; opacity: .7; } }

/* ---------- Responsive ---------- */

/* Detail page: info panel gets narrow below ~1100px, so tighten its padding */
@media (max-width: 1200px) {
  .info { padding: 32px; }
  .info__title { padding-bottom: 64px; }
}

/* Detail page stacks; the info panel sits under the artwork */
@media (max-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .info__title { padding-bottom: 48px; }
}

/* Home catalogue goes to one column on phones / small tablets */
@media (max-width: 760px) {
  .catalogue { grid-template-columns: minmax(0, 1fr); }
  .about { flex-direction: column; gap: 32px; padding: 32px; }
  .about__text, .about--legal .about__text { width: 100%; }
}

@media (max-width: 600px) {
  .nav { gap: 20px; }
  .info { padding: 24px; }
  .info__title { padding-bottom: 40px; }
  .about { padding: 24px; gap: 24px; }
  .cart { padding: 24px; }
  .cart__close { display: block; }
}


/* ---------- Motion ----------
   One language throughout: things arrive by fading up a few pixels on a long, soft ease. */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bump { 0% { transform: none; } 40% { transform: translateY(-3px); } 100% { transform: none; } }

/* Page arrival: header and footer fade, content rises, modules stagger */
.header, .footer { animation: fade var(--t-slow) var(--ease-out) both; }
.footer { animation-delay: .25s; }
.main > * { animation: rise var(--t-slow) var(--ease-out) both; animation-delay: .08s; }
.catalogue { animation: none; }
.module { animation: rise 1s var(--ease-out) both; }
.module:nth-child(1) { animation-delay: .08s; }
.module:nth-child(2) { animation-delay: .18s; }
.module:nth-child(3) { animation-delay: .28s; }
.module:nth-child(4) { animation-delay: .38s; }
.module:nth-child(n+5) { animation-delay: .44s; }
.detail { animation: none; }
.detail > .art { animation: fade 1s var(--ease-out) both; animation-delay: .05s; } /* the artwork fades in place, no movement */
.detail > .info { animation: rise 1s var(--ease-out) both; animation-delay: .2s; }
.info__body > * { animation: rise .9s var(--ease-out) both; }
.info__body > :nth-child(1) { animation-delay: .32s; }
.info__body > :nth-child(2) { animation-delay: .42s; }
.info__body > :nth-child(3) { animation-delay: .52s; }

/* Images fade in once decoded, instead of popping in line by line */
.js .art img, .js .about__photo img { opacity: 0; }
.js .art img.is-loaded, .js .about__photo img.is-loaded { opacity: 1; }
.about__photo img { transition: opacity var(--t-slow) var(--ease-out); }

/* Cart: lines drift in after the drawer, removed lines fold away */
.cart__item, .cart__total, .cart__empty, .cart__checkout { transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); }
:root:not(.is-cart-open) .cart .cart__item, :root:not(.is-cart-open) .cart .cart__total,
:root:not(.is-cart-open) .cart .cart__empty, :root:not(.is-cart-open) .cart .cart__checkout { opacity: 0; transform: translateX(16px); }
.is-cart-open .cart .cart__item:nth-child(1) { transition-delay: .18s; }
.is-cart-open .cart .cart__item:nth-child(2) { transition-delay: .23s; }
.is-cart-open .cart .cart__item:nth-child(3) { transition-delay: .28s; }
.is-cart-open .cart .cart__item:nth-child(n+4) { transition-delay: .32s; }
.is-cart-open .cart .cart__total, .is-cart-open .cart .cart__empty { transition-delay: .3s; }
.is-cart-open .cart .cart__checkout { transition-delay: .36s; }
.cart.is-settled * { transition-delay: 0s !important; }
.cart__item.is-leaving { opacity: 0; transform: translateX(24px); }
.cart__item.is-entering { animation: rise var(--t-med) var(--ease-out) both; }
[data-cart-count].is-bumping { display: inline-block; animation: bump .45s var(--ease-out); }

/* Page-to-page transitions (multi-page site) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .55s; animation-timing-function: var(--ease-out); }
::view-transition-group(*) { animation-duration: .7s; animation-timing-function: var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .art img, .js .about__photo img { opacity: 1; }
  @view-transition { navigation: none; }
}
