/* Art Gallery Day — catalog layout */

:root {
  --ink: #161616;
  --paper: #f7f5f2;
  --black: #161616;
  --muted: #6d6862;
  /* Pantone 6294 C, screen stand-in (Solid Coated). */
  --roll: #e85d04;
  --line: #e4dfd8;
  --gutter: clamp(1.1rem, 3vw, 2.75rem);
  --serif: "Bodoni Moda", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: Outfit, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.55;
  font-weight: 400;
}

body.nav-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: #fff;
  color: #111;
  padding: 0.5rem 0.8rem;
  z-index: 100;
}
.skip-link:focus { top: 0.5rem; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Header — logo on the left, menu beside it */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand nav toggle";
  align-items: center;
  column-gap: 0;
  padding: 0.35rem var(--gutter);
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.brand-row { display: contents; }

.brand {
  grid-area: brand;
  justify-self: start;
  line-height: 0;
}
.brand img {
  display: block;
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  grid-area: toggle;
  justify-self: end;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: var(--ink);
}

.site-header nav {
  grid-area: nav;
  min-width: 0;
  margin-left: clamp(2.6rem, 5vw, 5.5rem);
}

.nav-list {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: nowrap;
  width: 100%;
  gap: clamp(1rem, 2vw, 2.4rem);
  list-style: none;
  padding: 0;
}

.nav-list a {
  display: inline-block;
  padding-bottom: 0.12rem;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 500;
  letter-spacing: 0.075em;
  line-height: 1.1;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.nav-list a[aria-current="page"] {
  font-style: italic;
  border-bottom-color: var(--ink);
}
.nav-list a:hover {
  font-style: italic;
  color: var(--roll);
  border-bottom-color: var(--roll);
}

/* Opening — the name, repeated */
.repeat {
  margin: 0;
  padding: clamp(1.4rem, 4vw, 2.6rem) var(--gutter) 0;
  overflow: hidden;
}
.repeat__line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.1rem, 10.4vw, 8.6rem);
  line-height: 0.82;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.repeat__line:nth-child(2) { padding-left: 6vw; }
.repeat__line:nth-child(3) {
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
}

/* Titles */
.display {
  margin: 0;
  padding: clamp(1.6rem, 4vw, 3rem) var(--gutter) 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.lede, .when {
  max-width: 38rem;
  margin: 1.35rem 0 0;
  padding: 0 var(--gutter);
}
.lede { font-size: 1.28rem; line-height: 1.4; }
.when {
  margin-top: 0.7rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Catalog grid */
.catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.4rem 1.15rem;
  list-style: none;
  padding: clamp(2.2rem, 5vw, 3.5rem) var(--gutter) 4.5rem;
}

.catalog a { display: grid; }
.catalog img,
.catalog a::after { grid-area: 1 / 1; }
.catalog img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3.5;
  object-fit: cover;
  object-position: center 35%;
  background: #d5d2cc;
  filter: grayscale(1);
}
.catalog img,
.catalog a::after {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.catalog li:nth-child(1) img,
.catalog li:nth-child(1) a::after {
  -webkit-mask-image: url("../assets/crystal-1.svg?v=4");
  mask-image: url("../assets/crystal-1.svg?v=4");
}
.catalog li:nth-child(2) img,
.catalog li:nth-child(2) a::after {
  -webkit-mask-image: url("../assets/crystal-2.svg?v=4");
  mask-image: url("../assets/crystal-2.svg?v=4");
}
.catalog li:nth-child(3) img,
.catalog li:nth-child(3) a::after {
  -webkit-mask-image: url("../assets/crystal-3.svg?v=4");
  mask-image: url("../assets/crystal-3.svg?v=4");
}
.catalog li:nth-child(4) img,
.catalog li:nth-child(4) a::after {
  -webkit-mask-image: url("../assets/crystal-4.svg?v=4");
  mask-image: url("../assets/crystal-4.svg?v=4");
}
.catalog li:nth-child(5) img,
.catalog li:nth-child(5) a::after {
  -webkit-mask-image: url("../assets/crystal-5.svg?v=4");
  mask-image: url("../assets/crystal-5.svg?v=4");
}
.catalog li:nth-child(6) img,
.catalog li:nth-child(6) a::after {
  -webkit-mask-image: url("../assets/crystal-6.svg?v=4");
  mask-image: url("../assets/crystal-6.svg?v=4");
}
.catalog a::after {
  content: "";
  background: var(--roll);
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.catalog li:nth-child(1) img { object-position: center 42%; }
.catalog li:nth-child(2) img { object-position: center 45%; }
.catalog li:nth-child(3) img { object-position: center 30%; }
.catalog li:nth-child(4) img { object-position: center 32%; }
.catalog li:nth-child(5) img { object-position: 70% center; }
body[data-page="founder"] .prose img { object-position: center 18%; }
.catalog li:nth-child(6) img { object-position: center 32%; }
.catalog a:hover::after { opacity: 0.72; }
.catalog a:hover .kicker,
.catalog a:hover .name { color: var(--roll); }

.kicker {
  margin-top: 0.8rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.name {
  margin-top: 0.15rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.8vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* Interior pages */
.prose {
  width: min(46rem, 100% - (var(--gutter) * 2));
  margin: clamp(1.8rem, 4vw, 2.8rem) auto 0;
  padding-bottom: 4.5rem;
}
.prose figure {
  --plate: 0.35rem;
  position: relative;
  width: calc(100vw - (var(--plate) * 2));
  max-width: none;
  margin: 0 0 1.6rem;
  margin-left: calc(50% - 50vw + var(--plate));
}
.prose .plate {
  display: block;
  filter: grayscale(1);
}
.prose img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  background: #d5d2cc;
}
.prose .plate { transition: filter 0.65s ease; }
.prose img,
.prose figure::after {
  transition: clip-path 0.7s cubic-bezier(0.22, 0.7, 0.25, 1);
}
body[data-page="about"] .prose img,
body[data-page="about"] .prose figure::after {
  clip-path: polygon(13.8% 51.1%, 26.2% 17.8%, 52.5% 8.9%, 78.8% 15.6%, 93.8% 42.2%, 91.2% 71.1%, 63.8% 91.1%, 23.8% 86.7%);
}
body[data-page="about"] .prose figure:hover img,
body[data-page="about"] .prose figure:hover::after {
  clip-path: polygon(4.9% 51.4%, 17.2% 5.5%, 52.8% 4.1%, 87.4% 5.2%, 96.3% 41.8%, 95.9% 73.5%, 65.3% 95.9%, 17.7% 95.2%);
}
body[data-page="galleries"] .prose img,
body[data-page="galleries"] .prose figure::after {
  clip-path: polygon(10.0% 44.4%, 30.0% 15.6%, 61.2% 6.7%, 87.5% 22.2%, 97.5% 53.3%, 81.2% 84.4%, 40.0% 93.3%, 11.2% 73.3%);
}
body[data-page="galleries"] .prose figure:hover img,
body[data-page="galleries"] .prose figure:hover::after {
  clip-path: polygon(4.3% 43.7%, 24.0% 5.2%, 62.0% 3.8%, 95.3% 16.4%, 96.9% 53.3%, 90.7% 94.8%, 39.3% 96.2%, 4.5% 77.4%);
}
body[data-page="founder"] .prose img,
body[data-page="founder"] .prose figure::after {
  clip-path: polygon(12.5% 40.0%, 35.0% 13.3%, 67.5% 6.7%, 91.2% 26.7%, 97.5% 60.0%, 73.8% 88.9%, 32.5% 93.3%, 5.0% 64.4%);
}
body[data-page="founder"] .prose figure:hover img,
body[data-page="founder"] .prose figure:hover::after {
  clip-path: polygon(4.7% 37.9%, 31.5% 4.8%, 68.7% 3.8%, 95.9% 24.0%, 96.9% 59.9%, 77.8% 95.5%, 31.3% 96.2%, 3.5% 64.9%);
}
body[data-page="why"] .prose img,
body[data-page="why"] .prose figure::after {
  clip-path: polygon(8.8% 53.3%, 22.5% 22.2%, 55.0% 8.9%, 83.8% 17.8%, 96.2% 46.7%, 90.0% 77.8%, 52.5% 93.3%, 17.5% 80.0%);
}
body[data-page="why"] .prose figure:hover img,
body[data-page="why"] .prose figure:hover::after {
  clip-path: polygon(4.1% 53.7%, 6.7% 6.2%, 55.6% 4.1%, 94.7% 7.3%, 96.7% 46.6%, 95.7% 81.7%, 52.7% 96.2%, 5.5% 91.1%);
}
body[data-page="take"] .prose img,
body[data-page="take"] .prose figure::after {
  clip-path: polygon(11.2% 46.7%, 31.2% 17.8%, 62.5% 6.7%, 88.8% 20.0%, 97.5% 51.1%, 82.5% 84.4%, 38.8% 93.3%, 7.5% 68.9%);
}
body[data-page="take"] .prose figure:hover img,
body[data-page="take"] .prose figure:hover::after {
  clip-path: polygon(4.5% 46.1%, 24.1% 5.5%, 63.3% 3.8%, 95.5% 14.8%, 96.9% 51.1%, 92.3% 94.8%, 38.0% 96.2%, 3.9% 70.5%);
}
body[data-page="go"] .prose img,
body[data-page="go"] .prose figure::after {
  clip-path: polygon(15.0% 51.1%, 28.8% 20.0%, 58.8% 8.9%, 85.0% 17.8%, 95.0% 44.4%, 91.2% 73.3%, 60.0% 91.1%, 20.0% 82.2%);
}
body[data-page="go"] .prose figure:hover img,
body[data-page="go"] .prose figure:hover::after {
  clip-path: polygon(5.1% 51.4%, 18.8% 5.9%, 59.8% 4.1%, 94.9% 8.7%, 96.5% 44.3%, 95.9% 76.0%, 61.2% 95.9%, 8.6% 94.5%);
}
.prose figure:hover .plate { filter: grayscale(1) contrast(1.28); }
.prose figure::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  aspect-ratio: 16 / 9;
  background: var(--roll);
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: clip-path 0.7s cubic-bezier(0.22, 0.7, 0.25, 1), opacity 0.55s ease;
}
.prose figure:hover::after { opacity: 0.78; }
.prose figcaption {
  width: min(46rem, calc(100vw - (var(--gutter) * 2)));
  margin-top: 0.7rem;
  margin-left: max(0px, calc((100vw - min(46rem, 100vw - (var(--gutter) * 2))) / 2 - var(--plate)));
  color: #6d6862;
  font-size: 0.72rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.prose figcaption a { border-bottom: 1px solid #555; }
.prose figcaption a:hover {
  color: var(--roll);
  border-bottom-color: var(--roll);
}
.prose p + p,
.prose p + h2,
.prose h2 + p { margin-top: 1rem; }
.prose h2 {
  margin-top: 2.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.prose a { border-bottom: 1px solid var(--ink); }
.prose a:hover {
  color: var(--roll);
  border-bottom-color: var(--roll);
}

.ways { list-style: none; margin-top: 0.5rem; }
.ways li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.4rem 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}
.ways li:last-child { border-bottom: 1px solid var(--line); }
.ways span {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  padding-top: 0.35rem;
}
.ways h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0.08em; }
.ways p { margin-top: 0.4rem; color: #3a3835; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem var(--gutter) 2rem;
  color: #6d6862;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
}
.site-footer a { border-bottom: 1px solid #555; }
.site-footer a:hover {
  color: var(--roll);
  border-bottom-color: var(--roll);
}

.credits {
  padding: 0 var(--gutter) 3.2rem;
  color: #6d6862;
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.55;
}
.credits h2 {
  margin-bottom: 0.65rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.credits ul { list-style: none; }
.credits li + li { margin-top: 0.28rem; }
.credits a { border-bottom: 1px solid #555; }
.credits a:hover {
  color: var(--roll);
  border-bottom-color: var(--roll);
}

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

@media (max-width: 760px) {
  .site-header { grid-template-areas: "brand . toggle"; }
  .brand img { width: 88px; height: 88px; }
  .nav-toggle { display: block; }
  .nav-list {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    padding: 5.5rem var(--gutter) 2rem;
    background: var(--paper);
  }
  .nav-list.is-open { display: flex; }
  .nav-list a {
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e6e6e6;
    font-size: 1.85rem;
    letter-spacing: -0.02em;
  }
  .catalog { grid-template-columns: 1fr; gap: 2rem; }
  .repeat__line { font-size: clamp(2.4rem, 13vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .catalog a::after,
  .prose figure::after { transition: none; }
}

/* Chat assistant */
.chatbot {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 1rem));
  bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
  z-index: 45;
  font-family: var(--sans);
}

.chatbot__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(12rem, calc(100vw - 2rem));
  min-height: 48px;
  padding: 0.55rem 0.9rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 30px rgba(22, 22, 22, 0.12);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.chatbot__toggle:hover { background: var(--roll); }

.chatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  width: min(340px, calc(100vw - 2rem));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #e6e6e6;
  box-shadow: 0 16px 40px rgba(22, 22, 22, 0.12);
  overflow: hidden;
}

.chatbot__panel[hidden] { display: none; }

.chatbot__header {
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid #e6e6e6;
}

.chatbot__title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chatbot__subtitle {
  margin-top: 0.25rem;
  color: #6d6d6d;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.chatbot__message {
  max-width: 92%;
  padding: 0.7rem 0.8rem;
  font-size: 0.88rem;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.chatbot__message--bot {
  align-self: flex-start;
  background: #f4f4f4;
}

.chatbot__sender {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chatbot__message--user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
}

.chatbot__message a {
  color: inherit;
  border-bottom: 1px solid currentColor;
}
.chatbot__message a:hover {
  color: var(--roll);
  border-bottom-color: var(--roll);
}

.chatbot__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  max-height: 7.2rem;
  overflow-y: auto;
}

.chatbot__suggestion {
  padding: 0.35rem 0.6rem;
  border: 1px solid #d0d0d0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.chatbot__suggestion:hover {
  color: var(--roll);
  border-color: var(--roll);
}

.chatbot__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid #e6e6e6;
}

.chatbot__input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}

.chatbot__input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

.chatbot__submit {
  padding: 0.55rem 0.75rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.chatbot__submit:hover { background: var(--roll); }
