/* HOLBERY Marketplace — design system
   Premium, minimal, restrained palette. No external fonts or CDNs. */

:root {
  --ink: #14211d;
  --ink-2: #33423d;
  --muted: #5d6b66;
  --line: #e3e6e2;
  --line-2: #d3d8d3;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --alt: #f3f2ec;
  --accent: #1f5c4a;
  --accent-ink: #ffffff;
  --accent-soft: #e5efe9;
  --warn-bg: #fbf3e2;
  --warn-ink: #6b4a10;
  --info-bg: #eef2f6;
  --info-ink: #24364a;
  --focus: #c8902e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 33, 29, 0.04), 0 8px 24px rgba(20, 33, 29, 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--alt); padding: .1em .35em; border-radius: 4px; }
ul[role='list'] { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff;
  padding: .6rem 1rem; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 780px; }

/* ---------- Header ---------- */
.site-header { background: rgba(251, 250, 247, .92); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand-text { font-weight: 700; letter-spacing: .12em; font-size: .95rem; }
.brand-sub { font-weight: 400; letter-spacing: .02em; color: var(--muted); margin-left: .15rem; }
.primary-nav { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.primary-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: .5rem .75rem; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.primary-nav a:hover { background: var(--alt); color: var(--ink); }
.primary-nav a[aria-current='page'] { color: var(--ink); font-weight: 600; background: var(--alt); }
.header-search input { width: 220px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { position: absolute; left: 11px; width: 20px; height: 2px; background: var(--ink); content: ''; }
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { top: -6px; left: 0; }
.nav-toggle-bar::after { top: 6px; left: 0; }

.notice-bar { background: var(--warn-bg); color: var(--warn-ink); font-size: .875rem; padding: .55rem 0; border-bottom: 1px solid #f0e2c0; }

/* ---------- Forms ---------- */
input[type='search'], input[type='text'], select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: .6rem .8rem; min-height: 44px; width: 100%;
}
input:focus-visible, select:focus-visible { border-color: var(--focus); }
label { font-size: .8rem; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: .35rem; letter-spacing: .02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .95rem; min-height: 44px; padding: .65rem 1.25rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Hero ---------- */
.hero { padding: 5.5rem 0 4.5rem; border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 860px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 600; color: var(--accent); margin: 0 0 1rem; display: inline-block; }
.eyebrow-link { text-decoration: none; }
.hero-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; margin-bottom: 1.25rem; letter-spacing: -0.02em; }
.hero-lead { font-size: 1.15rem; color: var(--ink-2); max-width: 680px; margin-bottom: 2rem; }
.hero-search { display: flex; gap: .5rem; max-width: 560px; }
.hero-search input { flex: 1; min-height: 50px; font-size: 1rem; }
.hero-search .btn { min-height: 50px; padding: 0 1.5rem; }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-tight { padding: 2rem 0 4rem; }
.section-alt { background: var(--alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head .section-title { margin: 0; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.section-lead { color: var(--muted); max-width: 680px; margin: -0.75rem 0 2rem; }
.link-arrow { font-weight: 600; text-decoration: none; font-size: .95rem; }
.link-arrow::after { content: ' →'; }

.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.principles li { border-top: 2px solid var(--ink); padding-top: 1rem; }
.principles h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.principles p { color: var(--muted); font-size: .95rem; margin: 0; }

.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.category-card { display: flex; flex-direction: column; height: 100%; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.category-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.category-card-title { font-size: 1.05rem; margin-bottom: .5rem; }
.category-card-desc { font-size: .9rem; color: var(--muted); flex: 1; margin-bottom: 1rem; }
.category-card-count { font-size: .8rem; font-weight: 600; color: var(--accent); }

/* ---------- Product grid & card ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.product-card { height: 100%; }
.product-card-link { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.product-card-link:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.product-card-media { aspect-ratio: 4 / 3; background: var(--alt); border-bottom: 1px solid var(--line); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem; }
.product-card-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.product-card-category { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.product-card-title { font-size: 1.1rem; margin-bottom: .5rem; }
.product-card-desc { font-size: .9rem; color: var(--muted); flex: 1; }
.product-card-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; }
.product-card-formats { color: var(--muted); }
.product-card-price { font-weight: 700; white-space: nowrap; }
.price-muted { color: var(--muted); font-weight: 500; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.badge-available { background: var(--accent-soft); color: var(--accent); border-color: #c9dfd3; }
.badge-demonstration { background: var(--warn-bg); color: var(--warn-ink); border-color: #ecd9ae; }
.badge-coming_soon { background: var(--info-bg); color: var(--info-ink); border-color: #d3dde8; }
.badge-paused, .badge-not_available { background: var(--alt); color: var(--muted); border-color: var(--line-2); }

/* ---------- Page header & breadcrumbs ---------- */
.page-header { padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--line); }
.page-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.75rem); margin-bottom: .75rem; }
.page-lead { color: var(--ink-2); font-size: 1.1rem; max-width: 720px; margin: 0; }
.breadcrumbs { margin: 1.25rem 0; font-size: .85rem; }
.page-header .breadcrumbs { margin-top: 0; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: .35rem; color: var(--line-2); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Filter ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
.field { min-width: 180px; }
.field-grow { flex: 1 1 260px; }
.result-summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: .9rem; margin-bottom: 1.25rem; }
.result-summary p { margin: 0; }
.link-reset { font-weight: 600; }
.chip-nav ul { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.chip { display: inline-block; white-space: nowrap; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .85rem; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current='page'] { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty-state { text-align: center; padding: 4rem 1.5rem; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-state-icon { font-size: 2rem; color: var(--line-2); margin-bottom: .5rem; }
.empty-state-title { font-size: 1.25rem; }
.empty-state-body { color: var(--muted); }

/* ---------- Alerts ---------- */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); font-size: .95rem; margin: 0 0 1.5rem; border: 1px solid transparent; }
.alert-demo { background: var(--warn-bg); color: var(--warn-ink); border-color: #ecd9ae; }
.alert-info { background: var(--info-bg); color: var(--info-ink); border-color: #d3dde8; }

/* ---------- Product detail ---------- */
.product-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; padding-bottom: 3rem; align-items: start; }
.product-hero-media figure { margin: 0; }
.product-hero-media img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--alt); width: 100%; }
.product-hero-media figcaption { font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.product-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: .75rem; }
.product-lead { color: var(--ink-2); font-size: 1.05rem; margin-bottom: 1.5rem; }
.purchase-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.purchase-price { display: flex; flex-direction: column; margin-bottom: 1rem; }
.purchase-price-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.purchase-price-note { font-size: .8rem; color: var(--muted); }
.purchase-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin: 0 0 1.25rem; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.purchase-facts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.purchase-facts dd { margin: .15rem 0 0; font-size: .9rem; }
.purchase-help { font-size: .8rem; color: var(--muted); margin: .75rem 0 0; }
.purchase-unavailable { background: var(--alt); border-radius: var(--radius-sm); padding: 1rem; font-size: .9rem; color: var(--ink-2); }
.purchase-unavailable-title { font-weight: 700; color: var(--ink); margin-bottom: .35rem; }

.product-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; padding-top: 3rem; padding-bottom: 4rem; border-top: 1px solid var(--line); }
.detail-section { margin-bottom: 2.75rem; }
.detail-section h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.detail-section h3 { font-size: 1rem; margin-top: 1.25rem; margin-bottom: .35rem; }
.detail-section p { color: var(--ink-2); }
.detail-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.deliverables li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.15rem; background: var(--surface); margin-bottom: .75rem; }
.deliverable-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .25rem; }
.deliverable-name { font-weight: 600; }
.deliverable-format { font-size: .8rem; color: var(--accent); font-weight: 600; }
.deliverables p { margin: 0; font-size: .9rem; }
.steps { padding-left: 1.25rem; color: var(--ink-2); }
.steps li { margin-bottom: .5rem; padding-left: .25rem; }
.license-name { font-weight: 600; color: var(--ink) !important; }
.check-list, .cross-list { list-style: none; padding: 0; margin: 0; }
.check-list li, .cross-list li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; color: var(--ink-2); font-size: .95rem; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.cross-list li::before { content: '✕'; position: absolute; left: 0; color: #9a3b2e; font-weight: 700; }
.product-specs { align-self: start; position: sticky; top: 90px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.product-specs h2 { font-size: 1.1rem; }
.spec-list { margin: 0; }
.spec-list > div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.spec-list > div:last-child { border-bottom: 0; }
.spec-list dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.spec-list dd { margin: .2rem 0 0; font-size: .92rem; }
.spec-list ul { margin: 0; padding-left: 1rem; }

/* ---------- Prose / FAQ ---------- */
.prose { max-width: 760px; padding: 2.5rem 0 4rem; }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin-top: 2.25rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .45rem; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; list-style: none; padding: 1.25rem 2.5rem 1.25rem 0; font-weight: 600; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { color: var(--ink-2); padding-bottom: 1.25rem; margin: 0; max-width: 680px; }
.faq-more { margin-top: 2rem; color: var(--muted); }

.not-found { padding: 6rem 0; text-align: left; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9d1cd; padding: 3.5rem 0 1.5rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer-title { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem; }
.footer-text { font-size: .92rem; max-width: 320px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { color: #c9d1cd; text-decoration: none; font-size: .9rem; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.site-footer :focus-visible { outline-color: #f0c069; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .82rem; color: #93a19b; }
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-body { grid-template-columns: 1fr; }
  .product-specs { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-search input { width: 170px; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.25rem; flex-direction: column; align-items: stretch; gap: 1rem; box-shadow: var(--shadow); }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; }
  .header-search input { width: 100%; }
  .product-hero { grid-template-columns: 1fr; gap: 2rem; }
  .site-header { position: sticky; }
  /* No-JS fallback: show nav when JS is unavailable */
  .no-js .primary-nav { display: flex; position: static; box-shadow: none; }
}
@media (max-width: 640px) {
  .hero { padding: 3.5rem 0 3rem; }
  .hero-search { flex-direction: column; }
  .section { padding: 3rem 0; }
  .category-grid, .principles, .product-grid { grid-template-columns: 1fr; }
  .detail-pair { grid-template-columns: 1fr; gap: 0; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .field { min-width: 0; }
  .field-grow { flex: 0 0 auto; }
  .field-action .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .purchase-facts { grid-template-columns: 1fr 1fr; }
}
@media print {
  .site-header, .site-footer, .notice-bar, .filter-bar { display: none; }
}
