@font-face {
  font-family: 'Inter Tight';
  src: url('fonts/inter-tight.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --wall: #f4f3f0;
  --ink: #1b1a18;
  --muted: #6c6963;
  --line: #d6d3cc;
  --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 16px/1.5 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }
h1, h2, p { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Header and footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px var(--gutter);
  background: var(--wall);
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px clamp(14px, 2.4vw, 28px);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.order-link { letter-spacing: inherit; }
.order-link:hover { color: var(--muted); }

/* Oak frame, used on every artwork */
.frame {
  --frame-width: 8px;
  position: relative;
  display: block;
  border: var(--frame-width) solid transparent;
  border-image: url('frame-oak.webp') 48 stretch;
  box-shadow: 2px 3px 4px rgb(40 28 16 / 0.3), 7px 10px 20px rgb(40 28 16 / 0.24);
}
.frame::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 2px 3px rgb(20 12 6 / 0.42), inset 1px 0 2px rgb(20 12 6 / 0.2), inset -1px 0 2px rgb(20 12 6 / 0.2);
  pointer-events: none;
}
.frame img { width: 100%; }

/* Limited edition on the work page: passe-partout, then the paper's printed white border.
   --mat and --paper are set by order.js from the chosen size (see mounting in content.mjs). */
.work-image .frame {
  --mat: 0;
  --paper: 0;
  background: #fbfaf7;
  padding: calc((100% - 2 * var(--frame-width)) * var(--mat));
  /* Medium and Small are drawn smaller than Large, scaled around the centre */
  transform: scale(var(--scale, 1));
  transition: padding 0.35s ease, transform 0.35s ease;
}
.work-image .frame img {
  padding: calc(100% * var(--paper));
  background: #f7f5ef;
  transition: padding 0.35s ease, box-shadow 0.35s ease;
}
/* The bevelled cut edge of the passe-partout, and its slight shadow on the paper */
.work-image .frame.mounted img {
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px rgb(60 50 40 / 0.12), inset 0 1px 3px rgb(60 50 40 / 0.18);
}
@media (prefers-reduced-motion: reduce) {
  .work-image .frame,
  .work-image .frame img { transition: none; }
}
.hero .frame { --frame-width: 12px; }
.work-image .frame { --frame-width: 14px; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(64px, 10vw, 140px);
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.site-footer nav { display: flex; gap: 20px; }

/* Home */
.intro {
  padding: clamp(40px, 8vw, 110px) var(--gutter) clamp(32px, 5vw, 64px);
}
.intro h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.intro p {
  max-width: 34em;
  margin-top: 14px;
  font-size: 17px;
}
.intro .byline { margin-top: 2px; font-size: clamp(18px, 1.8vw, 22px); font-weight: 500; }
.hero { display: block; padding: 0 var(--gutter); }
.hero img { width: 100%; }

.group {
  display: grid;
  grid-template-columns: minmax(150px, 15vw) minmax(0, 1fr);
  gap: var(--gutter);
  padding: clamp(56px, 8vw, 110px) var(--gutter) 0;
}
.group h2 {
  position: sticky;
  top: 70px;
  align-self: start;
  font-size: 16px;
  font-weight: 500;
}

.tiles { display: grid; gap: clamp(36px, 4vw, 64px) clamp(16px, 3vw, 40px); align-items: start; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-tall { display: flex; justify-content: center; gap: clamp(32px, 10vw, 160px); }

.tile { display: block; }
.tile img { width: 100%; transition: opacity 0.2s ease; }
.tile:hover img { opacity: 0.88; }
.tile-title { display: block; margin-top: 10px; font-size: 14px; }
.tile:not(:hover) .tile-title { color: var(--ink); }
.tile-panorama { grid-column: 1 / -1; }
.tile-tall { width: min(240px, 40vw); }

/* Work page */
.work { padding: clamp(16px, 3vw, 32px) var(--gutter) 0; }
.work-image img { width: 100%; }
.work-square,
.work-other,
.work-tall {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.work-square .work-image { max-width: calc(100vh - 110px); margin-left: auto; }
.work-other .work-image { max-width: calc((100vh - 110px) * 1.23); margin-left: auto; }
.work-tall .work-image { max-width: 460px; margin-left: auto; }
.work-square .work-info,
.work-other .work-info,
.work-tall .work-info { position: sticky; top: 70px; }

.work-panorama .work-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(24px, 3vw, 40px);
}
.work-panorama .text { max-width: 34em; }

.eyebrow { color: var(--muted); font-size: 14px; }
.work h1 {
  margin-top: 4px;
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.text { margin-top: 16px; }
.work-square .buy,
.work-other .buy,
.work-tall .buy { margin-top: 32px; }

fieldset { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 14px; }

.option { display: block; cursor: pointer; }
.option + .option { margin-top: 8px; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--line);
  transition: border-color 0.15s ease;
}
.option strong { display: block; font-weight: 500; }
.option small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.option:hover span { border-color: var(--muted); }
.option input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.size-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.option-size + .option-size { margin-top: 0; }
.option-size span { padding: 11px 6px; text-align: center; }
.option-size strong { font-size: 14px; }

.price { font-size: 26px; letter-spacing: -0.01em; margin-bottom: 12px; }
.button {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--wall);
  text-align: center;
  font-weight: 500;
  transition: background 0.15s ease;
}
.button:hover:not(:disabled) { background: #45433e; color: var(--wall); }
.button:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.button-secondary { margin-top: 18px; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.button-secondary:hover:not(:disabled) { background: var(--ink); color: var(--wall); }
a.option { color: inherit; text-decoration: none; }
.note { margin-top: 10px; color: var(--muted); font-size: 14px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(56px, 8vw, 96px);
  padding: 0 var(--gutter);
  font-size: 14px;
}
.pager a:last-child { text-align: right; }
.work + .pager + * { margin-top: 0; }

/* Order drawer */
.order {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(440px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 18px var(--gutter);
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--wall);
  color: var(--ink);
  overflow-y: auto;
}
.order[open] { display: flex; flex-direction: column; }
.order::backdrop { background: rgb(27 26 24 / 0.35); }
.order-head { display: flex; justify-content: space-between; align-items: baseline; }
.order-head h2 { font-size: 16px; font-weight: 600; }
.order-items { list-style: none; margin: 24px 0 0; padding: 0; }
.order-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.order-item img { width: 72px; height: 72px; object-fit: cover; }
.order-item small { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; }
.order-item button { margin-top: 4px; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }
.order-empty { margin-top: 24px; color: var(--muted); }
.order-foot { margin-top: auto; padding-top: 24px; }
.order-total { display: flex; justify-content: space-between; font-size: 20px; }
.delivery { display: block; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.delivery select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--wall);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.order-error { color: #9a2b1f; }
.order-foot .note { margin-bottom: 14px; }
.order-foot .button + .note { margin-bottom: 0; }

/* About and legal */
.prose { max-width: 40em; padding: clamp(40px, 7vw, 90px) var(--gutter) 0; }
.prose h1 { font-size: clamp(28px, 3.2vw, 42px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.prose h2 { margin-top: 40px; font-size: 16px; font-weight: 600; scroll-margin-top: 70px; }
.prose p { margin-top: 14px; }
.prose .lede { margin-top: 24px; font-size: 20px; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 899px) {
  .frame { --frame-width: 5px; }
  .hero .frame { --frame-width: 6px; }
  .work-image .frame { --frame-width: 8px; }
  .group { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .group h2 { position: static; }
  .tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-square,
  .work-other,
  .work-tall,
  .work-panorama .work-info { grid-template-columns: minmax(0, 1fr); }
  .work-square .work-image,
  .work-other .work-image { max-width: none; margin: 0; }
  .work-tall .work-image { max-width: min(320px, 100%); margin: 0 auto; }
  .work-square .work-info,
  .work-other .work-info,
  .work-tall .work-info { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Legal page and withdrawal form */
.prose h3 { margin-top: 24px; font-size: 15px; font-weight: 600; }
.legal .note { margin-top: 8px; }
.withdraw { display: grid; gap: 16px; margin-top: 28px; }
.withdraw label { display: grid; gap: 6px; font-size: 14px; }
.withdraw input, .withdraw textarea, .withdraw select { font: inherit; padding: 10px 12px; border: 1px solid currentColor; border-radius: 0; background: transparent; color: inherit; width: 100%; }
.withdraw .trap { position: absolute; left: -9999px; }
.withdraw .button { justify-self: start; }
