:root {
  --paper: #f7f5f0;
  --ink: #322e28;
  --muted: #595147;
  --rule: #d8d0c3;
  --serif: "Baskervville", "Baskerville", Georgia, serif;
  --typewriter: "Cutive Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html.landing, .landing body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.125rem/1.55 var(--serif); }
a, button { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #675540; outline-offset: 4px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

nav { display: flex; justify-content: center; gap: clamp(.55rem, 4vw, 3.25rem); padding: .65rem .5rem; }
nav a, .outline, .print-label { font: 1rem/1.25 var(--typewriter); font-weight: 600; }
nav a { padding: .6rem .12rem; white-space: nowrap; text-decoration: none; }
nav a:hover, nav a[aria-current] { text-decoration: underline; text-underline-offset: .42em; }

main, footer { width: min(90%, 1180px); margin-inline: auto; }
.outline { position: relative; display: inline-block; padding: .73rem 1.15rem; border: 1px solid #827465; background: transparent; text-decoration: none; }
.outline:hover { background: #ebe5db; }

.section { min-height: 55vh; padding-block: clamp(2.4rem, 5vw, 4.3rem); }
.section h1, .section h2, dialog h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 400; line-height: 1.1; margin: 0 0 1.45rem; }
.works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.print-button { width: 100%; display: grid; gap: .35rem; padding: 0; background: transparent; border: 0; text-align: left; }
.print-image { display: grid; place-items: center; padding: clamp(.75rem, 2vw, 1.5rem); background: #eee9df; }
.print-image img { display: block; width: 100%; height: clamp(180px, 21vw, 310px); object-fit: contain; transition: transform 220ms ease; }
.print-button:hover img { transform: scale(1.025); }
.print-title { font: 400 clamp(1.35rem, 2.1vw, 1.8rem)/1.18 var(--serif); margin-top: .6rem; }
.print-label { color: var(--muted); }
.print-button:hover .print-label { text-decoration: underline; text-underline-offset: .25em; }
.section p { margin: 0 0 1rem; max-width: 36rem; }
.section p:last-child { margin-bottom: 0; }
footer { padding: 1.5rem 0 2rem; border-top: 1px solid var(--rule); color: var(--muted); font: .95rem var(--typewriter); }

dialog { color: var(--ink); width: min(720px, 94vw); max-height: 90vh; background: var(--paper); border: 1px solid var(--rule); padding: clamp(1rem, 4vw, 2rem); }
dialog img { display: block; max-width: 100%; height: auto; margin: 1rem auto; }
dialog::backdrop { background: #29241dc2; }
dialog form { display: flex; justify-content: flex-end; margin-bottom: 1rem; }


.enter, dialog[open] {
  animation: settle 1.5s cubic-bezier(.22, .61, .36, 1) var(--delay, 0s) both;
}
.section > .enter { --delay: .18s; }
.print:nth-child(2) { --delay: .16s; }
.print:nth-child(3) { --delay: .32s; }
.motion-pending { opacity: 0; }
.motion-pending:focus-within { opacity: 1; }

@keyframes settle {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 380px) {
  nav { gap: .4rem; }
  nav a { font-size: .875rem; }
}

@media (max-width: 650px) {
  .works { grid-template-columns: 1fr; }
  .print-image img { height: clamp(215px, 65vw, 350px); }
  .print:nth-child(n) { --delay: 0s; }
}

@media (prefers-reduced-motion: reduce) {
  .enter, dialog[open] { animation: none; }
  .motion-pending { opacity: 1; }
  .print-image img { transition: none; }
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  background: var(--paper);
}
.intro-active .intro { display: grid; }
.intro img { width: min(82vw, 36rem); height: auto; opacity: 0; }
.intro.is-ready img { animation: signature 3.3s ease both; }

@keyframes signature {
  0% { opacity: 0; transform: translateY(-12px); }
  35%, 78% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}

.home-artworks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(.75rem, 3vw, 2.75rem);
  height: 100vh;
  height: 100dvh;
  max-width: 72rem;
  padding-block: 1rem;
}
.intro-active .home-artworks { visibility: hidden; }
.artwork { display: block; width: fit-content; max-width: 100%; }
.artwork img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(69vh, 34rem);
  object-fit: contain;
  transition: filter .3s ease;
}
.artwork:hover img { filter: brightness(.94); }
.is-revealed .artwork { animation: settle 1.65s cubic-bezier(.22, .61, .36, 1) var(--delay, 0s) both; }
.artwork:nth-child(2) { --delay: .18s; }
.artwork:nth-child(3) { --delay: .36s; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: clamp(2rem, 6vw, 6rem);
}
.product-images { display: grid; justify-items: center; gap: 1.5rem; }
.product-images img { display: block; max-width: 100%; height: auto; }

@media (max-width: 650px) and (orientation: portrait) {
  .home-artworks {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: .75rem;
  }
  .artwork img {
    max-height: calc((100vh - 3.5rem) / 3);
    max-height: calc((100dvh - 3.5rem) / 3);
  }
}

@media (max-width: 650px) {
  .product { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .intro.is-ready img { animation: none; opacity: 1; }
  .is-revealed .artwork { animation: none; }
  .artwork img { transition: none; }
}

.landing-signature {
  display: block;
  width: auto;
  height: clamp(4rem, 19dvh, 9.25rem);
  max-width: 82vw;
  max-height: calc(100% - 1rem);
  object-fit: contain;
  place-self: center;
  transform: translateY(clamp(.35rem, 1.7dvh, .9rem));
}

.landing-bar nav a {
  animation: settle 1.7s cubic-bezier(.22, .61, .36, 1) var(--delay, 0s) both;
}
.landing-bar nav a:nth-child(2) { --delay: .16s; }
.landing-bar nav a:nth-child(3) { --delay: .32s; }
.landing-bar nav a:nth-child(4) { --delay: .48s; }
.landing-bar nav a:nth-child(5) { --delay: .64s; }
.intro-active :is(.landing-bar, .landing-signature) { visibility: hidden; }
.intro-active .landing-bar nav a { animation: none; }
.landing body { display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 2.65fr); }
.landing .home-artworks {
  height: 100%;
  min-height: 0;
  container-type: size;
}

.landing .artwork img {
  max-height: min(calc(100cqh - 2.75rem), 34rem);
}

.is-revealed .artwork img {
  animation: float-print var(--float-duration, 7s) ease-in-out var(--float-delay, 1.5s) infinite;
}
.artwork:nth-child(2) { --float-duration: 8s; --float-delay: 1.9s; }
.artwork:nth-child(3) { --float-duration: 7.5s; --float-delay: 2.35s; }
.is-revealed .artwork:is(:hover, :focus-visible) img { animation-play-state: paused; }

@keyframes float-print {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.catalog-link { text-decoration: none; }
.shop-works { margin-top: 1.5rem; }
[data-print] [hidden] { display: none; }

@media (max-width: 650px) and (orientation: portrait) {
  .landing body { grid-template-rows: auto minmax(0, 1fr) minmax(0, 3.2fr); }

  .landing .artwork img {
    max-height: calc((100cqh - 4.25rem) / 3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-bar nav a, .is-revealed .artwork img { animation: none; }
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .85fr);
  gap: clamp(2rem, 8vw, 7rem);
  align-items: center;
  max-width: 980px;
  margin-inline: auto;
}
.contact-letter { min-width: 0; }
.contact-letter > p { color: var(--muted); }
.contact-letter form { margin-top: 1.8rem; }
.contact-letter fieldset { display: grid; gap: 1.15rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.contact-letter label {
  display: grid;
  gap: .35rem;
  font: 1rem/1.4 var(--typewriter);
  font-weight: 600;
}
.contact-letter input, .contact-letter textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: .65rem .7rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid #c6baab;
  border-radius: 0;
  font: 1.08rem/1.5 var(--serif);
}
.contact-letter textarea { resize: vertical; min-height: 7rem; }
.contact-letter button { justify-self: start; }
.contact-letter fieldset:disabled { opacity: .72; }
.contact-letter button:disabled { cursor: not-allowed; }
.contact-letter .contact-note { font: .9rem/1.45 var(--typewriter); color: var(--muted); margin: .9rem 0 0; }
.contact-art { display: grid; justify-items: center; gap: 1.7rem; }
.contact-print { display: block; width: 100%; max-width: 350px; height: auto; max-height: 50vh; object-fit: contain; }
.contact-signature { display: block; width: min(70%, 260px); height: auto; }
@media (max-width: 680px) {
  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-art { justify-self: center; }
  .contact-print { max-height: 45vh; }
}
@media (max-width: 400px) {
  .contact-fields { grid-template-columns: 1fr; }
}
