:root {
  color-scheme: light;
  --paper: #f5f0e8;
  --ink: #201e1a;
  --muted: #60594f;
  --line: #c8bfb2;
  --accent: #873d27;
  --display: Georgia, 'Times New Roman', serif;
  --utility: system-ui, sans-serif;
  --gutter: clamp(1.1rem, 4.5vw, 4.35rem);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--utility); }
a { color: inherit; }
button, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
img { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible, textarea:focus-visible, .sizes label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.frame { width: min(calc(100% - 2rem), 94rem); margin-inline: auto; }
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 4.3rem;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line);
}
.wordmark { font: 2.35rem/.9 var(--display); letter-spacing: .045em; text-decoration: none; }
.site-header nav a { font-size: .96rem; text-decoration: none; text-underline-offset: .25em; }
.site-header nav a:hover, .site-footer > a:last-child:hover { text-decoration: underline; }
.demo-note { color: var(--muted); font-size: .85rem; text-align: end; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 25.5rem;
  border-bottom: 1px solid var(--line);
}
.hero-copy {
  padding: clamp(2.5rem, 4vw, 4rem) var(--gutter);
  align-self: center;
}
h1, h2, .product-name { font-family: var(--display); font-weight: 400; }
h1, h2, p { margin: 0; }
h1 {
  margin-bottom: 1.15rem;
  font-size: clamp(3rem, 5.65vw, 6rem);
  line-height: .94;
  letter-spacing: -.053em;
}
.hero-copy p { margin-bottom: 1.75rem; color: var(--muted); line-height: 1.55; }
.hero-image { width: 100%; height: 100%; object-fit: cover; object-position: 68% center; }
.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: .72rem 1.55rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  line-height: 1.3;
}
.button:hover:not(:disabled) { background: #40382f; border-color: #40382f; }
.button:disabled { color: var(--muted); background: #e9e1d5; border-color: #d1c6b7; }

.catalog { padding: 1.65rem var(--gutter) 3.75rem; scroll-margin-block-start: 1rem; }
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.35rem;
  margin-bottom: 1.8rem;
}
h2 { font-size: clamp(2.4rem, 3.5vw, 3.65rem); line-height: .97; letter-spacing: -.052em; }
.filters { display: flex; flex-wrap: wrap; gap: .38rem clamp(.7rem, 3vw, 2.8rem); }
.filters button { padding: .55rem .16rem; border: 0; border-bottom: 1px solid transparent; background: none; font-size: .96rem; }
.filters button[aria-pressed="true"], .filters button:hover { border-bottom-color: var(--ink); }
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.1rem, 3.45vw, 3.8rem); }
.product-trigger {
  display: grid;
  width: 100%;
  gap: .38rem;
  padding: 0 0 1rem;
  text-align: start;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
}
.product-trigger:hover .product-name { color: var(--accent); }
.product-image { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: #e8d6bc; margin-bottom: .64rem; }
.product-info, .product-detail { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.product-name { font-size: clamp(1.45rem, 2.2vw, 2.1rem); line-height: 1.05; letter-spacing: -.045em; }
.product-price { flex-shrink: 0; font-size: .94rem; }
.product-detail { min-height: 1.5rem; color: var(--muted); font-size: .83rem; }
.product-arrow { font-size: 1.13rem; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1.8rem var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.site-footer .wordmark { font-size: 1.5rem; color: var(--ink); }
.site-footer p { flex: 1 1 15rem; }
.site-footer > a:last-child { margin-inline-start: auto; text-underline-offset: .18rem; }

dialog {
  position: fixed;
  inset: 0;
  width: min(52rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop { background: rgb(32 30 26 / .64); }
.dialog-layout { display: grid; grid-template-columns: .92fr 1.08fr; min-height: 29rem; }
.dialog-media { position: relative; min-width: 0; }
.dialog-media > img { display: block; height: 100%; width: 100%; object-fit: cover; object-position: center 38%; background: #e8d6bc; }
.dialog-photo-picker { position: absolute; inset: auto auto .8rem .8rem; display: flex; gap: .35rem; }
.dialog-photo-picker button { min-width: 2.75rem; min-height: 2.75rem; border: 1px solid var(--line); background: var(--paper); }
.dialog-photo-picker button[aria-pressed="true"] { color: var(--paper); background: var(--ink); }
.dialog-copy { padding: 2.75rem 2.25rem 2rem; line-height: 1.48; }
.dialog-copy h2 { font-size: clamp(2.15rem, 4vw, 3.35rem); }
.dialog-price { margin: .8rem 0; }
#dialog-description, #choose-size, .message-preview p { color: var(--muted); }
#choose-size { margin-top: .8rem; font-size: .82rem; }
.order-action { margin-top: .95rem; }
.close-product {
  position: absolute;
  z-index: 1;
  top: .65rem;
  right: .65rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background: var(--paper);
  font: 1.75rem/1 var(--utility);
}
fieldset { margin: 1.4rem 0 0; border: 0; padding: 0; }
legend { margin-bottom: .5rem; padding: 0; font-weight: 600; font-size: .92rem; }
.sizes { display: flex; flex-wrap: wrap; gap: .45rem; }
.sizes label { position: relative; cursor: pointer; }
.sizes input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sizes span { display: grid; min-width: 2.55rem; min-height: 2.55rem; padding: .2rem; place-items: center; border: 1px solid var(--line); font-size: .86rem; }
.sizes input:checked + span { border-color: var(--ink); color: var(--paper); background: var(--ink); }
.message-preview { margin-top: 1rem; }
.message-preview label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .86rem; }
.message-preview textarea { width: 100%; padding: .6rem; color: var(--ink); border: 1px solid var(--line); background: #faf6ef; resize: vertical; font-size: .87rem; }
.message-preview p { font-size: .8rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 760px) {
  .frame { width: calc(100% - 1.4rem); }
  .site-header { min-height: 3.7rem; }
  .wordmark { font-size: 1.8rem; }
  .demo-note { font-size: .73rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-block: 2rem 2.15rem; }
  .hero-image { height: auto; aspect-ratio: 16 / 9; }
  h1 { font-size: clamp(3rem, 9vw, 5rem); }
  .catalog-header { flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .site-header { padding-inline: .65rem; gap: .45rem; }
  .site-header nav a { font-size: .82rem; }
  .hero-copy { padding-inline: 1rem; }
  .catalog { padding-inline: 1rem; }
  .catalog-header { display: block; }
  .catalog-header h2 { margin-bottom: .85rem; }
  .products { grid-template-columns: 1fr; gap: 1.4rem; }
  .product-image { aspect-ratio: 1 / 1.15; }
  .dialog-layout { display: block; }
  .dialog-media > img { height: min(15rem, 36dvh); }
  .dialog-copy { padding: 1.3rem 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
