:root {
  --green: #5f816c;
  --green-deep: #47624f;
  --paper: #fffefa;
  --canvas: #f8f7f3;
  --ink: #23241f;
  --line: #e3e0d6;
  --muted: #76786d;
  --gold: #b59a63;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-deep); text-decoration: none; }
a:hover { color: var(--green); }
::selection { background: #dfe8e0; color: var(--ink); }

.wrap { width: 1200px; max-width: 100%; margin: 0 auto; padding: 0 32px; }
.serif { font-family: Georgia, "Times New Roman", serif; }
.eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--green); font-weight: 700;
}

/* ---------- Masthead ---------- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 18px; padding-bottom: 18px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 16px; color: inherit; }
.brand-mark {
  width: 52px; height: 52px; flex: none; border: 1px solid var(--green);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 22px; color: var(--green);
  background: linear-gradient(145deg, #fff, #f1f4ef);
}
.brand-title {
  font-family: Georgia, "Times New Roman", serif; font-size: 30px;
  line-height: 1; letter-spacing: .01em;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.topnav { display: flex; gap: 28px; align-items: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.topnav a { color: var(--ink); padding-bottom: 4px; border-bottom: 1px solid transparent; }
.topnav a:hover, .topnav a.active { color: var(--green); border-color: var(--green); }
.masthead-rule { height: 4px; background: linear-gradient(90deg, var(--green) 0 33%, var(--gold) 33% 38%, var(--line) 38% 100%); }

/* ---------- Search strip ---------- */
.searchstrip { background: var(--paper); border-bottom: 1px solid var(--line); }
.searchform { display: flex; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.searchinput {
  flex: 1; max-width: 560px; padding: 11px 14px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: 14px inherit; border-radius: 2px;
}
.searchinput:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(95,129,108,.12); }
.btn {
  padding: 11px 22px; border: 1px solid var(--green); background: var(--green);
  color: #fff; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; border-radius: 2px;
}
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green); color: #fff; }
.search-hint { font-size: 12px; color: var(--muted); }

/* ---------- Breadcrumbs ---------- */
.crumbs { padding-top: 18px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green); }
.crumbs span { margin: 0 9px; color: #b6b5ab; }

/* ---------- Home hero ---------- */
.hero {
  position: relative; overflow: hidden; margin-top: 28px;
  background: var(--green); color: #fff; min-height: 340px;
}
.hero-photo {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: .18; filter: grayscale(35%);
}
.hero:after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(35,36,31,.82), rgba(95,129,108,.55) 60%, rgba(95,129,108,.2));
}
.hero-inner { position: relative; z-index: 2; padding: 58px 0 56px; max-width: 760px; }
.hero .eyebrow { color: #e7dfc8; }
.hero h1 {
  font-family: Georgia, "Times New Roman", serif; font-weight: 400;
  font-size: clamp(38px, 5vw, 62px); line-height: 1.05; margin: 18px 0 18px;
}
.hero-lead { font-size: 17px; line-height: 1.7; color: #f3f2ea; max-width: 620px; }
.hero-stats { display: flex; gap: 36px; margin-top: 34px; }
.hero-stat b { display: block; font-family: Georgia, serif; font-size: 34px; line-height: 1; }
.hero-stat span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }

/* ---------- Section headings ---------- */
.section { margin: 58px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 30px; }
.section-head h2 { font-family: Georgia, serif; font-weight: 400; font-size: 30px; margin: 6px 0 0; }
.section-head .note { font-size: 12px; color: var(--muted); }

/* ---------- Group cards ---------- */
.group-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.group-card { background: var(--paper); border: 1px solid var(--line); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.group-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(35,36,31,.10); border-color: #c9d3c7; }
.group-card a { color: inherit; display: block; height: 100%; }
.group-image { position: relative; overflow: hidden; background: #eeece4; aspect-ratio: 4 / 3; }
.group-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.group-card:hover .group-image img { transform: scale(1.045); }
.group-no {
  position: absolute; top: 12px; left: 12px; background: rgba(255,254,250,.94);
  color: var(--green); font-family: Georgia, serif; font-size: 13px;
  padding: 4px 10px; letter-spacing: .08em;
}
.group-body { padding: 20px 22px 22px; }
.group-title { font-family: Georgia, serif; font-size: 23px; line-height: 1.25; margin: 0 0 8px; }
.group-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.group-arrow { color: var(--green); font-size: 18px; }

/* ---------- Editorial (group page) ---------- */
.editorial { display: grid; grid-template-columns: 1.15fr .85fr; gap: 54px; align-items: start; margin-top: 34px; }
.editorial h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(36px, 4vw, 52px); line-height: 1.1; margin: 14px 0 20px; }
.editorial .lead { font-size: 17px; color: #4c4e46; line-height: 1.75; max-width: 650px; }
.editorial-photo { border: 1px solid var(--line); background: var(--paper); padding: 10px; }
.editorial-photo img { width: 100%; max-height: 420px; object-fit: contain; }
.caption { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin-top: 9px; text-align: right; }

.subgroup-list { margin-top: 30px; border-top: 1px solid var(--line); }
.subgroup-row {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 20px; align-items: center;
  padding: 22px 6px; border-bottom: 1px solid var(--line); transition: background .2s ease;
}
.subgroup-row:hover { background: var(--paper); }
.subgroup-no { font-family: Georgia, serif; color: var(--gold); font-size: 17px; }
.subgroup-name { font-family: Georgia, serif; font-size: 22px; }
.subgroup-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.subgroup-count { font-size: 12px; color: var(--green); letter-spacing: .08em; white-space: nowrap; }

/* ---------- Product table ---------- */
.product-head { margin-top: 34px; }
.product-head h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(32px, 4vw, 46px); margin: 12px 0 8px; }
.product-head .needle { color: var(--green); font-size: 14px; letter-spacing: .06em; }
.product-head .lead { max-width: 780px; color: #4c4e46; margin-top: 14px; }
.product-note { font-size: 12px; color: var(--muted); margin-top: 18px; border-left: 2px solid var(--gold); padding-left: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 32px 0 18px; padding: 20px; background: var(--paper); border: 1px solid var(--line); }
.toolbar-field { min-width: 190px; flex: 1; }
.toolbar label { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.toolbar select, .toolbar input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font: 14px inherit; border-radius: 2px;
}
.toolbar select:focus, .toolbar input:focus { outline: none; border-color: var(--green); }
.toolbar .btn { align-self: end; }

.table-wrap { background: var(--paper); border: 1px solid var(--line); overflow-x: auto; }
table.products { width: 100%; border-collapse: collapse; min-width: 760px; }
table.products th {
  text-align: left; padding: 15px 16px; border-bottom: 2px solid var(--green);
  font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--green);
  white-space: nowrap;
}
table.products td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
table.products tbody tr:hover { background: #f4f7f2; }
table.products tbody tr:last-child td { border-bottom: 0; }
.code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px; color: var(--green-deep); font-weight: 700; white-space: nowrap;
}
.spec { color: #5c5e55; }
.thumb { width: 84px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 3px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Search / static page ---------- */
.result-meta { font-size: 13px; color: var(--muted); margin: 18px 0; }
.page-body { background: var(--paper); border: 1px solid var(--line); padding: 36px 40px; margin-top: 32px; max-width: 900px; }
.page-body h1 { font-family: Georgia, serif; font-weight: 400; font-size: 38px; margin-top: 0; }
.page-body img { max-width: 100%; }

/* ---------- Footer ---------- */
.footer { margin-top: 72px; background: var(--ink); color: #d6d6cc; border-top: 4px solid var(--green); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; padding-top: 44px; padding-bottom: 44px; }
.footer h3 { font-family: Georgia, serif; font-weight: 400; font-size: 21px; color: #fff; margin: 0 0 12px; }
.footer p { margin: 0 0 10px; font-size: 13px; line-height: 1.7; }
.footer a { color: #cfd8c9; text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #3a3b34; padding: 18px 0 26px; font-size: 11px; color: #9b9d92; display: flex; justify-content: space-between; gap: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .group-grid { grid-template-columns: repeat(2, 1fr); }
  .editorial { grid-template-columns: 1fr; gap: 30px; }
  .editorial-photo { max-width: 560px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  .masthead-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .topnav { gap: 18px; font-size: 11px; }
  .brand-title { font-size: 26px; }
  .searchform { flex-wrap: wrap; }
  .searchinput { max-width: none; flex: 1 1 100%; font-size: 16px; }
  .btn { width: 100%; }
  .hero-inner { padding: 42px 0; }
  .hero-stats { gap: 22px; }
  .group-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 4px; }
  .subgroup-row { grid-template-columns: 36px 1fr; gap: 12px; }
  .subgroup-count { grid-column: 2; }
  .toolbar-field { flex: 1 1 100%; }
  .page-body { padding: 24px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}
