:root {
  --paper: #ffffff;
  --stone: #f1efec;      /* product photo ground */
  --ink: #1b2230;        /* deep ink navy */
  --muted: #6e6f74;
  --hairline: #e3e0db;
  --accent: #2f4a3a;     /* bottle green */
  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
}

/* Masthead */
.masthead {
  text-align: center;
  padding: 36px var(--gutter) 28px;
}
/* Wordmark: "Phillippi" in script, "PHAVORITES" in spaced capitals.
   Stacked on phones, side by side from tablet width up. */
.wordmark {
  margin: 0;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wm-script {
  font-family: "Pinyon Script", var(--serif);
  font-size: clamp(3.5rem, 15vw, 5rem);
  line-height: 1.1;
}
.wm-caps {
  font-family: var(--sans);
  font-weight: 300;
  text-transform: uppercase;
  font-size: clamp(0.875rem, 3.6vw, 1.125rem);
  letter-spacing: 0.6em;
  margin-right: -0.6em; /* trailing letter-spacing would push it off-center */
}
@media (min-width: 720px) {
  .wordmark {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 1.25rem;
  }
  .tagline { margin-top: 20px; }
  .wm-script { font-size: clamp(4.5rem, 8vw, 6.5rem); }
  .wm-caps { font-size: clamp(1.375rem, 2.6vw, 2rem); letter-spacing: 0.32em; margin-right: -0.32em; }
}
.tagline {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  color: var(--muted);
}

/* Toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.toolbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.tabs {
  display: flex;
  justify-content: safe center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  padding: 14px 10px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.sort {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 14px;
}
.sort-label { color: var(--muted); }
.sort select {
  appearance: none;
  font: inherit;
  color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231b2230' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right center;
  border: 0;
  padding: 12px 16px 12px 0;
  min-height: 44px;
  field-sizing: content;
  text-align-last: right;
  cursor: pointer;
}

/* Grid */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px var(--gutter) 64px;
}
.listbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.count {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 12px;
}
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 24px; }
  .masthead { padding: 72px var(--gutter) 40px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Card */
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-image {
  aspect-ratio: 4 / 5;
  background: var(--stone);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply; /* lets white product backgrounds sit on the stone ground */
  padding: 8%;
}
.card-body { padding-top: 14px; }
.card-body p { margin: 0; }
.card-store {
  font-size: 13px;
  color: var(--muted);
}
.card-title {
  margin: 2px 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 500;
}
/* Placeholder items: product not chosen yet */
div.card-link .card-price { font-weight: 400; font-style: italic; color: var(--muted); }
.card-details {
  margin-top: 6px !important;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}
.card-added {
  font-variant-numeric: tabular-nums;
  margin-top: 8px !important;
  font-size: 12px;
  color: var(--muted);
}
.card-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.card-link:focus-visible .card-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (hover: hover) {
  a.card-link:hover .card-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
}
/* On phones the whole card is the link and the store name is already shown */
@media (max-width: 719px) {
  .card-cta { display: none; }
}

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

.empty {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--muted);
  padding: 64px 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--hairline);
  text-align: center;
  padding: 40px var(--gutter) 56px;
  font-size: 14px;
  color: var(--muted);
}
.footer p { margin: 0; }
.footer-sign {
  margin-top: 8px !important;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
}

@media (min-width: 720px) {
  .card-title { font-size: 19px; }
}
