:root {
  --paper: #f3ecdf;
  --paper-2: #fbf7f0;
  --ink: #261c14;
  --muted: #5e5146;
  --pine: #234237;
  --pine-2: #1a3329;
  --clay: #9a4632;
  --line: rgba(70, 44, 20, 0.14);
  --birch-1: #fbf6ec;
  --birch-2: #ecd9b8;
  --shadow: 0 16px 40px rgba(70, 44, 16, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #fffaf3 0%, transparent 55%),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
}
body.shop { padding-bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
a { color: var(--pine); }
a:hover { color: var(--clay); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: white;
  padding: 0.4rem 0.7rem;
  z-index: 80;
}
.skip:focus { top: 0.75rem; }

.wrap { width: min(1080px, calc(100% - 1.5rem)); margin-inline: auto; }
.narrow { width: min(40rem, 100%); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  padding: 0.75rem 0;
  background: rgba(243, 236, 223, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 640;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 0.98rem; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.cart-link {
  margin-left: auto;
  text-decoration: none;
  background: var(--pine);
  color: #f7f3ea;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
}
.cart-link:hover { color: white; }

.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--clay);
  font-weight: 600;
}
h1, h2 {
  font-family: var(--serif);
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
h1 { font-size: clamp(2.7rem, 10vw, 5rem); margin: 0.2rem 0 0.4rem; }
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 0.4rem; }
.lede { font-size: 1.15rem; max-width: 38rem; margin: 0; }
.intro { padding: 1.2rem 0 0.4rem; }

.banner {
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border-radius: 0.8rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.banner[hidden] { display: none; }

.builder {
  margin: 1.1rem 0 1.4rem;
  padding: 1rem;
  background: var(--paper-2);
  border-radius: 1.3rem;
  box-shadow: var(--shadow);
}
.builder label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.name-row { display: flex; flex-direction: column; gap: 0.6rem; }
.name-row input {
  width: 100%;
  border: 0;
  border-radius: 0.9rem;
  background: white;
  box-shadow: inset 0 0 0 1.5px rgba(38, 28, 20, 0.16);
  padding: 0.85rem 0.95rem;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.help, .price-line, .note { color: var(--muted); }
.help { margin: 0.7rem 0; }
.price-line { margin: 0 0 0.8rem; }
.skipped { color: var(--clay); min-height: 1.4em; margin: 0.2rem 0 0.6rem; }
.skipped:empty { display: none; }

.preview {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.2rem 0.1rem 0.7rem;
  min-height: 8.5rem;
}
.preview .empty {
  color: var(--muted);
  align-self: center;
  margin: 0;
}
.tile {
  position: relative;
  flex: 0 0 7.4rem;
  height: 9.2rem;
  scroll-snap-align: start;
  margin: 0;
  border-radius: 1.05rem;
  background-color: var(--birch-1);
  background-image:
    linear-gradient(100deg, rgba(255,255,255,0.55), rgba(255,255,255,0) 42%),
    repeating-linear-gradient(90deg, rgba(168, 126, 74, 0.16) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, var(--birch-1), var(--birch-2));
  box-shadow: inset 0 0 0 1px rgba(90, 58, 24, 0.12), 0 8px 16px rgba(70, 44, 16, 0.08);
}
.tile picture { display: block; width: 100%; height: 100%; }
.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 6px rgba(60, 36, 12, 0.16));
}
.tile figcaption {
  position: absolute;
  left: 0.45rem;
  bottom: 0.35rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  background: rgba(251, 246, 236, 0.88);
  border-radius: 999px;
  padding: 0 0.4rem;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--pine);
  color: #f7f3ea;
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  font-weight: 600;
  min-height: 3rem;
}
.btn:hover { background: var(--pine-2); }
.btn.secondary {
  background: transparent;
  color: var(--pine);
  box-shadow: inset 0 0 0 1.5px var(--pine);
}
.btn.secondary:hover { background: rgba(35, 66, 55, 0.06); }
.btn:disabled, .btn.is-quiet {
  background: #8d8378;
  color: #f7f3ea;
  cursor: default;
  box-shadow: none;
}
.btn.block { width: 100%; }

.frame {
  background: var(--birch-1);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.frame > .slot-photo { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.letter-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr));
  gap: 0.35rem;
  padding: 0.7rem;
}
.letter-strip.quartet { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.letter-strip picture { display: block; min-width: 0; }
.letter-strip img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--birch-1);
  border-radius: 0.7rem;
}
.frame figcaption, .caption { color: var(--muted); font-size: 0.95rem; margin: 0.45rem 0 0; padding: 0 0.8rem 0.8rem; }

.section { margin: 2rem 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 0.6rem;
}
.letter-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.letter-btn .tile { width: 100%; height: auto; aspect-ratio: 1; flex: none; }
.letter-meta { display: flex; justify-content: space-between; gap: 0.4rem; margin-top: 0.35rem; font-size: 0.95rem; }
.letter-meta .animal { color: var(--muted); }

.offer {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding: 0.8rem;
  background: var(--paper-2);
  border-radius: 1.3rem;
  box-shadow: var(--shadow);
}
.offer p { margin: 0.3rem 0 0.9rem; }

.prose p { margin: 0 0 0.9rem; }
.prose { padding-bottom: 2rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 1.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer p { margin: 0.2rem 0; }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom));
  background: var(--pine);
  color: #f7f3ea;
}
.dock strong { display: block; font-size: 1rem; }
.dock span { color: rgba(247, 243, 234, 0.8); font-size: 0.9rem; }
.dock .btn { background: #f7f3ea; color: var(--pine); }

.drawer[hidden] { display: none !important; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(28, 18, 10, 0.46);
}
.panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 42rem);
  overflow: auto;
  background: var(--paper-2);
  border-radius: 1.2rem 1.2rem 0 0;
  padding: 0.9rem 1rem calc(1rem + env(safe-area-inset-bottom));
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  min-width: 2.5rem;
  min-height: 2.5rem;
}
.cart-line, .name-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.qty { display: flex; align-items: center; gap: 0.35rem; }
.qty button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}
.names { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.chip {
  border: 0;
  background: white;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.ship-choice { display: grid; gap: 0.45rem; margin: 0.8rem 0; }
.ship-choice label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  background: white;
  border-radius: 0.8rem;
  padding: 0.65rem 0.7rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.totals { margin: 0.6rem 0 0.8rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals .grand { font-weight: 650; font-size: 1.15rem; margin-top: 0.25rem; }
.status { min-height: 1.4em; color: var(--clay); }

:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }

@media (min-width: 720px) {
  .name-row { flex-direction: row; align-items: center; }
  .name-row input { flex: 1; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .tile { flex-basis: 8.6rem; height: 10.4rem; }
  .offer { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding: 1rem; }
  .builder { padding: 1.25rem 1.3rem 1.1rem; }
}
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .panel { left: auto; top: 0; width: min(30rem, 100%); max-height: none; border-radius: 0; }
}

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