@font-face {
  font-family: 'Google Sans Flex';
  src: url('assets/fonts/GoogleSansFlex.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

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

:root {
  --margin: 40px;
  --gutter: 20px;
  --muted: #C5C5C5;
  --stroke: #D4D4D4;
}

body {
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.04em;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* 8-column grid matching the Figma frame (1512 wide: 40 margin, 20 gutter) */
.grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding: 0 var(--margin);
}

/* ── Header ── */
header.grid {
  height: 157px;
  padding-top: 40px;
  align-items: start;
}

.wordmark {
  grid-column: 1;
  display: block;
  width: 160px;
}

.wordmark img {
  width: 100%;
  height: auto;
  display: block;
}

.last-updated {
  grid-column: 7 / 9;
  justify-self: end;
  font-weight: 400;
  color: var(--muted);
}

/* ── Page ── */
.page {
  align-items: start;
  padding-bottom: 120px;
}

nav {
  grid-column: 1;
  display: flex;
  flex-direction: column;
}

nav a {
  position: relative;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 26px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

nav a:first-child {
  margin-top: -3px;
}

nav a:hover,
nav a.active {
  color: #000;
}

nav a.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: #000;
}

.content {
  grid-column: 2 / 8;
  padding-left: 64px;
}

h1 {
  font-size: 24px;
  font-weight: 400;
  line-height: 30px;
}

.bio {
  max-width: 760px;
  margin-top: 22px;
  font-size: 24px;
  line-height: 30px;
}

.bio p + p {
  margin-top: 30px;
}

/* ── Photos ── */
.photos {
  display: grid;
  max-width: 644px;
  grid-template-columns: minmax(0, 1362fr) minmax(0, 1146fr);
  gap: 12px;
  margin-top: 46px;
}

.photo {
  position: relative;
  isolation: isolate;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.photo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.photo::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(to top, #0E0E0E 0%, rgba(115, 115, 115, 0) 100%);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  pointer-events: none;
  z-index: 3;
}

.photo figcaption {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.photo:hover img {
  transform: scale(1.02);
}

.photo:hover::before,
.photo:hover figcaption {
  opacity: 1;
}

/* ── Archive ── */
@property --row-height {
  syntax: '<length>';
  inherits: true;
  initial-value: 300px;
}

.archive {
  grid-column: 2 / 9;
  margin-top: -3px;
}

.category h2 {
  font: inherit;
}

.category-header {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
  color: #555;
  border-bottom: 2px solid #F5F5F5;
}

.category-header:focus-visible {
  outline: 1px solid #000;
  outline-offset: 4px;
}

.chevron {
  flex: none;
  color: #000;
  transition: transform 0.3s ease;
}

.category.is-expanded .chevron {
  transform: rotate(180deg);
}

.category.is-static .category-header {
  cursor: default;
}

.category.is-static .chevron {
  visibility: hidden;
}

.gallery-wrap {
  overflow: hidden;
  transition: height 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.no-anim .gallery-wrap,
.no-anim .category,
.no-anim .chevron {
  transition: none;
}

.gallery {
  --row-height: clamp(200px, 21.8vw, 420px);
  --gap: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-top: 20px;
}

.category {
  padding-bottom: 31px;
  transition: padding-bottom 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.category.is-folded {
  padding-bottom: 0;
}

.gallery-row {
  display: flex;
  gap: var(--gap);
}

.artwork {
  position: relative;
  isolation: isolate;
  flex: none;
  border-radius: 4px;
  overflow: hidden;
  background: #FAFAFA;
}

.artwork img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.artwork::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(to top, #0E0E0E 0%, rgba(115, 115, 115, 0) 100%);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.artwork::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  pointer-events: none;
  z-index: 3;
}

.artwork figcaption {
  position: absolute;
  white-space: nowrap;
  overflow: hidden;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

@media (hover: hover) {
  .artwork:hover::before,
  .artwork:hover figcaption {
    opacity: 1;
  }
}

/* ── Shop ── */
.shop {
  grid-column: 2 / 9;
}

.shop-intro {
  max-width: 760px;
  font-size: 24px;
  line-height: 30px;
  margin-top: -5px;
}

.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 40px;
  margin-top: 46px;
}

.product-image {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #FAFAFA;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  isolation: isolate;
}

.product-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.product-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  pointer-events: none;
}

.product-image:hover img {
  transform: scale(1.02);
}

.product-image:focus-visible {
  outline: 1px solid #000;
  outline-offset: 3px;
}

.product-info {
  margin-top: 16px;
}

.product-title {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
}

.product-meta {
  color: var(--muted);
}

.product-buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.product-enquire {
  color: #000;
  text-decoration: none;
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 7px 14px 8px;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.product-enquire:hover,
.product-enquire:focus-visible {
  background: #000;
  border-color: #000;
  color: #fff;
  outline: none;
}

.shop-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin-top: 80px;
  padding-top: 20px;
  border-top: 2px solid #F5F5F5;
}

.shop-notes dd {
  color: var(--muted);
  margin-top: 4px;
}

/* ── Shop product view ── */
.pv {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow-y: auto;
  animation: viewer-in 0.2s ease;
}

.pv[hidden] {
  display: none;
}

.pv button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.pv button:hover,
.pv button:focus-visible {
  color: #000;
}

.pv button:focus-visible {
  outline: 1px solid #000;
  outline-offset: 4px;
}

.pv-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px var(--margin) 0;
  color: var(--muted);
}

.pv-body {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
  padding: 24px var(--margin) 40px;
  min-height: 0;
}

.pv-art {
  grid-column: 1 / 6;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 0;
}

.pv-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--stroke);
}

.pv-details {
  grid-column: 6 / 9;
  max-width: 420px;
}

.pv-title {
  font-size: 24px;
  font-weight: 400;
  line-height: 30px;
}

.pv-meta {
  margin-top: 8px;
  color: var(--muted);
}

.pv-price {
  margin-top: 24px;
  font-size: 24px;
  line-height: 30px;
}

.pv .pv-enquire {
  display: block;
  margin-top: 16px;
  padding: 12px 16px 13px;
  text-align: center;
}

.pv-notes {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 2px solid #F5F5F5;
  color: var(--muted);
}

.pv-notes p + p {
  margin-top: 8px;
}

.pv-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
}

.pv-nav[hidden] {
  display: none;
}

/* ── Artwork viewer ── */
.artwork {
  cursor: zoom-in;
}

.artwork:focus-visible {
  outline: 1px solid #000;
  outline-offset: 3px;
}

.viewer-open,
.viewer-open body {
  overflow: hidden;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #fff;
  animation: viewer-in 0.2s ease;
}

.viewer[hidden] {
  display: none;
}

@keyframes viewer-in {
  from { opacity: 0; }
}

.viewer button {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.viewer button:hover,
.viewer button:focus-visible {
  color: #000;
}

.viewer button:focus-visible {
  outline: 1px solid #000;
  outline-offset: 4px;
}

.viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px var(--margin) 0;
  color: var(--muted);
}

.viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px var(--margin) 40px;
}

.viewer .viewer-prev,
.viewer .viewer-next {
  flex: none;
  font-size: 24px;
  padding: 12px;
}

.viewer-prev[hidden],
.viewer-next[hidden] {
  visibility: hidden;
  display: block;
}

.viewer-figure {
  min-width: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.viewer-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--stroke);
}

.viewer-caption {
  color: var(--muted);
  text-align: center;
}

/* ── Small screens ── */
@media (max-width: 900px) {
  :root {
    --margin: 20px;
  }

  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  header.grid {
    height: auto;
    padding-top: 18px;
    padding-bottom: 58px;
  }

  .wordmark {
    width: 107px;
  }

  .last-updated {
    grid-column: 3 / 5;
  }

  /* staggered two-row layout; centres measured from the iPhone Figma frame */
  nav {
    grid-column: 1 / -1;
    position: relative;
    display: block;
    height: 72px;
  }

  nav a {
    position: absolute;
    top: 0;
    font-size: 16px;
    line-height: 36px;
    font-weight: 400;
    white-space: nowrap;
    transform: translateX(-50%);
  }

  nav a:first-child {
    margin-top: 0;
    left: 0;
    transform: none;
  }

  nav a:nth-child(2) { left: 48.7%; }
  nav a:nth-child(3) { left: 25.5%; top: 36px; }
  nav a:nth-child(4) { left: 72.4%; top: 36px; }
  nav a:nth-child(5) { left: 89.6%; }

  nav a.active::before {
    position: static;
    display: inline-block;
    vertical-align: middle;
    margin: -2px 4px 0 0;
  }

  .content {
    grid-column: 1 / -1;
    padding-left: 0;
    margin-top: 48px;
  }

  h1,
  .bio {
    font-size: 20px;
    line-height: 26px;
  }

  .bio p + p {
    margin-top: 26px;
  }

  .photos {
    margin-top: 32px;
  }

  .archive {
    grid-column: 1 / -1;
    margin-top: 11px;
  }

  .category {
    border-top: 2px solid #F5F5F5;
    padding-bottom: 24px;
  }

  .category-header {
    padding: 12px 0;
    border-bottom: 0;
    color: #000;
  }

  .category-name::before {
    content: '';
    display: inline-block;
    vertical-align: middle;
    width: 4px;
    height: 4px;
    margin: -2px 4px 0 0;
    border-radius: 50%;
    background: #000;
  }

  .gallery {
    --row-height: 180px;
    --per-row: 2;
    padding-top: 9px;
  }

  .viewer-bar {
    padding-top: 20px;
  }

  .viewer-stage {
    gap: 0;
    padding: 16px 8px 24px;
  }

  .viewer .viewer-prev,
  .viewer .viewer-next {
    padding: 8px;
    font-size: 20px;
  }

  .viewer-img {
    max-height: calc(100vh - 150px);
  }

  .shop {
    grid-column: 1 / -1;
    margin-top: 48px;
  }

  .shop-intro {
    font-size: 20px;
    line-height: 26px;
    margin-top: 0;
  }

  .products {
    grid-template-columns: 1fr;
    gap: 48px;
    margin-top: 32px;
  }

  .shop-notes {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 64px;
  }

  .pv-bar {
    padding-top: 20px;
  }

  .pv-body {
    display: block;
    flex: none;
    padding: 16px var(--margin) 40px;
  }

  .pv-art {
    height: auto;
  }

  .pv-img {
    max-height: 70vh;
  }

  .pv-details {
    max-width: none;
    margin-top: 24px;
  }

  .pv-title,
  .pv-price {
    font-size: 20px;
    line-height: 26px;
  }
}
