:root {
  --ink: #0e2923;
  --muted: #617972;
  --line: #d5dfd8;
  --paper: #fbfcf8;
  --field: #f5f7f2;
  --card: #edf2ed;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; }

.site-header {
  align-items: center;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 6.15rem;
  padding: 0 6.1vw;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.wordmark { color: var(--ink); font-size: 0.73rem; font-weight: 800; letter-spacing: 0.2em; line-height: 1.12; text-decoration: none; text-transform: uppercase; width: max-content; }
.site-nav { display: flex; gap: 2.5rem; }
.site-nav a, .site-tagline { color: var(--ink); font-size: 0.9rem; text-decoration: none; }
.site-nav a:hover, .compare-link:hover, .details-trigger:hover { color: #4b7467; }
.site-tagline { color: var(--muted); justify-self: end; margin: 0; }

.hero { margin: 0 auto; max-width: 100rem; padding: 4.4rem 10vw 7.2rem; }
.eyebrow, .detail-eyebrow, .detail-label, .detail-highlights span, .detail-facts dt { color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.2em; line-height: 1.3; margin: 0; text-transform: uppercase; }
.hero-layout { align-items: end; display: grid; gap: 4rem; grid-template-columns: minmax(0, 1fr) 25rem; }
h1, h2, h3, p { margin-top: 0; }
h1, .browse-intro h2, .detail-header h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: clamp(4.4rem, 8.4vw, 8.8rem); letter-spacing: -0.075em; line-height: 0.86; margin: 1.8rem 0 2.3rem; max-width: 76rem; }
.hero-copy { color: var(--muted); font-size: 1.13rem; line-height: 1.55; margin: 0; max-width: 34rem; }
.hero-stats { display: grid; gap: 0; grid-template-columns: repeat(2, 1fr); margin: 0 0 0.25rem; }
.hero-stats div { border-left: 1px solid var(--line); padding: 0.35rem 1.25rem; }
.hero-stats dt { font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; line-height: 1; }
.hero-stats dd { color: var(--muted); font-size: 0.8rem; margin: 0.45rem 0 0; }

.browse-section { margin: 0 auto; max-width: 100rem; padding: 0 10vw 6rem; }
.browse-intro { align-items: end; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 3rem; }
.browse-intro h2 { font-size: clamp(3.8rem, 6.7vw, 7.1rem); letter-spacing: -0.065em; line-height: 0.9; margin: 0 0 1.7rem; }
.browse-intro p { color: var(--muted); font-size: 1.06rem; line-height: 1.55; margin: 0; max-width: 27rem; }
.compare-link { color: var(--ink); font-size: 0.83rem; font-weight: 800; margin: 0 0 0.4rem; text-decoration: none; white-space: nowrap; }
.compare-link span { margin-left: 0.45rem; }

.browse-layout { display: grid; grid-template-columns: 18.4rem minmax(0, 1fr); }
.filter-panel { align-self: start; border-right: 1px solid var(--line); padding: 2.5rem 3.5rem 2rem 0; position: sticky; top: 6.15rem; }
.filter-heading { align-items: baseline; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 1.1rem; }
.filter-heading h3 { font-size: 0.98rem; letter-spacing: 0.15em; margin: 0; text-transform: uppercase; }
.filter-heading button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.8rem; padding: 0; }
.filter-control { border-bottom: 1px solid var(--line); color: var(--muted); display: block; font-size: 0.83rem; font-weight: 700; padding: 1.35rem 0; }
.filter-control input, .filter-control select, .catalog-toolbar select {
  appearance: auto;
  background: #fff;
  border: 1px solid #ccd6d0;
  border-radius: 0.65rem;
  color: var(--ink);
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  margin-top: 0.7rem;
  min-height: 3.3rem;
  padding: 0 0.85rem;
  width: 100%;
}
.filter-control input::placeholder { color: #82958e; }
.filter-control input:focus, .filter-control select:focus, .catalog-toolbar select:focus, .details-trigger:focus-visible, .image-button:focus-visible, .dialog-close:focus-visible { outline: 2px solid #4b7467; outline-offset: 3px; }
.filter-note { color: var(--muted); font-size: 0.78rem; line-height: 1.55; margin: 1.8rem 0 0; }

.catalog-area { min-width: 0; padding: 2.5rem 0 0 3.5rem; }
.catalog-toolbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 1.9rem; }
.catalog-toolbar p { color: var(--muted); font-size: 0.82rem; margin: 0; }
.catalog-toolbar label { align-items: center; color: var(--muted); display: flex; font-size: 0.8rem; gap: 0.7rem; }
.catalog-toolbar select { font-size: 0.84rem; margin: 0; min-height: 3.15rem; min-width: 13.5rem; }
.catalog { display: grid; gap: 3.6rem 1.65rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.catalog-sentinel { height: 1px; margin-top: 1px; }
.product-card[hidden] { display: none; }
.image-button { background: transparent; border: 0; cursor: pointer; display: block; padding: 0; width: 100%; }
.image-frame { aspect-ratio: 1 / 1.04; background: var(--card); border-radius: 0.85rem; display: block; overflow: hidden; position: relative; }
.product-image { height: 100%; object-fit: cover; transition: transform 260ms ease; width: 100%; }
.image-button:hover .product-image { transform: scale(1.02); }
.product-image-placeholder { align-items: center; color: var(--muted); display: flex; font-size: 0.69rem; font-weight: 800; inset: 0; justify-content: center; letter-spacing: 0.15em; position: absolute; text-transform: uppercase; }
.product-image-placeholder[hidden] { display: none; }
.badge { position: absolute; right: 0.8rem; top: 0.8rem; }
.product-copy { padding-top: 1rem; }
.product-title-line { align-items: baseline; display: flex; gap: 0.75rem; justify-content: space-between; }
.product-title-line h3 { font-size: 1rem; line-height: 1.25; margin: 0; }
.details-trigger { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; text-align: left; }
.product-price { flex: 0 0 auto; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; line-height: 1; margin: 0; }
.product-meta, .product-notes { color: var(--muted); font-size: 0.77rem; line-height: 1.45; margin-bottom: 0; }
.product-meta { margin-top: 0.55rem; }
.product-notes { margin-top: 0.7rem; }
.empty-state { color: var(--muted); font-size: 0.9rem; padding: 3rem 0; }

.product-dialog { background: transparent; border: 0; height: 100%; margin: 0; max-height: none; max-width: none; padding: 0; width: 100%; }
.product-dialog::backdrop { background: rgb(14 41 35 / 48%); }
.detail-panel { background: var(--paper); box-shadow: -1rem 0 4rem rgb(14 41 35 / 15%); height: 100%; margin-left: auto; max-width: 46rem; overflow: auto; }
.detail-header { align-items: flex-start; background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 2rem 2.2rem 1.5rem; position: sticky; top: 0; z-index: 1; backdrop-filter: blur(12px); }
.detail-header h2 { font-size: clamp(2.4rem, 4vw, 4rem); letter-spacing: -0.055em; line-height: 0.94; margin: 0.55rem 1rem 0 0; }
.dialog-close { background: transparent; border: 0; cursor: pointer; font-size: 2.1rem; font-weight: 300; line-height: 1; padding: 0; }
.detail-content { padding: 2rem 2.2rem 3.5rem; }
.detail-hero { align-items: center; display: grid; gap: 1.5rem; grid-template-columns: 12rem 1fr; }
.detail-image { aspect-ratio: 1 / 1; background: var(--card); object-fit: cover; width: 100%; }
.detail-status { font-size: 0.9rem; font-weight: 800; margin: 0 0 0.6rem; }
.detail-status[data-status='in_stock'] { color: #16833c; }
.detail-status[data-status='out_of_stock'] { color: #c23b32; }
.detail-status[data-status='unknown'] { color: var(--muted); }
.detail-price { font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; margin: 0 0 1rem; }
.detail-source-link { color: var(--ink); font-size: 0.82rem; font-weight: 800; }
.detail-description, .detail-notes { color: var(--muted); font-size: 0.98rem; line-height: 1.58; margin: 1.7rem 0 0; }
.detail-highlights { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1.8rem; }
.detail-highlights > div { min-height: 5.3rem; padding: 1rem 1rem 1rem 0; }
.detail-highlights > div + div { border-left: 1px solid var(--line); padding-left: 1rem; }
.detail-highlights strong { display: block; font-size: 0.95rem; font-weight: 500; line-height: 1.3; margin-top: 0.5rem; }
.detail-section { border-bottom: 1px solid var(--line); padding: 1.6rem 0; }
.detail-section h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; margin: 0 0 1rem; }
.detail-label { display: block; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.65rem; }
.detail-chip { background: #eef2ee; border-radius: 999px; color: #365f52; font-size: 0.78rem; padding: 0.4rem 0.62rem; }
.detail-facts { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); margin: 0; }
.detail-facts dd { font-size: 0.96rem; line-height: 1.4; margin: 0.45rem 0 0; }
.detail-sizes { border: 1px solid var(--line); border-radius: 0.55rem; overflow: hidden; }
.detail-size-row { align-items: center; display: grid; gap: 0.6rem; grid-template-columns: 1fr auto auto; padding: 0.75rem 0.85rem; }
.detail-size-row + .detail-size-row { border-top: 1px solid var(--line); }
.detail-size-row > span:nth-child(2), .size-availability { font-size: 0.78rem; font-weight: 700; }
.size-availability[data-status='in_stock'] { color: #16833c; }
.size-availability[data-status='out_of_stock'] { color: #c23b32; }
.size-availability[data-status='unknown'], .detail-muted, .detail-grind { color: var(--muted); }
.detail-grind, .detail-muted { font-size: 0.78rem; line-height: 1.5; margin: 0.9rem 0 0; }
.detail-notes-section[hidden] { display: none; }

@media (max-width: 68rem) {
  .hero, .browse-section { padding-left: 5vw; padding-right: 5vw; }
  .catalog-area { padding-left: 2rem; }
  .filter-panel { padding-right: 2rem; }
  .browse-layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
  .site-header { grid-template-columns: 1fr auto; min-height: 5rem; padding: 0 1.25rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.8rem; }
  .site-tagline { display: none; }
  .hero { padding: 3rem 1.25rem 4rem; }
  .hero-layout, .browse-layout { display: block; }
  h1 { font-size: clamp(3.5rem, 16vw, 5.8rem); }
  .hero-stats { margin-top: 2.5rem; max-width: 22rem; }
  .browse-section { padding: 0 1.25rem 3.5rem; }
  .browse-intro { align-items: flex-start; flex-direction: column; gap: 1.5rem; padding-bottom: 2rem; }
  .browse-intro h2 { font-size: 4rem; }
  .filter-panel { border-bottom: 1px solid var(--line); border-right: 0; padding: 2rem 0; position: static; }
  .catalog-area { padding: 2rem 0 0; }
  .catalog-toolbar { align-items: flex-start; gap: 1rem; }
  .catalog-toolbar label { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .catalog-toolbar select { min-width: 10rem; }
  .catalog { gap: 2.5rem 1rem; }
  .product-title-line { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
  .detail-panel { max-width: none; }
  .detail-header, .detail-content { padding-left: 1.25rem; padding-right: 1.25rem; }
  .detail-hero { grid-template-columns: 8rem 1fr; }
  .detail-highlights, .detail-facts { grid-template-columns: 1fr; }
  .detail-highlights > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .detail-size-row { grid-template-columns: 1fr auto; }
  .size-availability { grid-column: 1 / -1; }
}

@media (max-width: 29rem) {
  .catalog { grid-template-columns: 1fr; }
  .site-nav a:last-child { display: none; }
}
