:root {
  color-scheme: light;
  color: #171613;
  background: #fff;
  font: 16px/1.5 system-ui, sans-serif;
  --muted: #625b51;
  --gold: #7d571b;
  --line: #e9e4da;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .24em; }
button, input, select { font: inherit; }
button:enabled, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
img { display: block; max-width: 100%; }
[hidden] { display: none; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  padding: .75rem;
  background: #fff;
  transform: translateY(-220%);
}
.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner, main {
  width: min(1280px, 100%);
  padding-inline: clamp(1rem, 4vw, 3.75rem);
  margin-inline: auto;
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .75rem;
}
.brand img { width: clamp(116px, 15vw, 174px); height: auto; }
.masthead nav { display: flex; gap: clamp(.85rem, 3vw, 2.6rem); font-size: .85rem; }
.masthead nav a { padding-block: .75rem; text-decoration: none; white-space: nowrap; }
.masthead nav a:hover { text-decoration: underline; }

section { scroll-margin-top: 1.5rem; }
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 5vw, 5.5rem);
  align-items: center;
  padding-block: clamp(2rem, 4vw, 3.8rem);
}

.photo-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin: 0;
  background: #fff;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.photo-frame img.render { transform: scale(1.22); }
.photo-frame figcaption {
  position: absolute;
  inset: .25rem .25rem auto auto;
  max-width: min(18rem, 61%);
  padding: .25rem .4rem;
  color: var(--muted);
  background: #fffe;
  font-size: .69rem;
  line-height: 1.35;
  text-align: right;
}
.angles {
  display: flex;
  justify-content: center;
  gap: clamp(.5rem, 2vw, 1.2rem);
  margin-top: .45rem;
}
.angles button {
  display: grid;
  justify-items: center;
  gap: .24rem;
  min-width: 84px;
  min-height: 44px;
  padding: .35rem .4rem;
  border: 1px solid transparent;
  color: var(--muted);
  background: #fff;
  font-size: .73rem;
  white-space: nowrap;
}
.angles button img { object-fit: contain; }
.angles button[aria-pressed="true"] { border-color: #a38b66; color: #171613; }
.angles button:hover { border-color: #a38b66; }

h1, h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-weight: 400;
  letter-spacing: -.05em;
}
h1 { font-size: clamp(2.55rem, 5.2vw, 5.2rem); line-height: .99; }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.08; }
.description, .fit p { color: var(--muted); line-height: 1.6; }
.description { margin: 1.05rem 0 .35rem; }
.rotate-link { display: inline-block; padding-block: .35rem; }
.purchase { display: grid; gap: .65rem; margin-top: 1.55rem; max-width: 23rem; }
.size-label { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
label { font-size: .9rem; font-weight: 600; }
input, select {
  min-height: 48px;
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid #b7ae9f;
  border-radius: 0;
  color: #171613;
  background: #fff;
}
.guide-link { color: var(--gold); font-size: .88rem; }
.price { font-size: 1.28rem; margin: .15rem 0 0; }
.purchase-button, .fit-button { min-height: 49px; padding: .65rem 1rem; border: 1px solid #261f16; }
.purchase-button { margin-top: .35rem; background: #201b14; color: #fff; font-weight: 600; }
.purchase-button:enabled:hover { background: #473621; }
.purchase-button:disabled { background: #eeeae3; color: #625b51; border-color: #e7dfd1; }
.purchase-status { color: var(--muted); margin: 0; font-size: .84rem; min-height: 1.3em; }

.fit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.2rem, 7vw, 6.5rem);
  align-items: start;
  border-top: 1px solid var(--line);
  padding-block: clamp(2.3rem, 6vw, 4.5rem);
}
.fit p { max-width: 31rem; }
.fit form { display: grid; gap: .65rem; }
.measure-fields { display: grid; grid-template-columns: 1fr 7rem; gap: .5rem; }
.fit-button { width: fit-content; background: #fff; color: #201b14; }
.fit-button:hover { background: #f6f4ef; }
#fit-result { display: block; color: var(--gold); min-height: 1.5em; }

@media (max-width: 760px) {
  .product, .fit { grid-template-columns: minmax(0, 1fr); }
  .product { gap: 1.5rem; padding-top: .75rem; }
  .gallery { width: min(100%, 580px); margin-inline: auto; }
  .photo-frame { aspect-ratio: 5 / 3; }
  .purchase { max-width: none; }
}

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