@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  font-family: "DM Sans", Arial, sans-serif;
  --ink: #111;
  --black: #3d4b2e;
  --paper: #fff;
  --muted: #555;
  --line: #ddd;
  --surface: #f3f3f3;
  --serif: "Instrument Serif", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 4px; }
.hero :focus-visible { outline-color: #3d4b2e; }
.wrap { width: min(92%, 1360px); margin-inline: auto; }

.site-header { background: var(--paper); color: var(--ink); }
.nav { min-height: 66px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.nav nav { display: flex; gap: 32px; font-size: .87rem; }
.nav nav a:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
.brand { display: grid; width: max-content; line-height: .82; }
.brand b { font: 400 2.6rem/.83 var(--serif); letter-spacing: -.035em; }
.brand small { margin-top: 8px; font-size: .53rem; font-weight: 700; letter-spacing: .24em; }
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-size: .84rem;
  font-weight: 700;
}
.dark { background: var(--black); color: white; }
.accent { background: var(--black); color: var(--paper); }
.hero .accent { background: #3d4b2e; color: #fff; }
.button:hover { filter: brightness(.88); }
.account-open { border-color: var(--line); }
.site-header .account-open { justify-self: end; border-color: var(--black); padding-inline: 20px; }

.hero-inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); overflow: hidden; background: #fbf6eb; color: #28261e; }
.hero-copy { display: grid; align-content: center; justify-items: start; gap: 14px; padding: clamp(22px, 3.4vw, 46px); }
.hero figure { position: relative; min-height: 240px; overflow: hidden; }
.hero img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 25% 75%; }
.eyebrow, .card .tag { font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.hero .eyebrow { color: #58623d; }
.hero h1 { font: 400 clamp(3rem, 5.3vw, 5.4rem)/.94 var(--serif); letter-spacing: -.025em; }
.hero h1 em { color: #58623d; font-weight: 400; }
.hero-description { max-width: 40ch; line-height: 1.5; color: #28261e; font-size: .94rem; }
.hero .button { min-height: 46px; padding-inline: 16px; }
.hero .button span { font-size: 1rem; }

.market { padding-block: 24px clamp(42px, 5vw, 72px); }
.how { padding-block: clamp(38px, 5.2vw, 76px); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
h2 { font: 400 clamp(2.7rem, 5vw, 4.8rem)/.98 var(--serif); letter-spacing: -.025em; }
.section-title p { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.sector-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: clamp(27px, 4vw, 52px); }
.sector-tiles button { display: flex; align-items: center; justify-content: space-between; min-width: 0; height: clamp(76px, 9vw, 116px); overflow: hidden; border: 0; padding: 0; text-align: left; background: var(--black); color: var(--paper); }
.sector-tiles button:is([data-sector-tile="Agriculture"], [data-sector-tile="Industrial"]) { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.sector-tiles img { width: 35%; height: 100%; object-fit: cover; }
.sector-name { display: inline-flex; align-items: center; gap: .5em; padding-inline: clamp(9px, 2vw, 27px) 0; font: 400 clamp(1.5rem, 4vw, 3rem)/1 var(--serif); }
.sector-name span { font: 400 .55em/1 "DM Sans", sans-serif; }
.sector-tiles button:hover .sector-name, .sector-tiles button[aria-pressed="true"] .sector-name { text-decoration: underline; text-underline-offset: .12em; }
.catalogue-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-block: 10px;
  border-block: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filters button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: .83rem;
  white-space: nowrap;
}
.filters button:hover { background: var(--surface); }
.filters button[aria-pressed=true] { background: var(--black); border-color: var(--black); color: white; }
.filters button[data-category=""] { background: #3d4b2e; border-color: #3d4b2e; color: white; }
.filters button[data-category=""][aria-pressed=true] { box-shadow: inset 0 -2px var(--paper); }
.sector-count { opacity: .86; font-size: .69rem; font-variant-numeric: tabular-nums; }
.toolbar { display: grid; grid-template-columns: minmax(150px, 1fr) auto; flex: 0 1 515px; gap: 7px; }
.search input, .search select, dialog input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: .83rem;
}
#feedback { margin-block: 14px; color: var(--muted); font-size: .8rem; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px clamp(15px, 2.25vw, 32px); }
.card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); }
.card-body { display: flex; flex-direction: column; align-items: stretch; flex: 1; gap: 8px; padding: clamp(10px, 1.35vw, 20px); }
.card-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; margin-top: 5px; }
.card-prices .price { margin-top: 0; }
.retail { color: var(--muted); font-size: .77rem; }
.card .tag { align-self: flex-start; color: var(--gold-ink); background: var(--surface); padding: 4px 7px; margin-top: 7px; }
.card .tag[data-sector="Industrial"] { background: var(--black); color: var(--paper); }
.product-photo { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: contain; background: var(--surface); }
.product-photo[hidden] { display: none; }
#order-photo { max-height: min(24vh, 180px); }
.card h3 { font: 400 clamp(1.65rem, 2.8vw, 2.45rem)/1 var(--serif); }
.card .muted, .card .progress-text { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.card .saving { align-self: flex-start; background: var(--surface); color: var(--gold-ink); padding: 4px 7px; font-size: .77rem; font-weight: 700; }
.price { margin-top: 6px; font-size: clamp(1.18rem, 2vw, 1.65rem); font-weight: 700; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.price small { font-size: .72rem; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.pool-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding-block: 8px 3px; margin-top: 3px; border-top: 1px solid var(--line); }
.pool-facts dt { font-size: .69rem; color: var(--muted); }
.pool-facts dd { margin-top: 2px; font-size: .8rem; font-weight: 700; }
.card progress { width: 100%; height: 5px; accent-color: var(--black); }
.card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 5px; }
.card-actions .button { flex: 1; background: #3d4b2e; }

.how { background: var(--black); color: var(--paper); }
.how ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 26px 0 0; padding-left: 22px; }
.how li { padding-left: 6px; }
.how li::marker { color: var(--paper); }
.how h3 { font: 400 1.75rem/1.15 var(--serif); }
.how p { margin-top: 6px; color: #ccc; font-size: .88rem; line-height: 1.55; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 22px 0; font-size: .8rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
dialog { width: min(92vw, 510px); max-height: 90vh; border: 1px solid var(--line); background: var(--paper); padding: 22px; color: var(--ink); }
dialog h2 { font-size: clamp(2rem, 7vw, 3.3rem); }
dialog::backdrop { background: #3d4b2ebb; }
dialog form, dialog #confirmation:not([hidden]) { display: grid; gap: 12px; }
dialog form[hidden] { display: none; }
.dialog-heading { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dialog-heading button { flex: 0 0 44px; height: 44px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; }
dialog label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.preview-note, #estimate, #order-error { font-size: .85rem; }
#order-error, #account-error:not(:empty) { color: var(--ink); font-weight: 700; }
.preview-note { background: var(--surface); padding: 10px; }
#pool-photo { max-height: 130px; margin-block: 10px; }
.photo-source { font-size: .75rem; color: var(--ink); text-decoration: underline; }
.detail-list { font-size: .85rem; margin-block: 12px; }
.detail-list div { display: grid; grid-template-columns: minmax(95px, 1fr) 2fr; gap: 10px; padding-block: 6px; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { font-weight: 600; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.button[hidden] { display: none; }
#account-dialog form, #signed-in, #account-error:not(:empty) { margin-top: 12px; }
#account-dialog p { font-size: .88rem; line-height: 1.55; }
#signed-in h3 { margin-top: 18px; }
#buyer-orders { list-style: none; padding: 0; }
#buyer-orders li { display: grid; gap: 3px; padding-block: 8px; border-bottom: 1px solid var(--line); }
#buyer-orders span { color: var(--muted); font-size: .82rem; }

@media (max-width: 820px) {
  .toolbar { flex-basis: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .wrap { width: 92%; }
  .nav { min-height: 62px; grid-template-columns: 1fr auto; }
  .nav nav { display: none; }
  .brand b { font-size: 2.28rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero figure { min-height: 0; height: clamp(118px, 35vw, 160px); }
  .hero img { object-position: center 54%; }
  .hero-copy { gap: 12px; padding: 22px; }
  .hero h1 { font-size: clamp(3rem, 11.5vw, 4.4rem); }
  .sector-tiles { gap: 8px; }
  .sector-name { font-size: clamp(1.35rem, 5.2vw, 1.9rem); gap: .28em; }
  .sector-tiles img { width: 32%; }
  .hero-description { font-size: .89rem; max-width: 34ch; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .filters button { padding-inline: 8px; min-height: 40px; }
  .grid { gap: 24px 11px; }
  .product-photo { aspect-ratio: 1 / 1; }
  .card .tag { font-size: .56rem; }
  .card .muted, .card .progress-text, .pool-facts dd { font-size: .71rem; }
  .card-actions .button { padding-inline: 5px; font-size: .72rem; gap: 4px; }
  .how ol { grid-template-columns: 1fr; gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }

@media (max-width: 540px) {
  .hero-copy { gap: 8px; padding: 14px 16px; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .hero figure { height: clamp(82px, 23vw, 112px); }
  .market.wrap { padding-top: 16px; }
  .sector-tiles { display: none; }
  .section-title { gap: 3px; margin-bottom: 10px; }
}

@media (max-width: 540px) { .hero figure { display: none; } }

@media (max-width: 540px) {
  .hero h1 { font-size: clamp(1rem, 7.25vw, 2.4rem); line-height: 1.08; white-space: nowrap; }
  .hero h1 br { display: none; }
}

.brand img { display: block; width: clamp(136px, 18vw, 166px); height: auto; mix-blend-mode: multiply; }

.header-actions { display: flex; justify-self: end; align-items: center; gap: 8px; }
.header-actions .button { white-space: nowrap; }
#seller-dialog { width: min(94vw, 580px); max-height: 90dvh; overflow: auto; }
#seller-dialog form, #seller-dashboard { margin-top: 16px; }
#seller-dialog p { font-size: .88rem; line-height: 1.55; }
#seller-dialog label { display: grid; gap: 4px; margin-bottom: 12px; }
#seller-dialog input, #seller-dialog select, #seller-dialog textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; color: inherit; background: white; font: inherit;
}
#seller-dialog textarea { min-height: 80px; resize: vertical; }
#seller-dialog ul { padding-left: 1.25rem; }
#seller-dialog li { margin-bottom: 8px; }
#seller-error:not(:empty) { color: #9f2222; margin-top: 8px; }
.seller-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
@media (max-width: 540px) {
  .site-header .nav { gap: 8px; }
  .header-actions .button { padding-inline: 8px; font-size: .72rem; }
  .seller-grid { grid-template-columns: minmax(0, 1fr); }
}
