/* caketown — bakery counter. One bold thing: the wordmark. Everything else quiet. */

:root {
  --cocoa: #3B2318;
  --ink: #2A1A14;
  --ink-soft: #6B5447;
  --buttercream: #F8EDD5;
  --paper: #FFFBF4;
  --strawberry: #E4466F;
  --strawberry-ink: #A82749;
  --pistachio: #9FD4C0;
  --pistachio-deep: #3E7D68;
  --crumb: #E2D2B2;

  --display: "Bagel Fat One", Georgia, serif;
  --body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --rule: 1px solid var(--crumb);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--buttercream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis-weight: none;
}

h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.015em; }
h3 { font-size: 1.1875rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--strawberry-ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--strawberry-ink); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(72rem, 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { width: min(42rem, 100%); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--paper); color: var(--ink); padding: .75rem 1rem; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/* ---------- counter bar ---------- */
.counter {
  background: var(--cocoa);
  color: var(--buttercream);
  border-bottom: 4px solid var(--strawberry);
}
.counter__inner { display: flex; align-items: center; gap: 1.5rem; padding: .875rem 0; flex-wrap: wrap; }
.wordmark {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--buttercream);
  text-decoration: none;
  line-height: 1;
  letter-spacing: .005em;
  margin-right: auto;
}
.wordmark:hover { color: var(--pistachio); }
.counter nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.counter nav a {
  color: var(--buttercream);
  text-decoration: none;
  font-weight: 500;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.counter nav a:hover, .counter nav a[aria-current="page"] { border-bottom-color: var(--strawberry); color: var(--buttercream); }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr; }
@media (min-width: 56rem) { .hero__grid { grid-template-columns: 1.15fr .85fr; align-items: center; } }
.hero__window { max-width: 24rem; width: 100%; justify-self: end; }
@media (max-width: 55.99rem) { .hero__window { justify-self: start; } }
.hero__mark {
  font-family: var(--display);
  font-size: clamp(3.5rem, 14vw, 9rem);
  line-height: .88;
  color: var(--cocoa);
  margin: 0 0 .15em;
  letter-spacing: .01em;
}
.hero__say { font-size: clamp(1.125rem, 2.5vw, 1.5rem); max-width: 34ch; color: var(--ink); margin-bottom: 1.75rem; }
.hero__note { color: var(--ink-soft); font-size: .9375rem; max-width: 46ch; }

@media (prefers-reduced-motion: no-preference) {
  .hero__mark { animation: rise .7s cubic-bezier(.2,.7,.3,1) both; }
  .hero__say { animation: rise .7s cubic-bezier(.2,.7,.3,1) .12s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: none; } }

/* ---------- display case ---------- */
.case {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  padding: 0 0 4rem; list-style: none; margin: 0;
}
/* keep one or two items from stretching across the whole page */
.case--few { grid-template-columns: repeat(auto-fit, minmax(16rem, 21rem)); justify-content: start; }
.slot { display: flex; flex-direction: column; }
.slot a { text-decoration: none; color: inherit; display: block; }
.slot__shelf {
  background: var(--paper);
  border: var(--rule);
  border-bottom: 5px solid var(--cocoa);
  padding: 1.25rem;
  display: grid; place-items: center;
  aspect-ratio: 4 / 5;
}
.slot__shelf img { width: 100%; height: 100%; object-fit: contain; }
.slot a:hover .slot__shelf { border-bottom-color: var(--strawberry); }
.slot__label { display: flex; align-items: baseline; gap: .75rem; padding-top: .875rem; }
.slot__name { font-weight: 700; font-size: 1.0625rem; }
.slot__blank { color: var(--ink-soft); font-size: .875rem; margin-top: .125rem; }

/* price card — a tag, not a badge */
.tag {
  background: var(--strawberry);
  color: var(--paper);
  font-weight: 700;
  padding: .3rem .7rem .35rem;
  border-radius: 3px 10px 10px 3px;
  font-size: .9375rem;
  white-space: nowrap;
  margin-left: auto;
}
.tag--lg { font-size: 1.5rem; padding: .45rem 1rem .5rem; border-radius: 4px 14px 14px 4px; }

/* ---------- product ---------- */
.product { display: grid; gap: clamp(1.75rem, 5vw, 3.5rem); grid-template-columns: 1fr; padding: clamp(2rem, 5vw, 3.5rem) 0; }
@media (min-width: 56rem) { .product { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.product__shelf { background: var(--paper); border: var(--rule); border-bottom: 6px solid var(--cocoa); padding: clamp(1.25rem, 4vw, 2.5rem); display: grid; place-items: center; }
.product__shelf img { width: 100%; max-width: 30rem; }
.product__head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.product__head h1 { margin: 0; }
.spec { margin: 1.75rem 0; border-top: var(--rule); }
.spec div { display: flex; gap: 1rem; padding: .7rem 0; border-bottom: var(--rule); }
.spec dt { flex: 0 0 7.5rem; color: var(--ink-soft); font-size: .9375rem; }
.spec dd { margin: 0; font-weight: 500; }

/* ---------- buy ---------- */
.buy { margin: 1.5rem 0; }
.buy__placeholder {
  background: var(--paper);
  border: 2px dashed var(--strawberry);
  padding: 1.25rem;
  border-radius: 4px;
}
.buy__placeholder p { margin: 0 0 .5rem; font-weight: 700; }
.buy__placeholder code { background: var(--buttercream); padding: .1rem .35rem; border-radius: 3px; font-size: .875rem; }
.buy__placeholder ol { margin: .5rem 0 0; padding-left: 1.25rem; font-size: .9375rem; color: var(--ink-soft); }

/* ---------- register sign: final sale ---------- */
.sign {
  background: var(--paper);
  border: 2px solid var(--cocoa);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  box-shadow: 4px 4px 0 var(--cocoa);
  max-width: 34rem;
}
.sign--tilt { transform: rotate(-1.1deg); }
.sign p { margin: 0; }
.sign p + p { margin-top: .5rem; }
.sign strong { color: var(--strawberry-ink); }
.sign__chart { display: inline-block; margin-top: .6rem; font-weight: 700; }

/* ---------- size chart (recipe card) ---------- */
.recipe {
  max-width: 46rem;
  background: var(--pistachio);
  border: 2px solid var(--pistachio-deep);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin: 2.5rem 0;
}
.recipe h2, .recipe h3 { color: #1E4738; margin-top: 0; }
.recipe p { color: #1E4738; }
.chart { width: 100%; border-collapse: collapse; background: var(--paper); margin: 1rem 0; font-variant-numeric: tabular-nums; }
.chart caption { text-align: left; padding: 0 0 .6rem; color: #1E4738; font-size: .9375rem; }
.chart th, .chart td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--crumb); }
.chart thead th { background: var(--cocoa); color: var(--buttercream); font-weight: 700; font-size: .9375rem; border-bottom: none; }
.chart tbody th { font-weight: 700; }
.chart tbody tr:last-child th, .chart tbody tr:last-child td { border-bottom: none; }
.measure-how { background: var(--paper); border-left: 5px solid var(--pistachio-deep); padding: 1rem 1.25rem; margin: 1rem 0; }
.measure-how p:last-child { margin-bottom: 0; }
.tolerance { color: #1E4738; font-size: .9375rem; margin-top: 1rem; }
.table-scroll { overflow-x: auto; }

/* ---------- prose pages ---------- */
.prose { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.prose h2 { margin-top: 2.25rem; padding-top: 1.25rem; border-top: var(--rule); }
.prose h2:first-of-type { border-top: none; padding-top: 0; margin-top: 1.5rem; }
.prose ul { max-width: var(--measure); padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.lede { font-size: 1.1875rem; color: var(--ink-soft); max-width: 48ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--strawberry-ink);
  color: var(--paper);
  font-weight: 700;
  padding: .8rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  border: 2px solid var(--strawberry-ink);
}
.btn:hover { background: var(--cocoa); border-color: var(--cocoa); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--cocoa); border-color: var(--cocoa); }
.btn--ghost:hover { background: var(--cocoa); color: var(--buttercream); }

/* ---------- footer ---------- */
.shutters { background: var(--cocoa); color: var(--buttercream); margin-top: 4rem; padding: 3rem 0 2.5rem; }
.shutters a { color: var(--buttercream); }
.shutters a:hover { color: var(--pistachio); }
.shutters__grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 42rem) { .shutters__grid { grid-template-columns: 2fr 1fr; } }
.shutters__mark { font-family: var(--display); font-size: 2rem; line-height: 1; margin-bottom: .5rem; }
.shutters nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; align-content: start; }
.shutters__fine { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(248,237,213,.25); font-size: .875rem; color: rgba(248,237,213,.75); }
.shutters__fine p { max-width: 60ch; }

/* ---------- preview build ---------- */
.preview-bar {
  background: var(--strawberry-ink); color: var(--paper);
  text-align: center; padding: .5rem 1rem; font-size: .9375rem; font-weight: 500;
}

/* ---------- gallery ---------- */
.gallery { margin: 0; width: 100%; }
.gallery > img { width: 100%; height: auto; display: block; background: var(--paper); }
.thumbs { display: flex; gap: .6rem; list-style: none; padding: 0; margin: .75rem 0 0; flex-wrap: wrap; }
.thumb {
  padding: 0; border: 2px solid var(--crumb); background: var(--paper);
  cursor: pointer; line-height: 0; border-radius: 2px;
}
.thumb img { width: 4.5rem; height: 5.6rem; object-fit: cover; display: block; }
.thumb.is-on, .thumb:hover { border-color: var(--strawberry); }
.shelf-art { width: 100%; }
.price-note { color: var(--ink-soft); font-size: .9375rem; }
