:root {
  --ink: #211d19;
  --muted: #71685f;
  --paper: #fbfaf7;
  --sand: #f1ece4;
  --line: #ddd4c9;
  --accent: #5f3d2d;
  --accent-strong: #40271c;
  --white: #ffffff;
  --danger: #9a332c;
  --success: #37644a;
  --radius: 18px;
  --header-height: 76px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
body.filter-open { overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  border-radius: 8px;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  height: var(--header-height);
  padding: 0 clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  letter-spacing: .08em;
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.hero-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 92px) clamp(18px, 4vw, 56px) 38px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: end;
}
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.hero-copy h1 { max-width: 760px; margin: 0; font: 500 clamp(38px, 6vw, 78px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.hero-copy > p:last-child { max-width: 650px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.search-box label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--white);
  color: var(--ink);
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }

.category-nav {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 56px) 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.category-button, .facet-button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.category-button { flex: 0 0 auto; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.category-button:hover, .category-button:focus-visible, .facet-button:hover, .facet-button:focus-visible { border-color: var(--accent); outline: 0; }
.category-button[aria-pressed="true"], .facet-button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }

.catalog-layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px clamp(18px, 4vw, 56px) 90px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  border-top: 1px solid var(--line);
}
.filter-panel { align-self: start; position: sticky; top: calc(var(--header-height) + 24px); padding-top: 13px; }
.filter-header { display: flex; align-items: start; justify-content: space-between; }
.filter-header h2, .results-header h2 { margin: 0; font: 500 29px/1.05 Georgia, "Times New Roman", serif; }
.facet-group { padding: 23px 0; border-bottom: 1px solid var(--line); }
.facet-title { margin: 0 0 12px; font-size: 13px; }
.facet-options { display: flex; flex-wrap: wrap; gap: 7px; }
.facet-button { min-height: 38px; padding: 0 11px; border-radius: 9px; font-size: 12px; }
.facet-count { margin-left: 4px; opacity: .65; }
.text-button, .icon-button { min-height: 44px; border: 0; background: transparent; color: var(--accent); font-weight: 750; cursor: pointer; }
.text-button { padding: 16px 0; }
.text-button:hover, .text-button:focus-visible, .icon-button:hover, .icon-button:focus-visible { color: var(--accent-strong); text-decoration: underline; outline: 0; }

.results-panel { min-width: 0; padding-top: 13px; }
.results-header { min-height: 61px; display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 24px; }
.result-count { margin: 0 0 2px; color: var(--muted); font-size: 13px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 32px) clamp(12px, 1.8vw, 24px); }
.product-card { min-width: 0; }
.product-card-link { display: block; text-decoration: none; }
.product-image-wrap { overflow: hidden; aspect-ratio: 4/5; border-radius: var(--radius); background: var(--sand); }
.product-image { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card-link:hover .product-image, .product-card-link:focus-visible .product-image { transform: scale(1.018); }
.product-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: var(--radius); }
.product-card-body { padding: 13px 2px 0; }
.product-ref { margin: 0 0 5px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.product-title { min-height: 42px; margin: 0; display: -webkit-box; overflow: hidden; font: 500 16px/1.35 Georgia, "Times New Roman", serif; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-price { margin: 8px 0 0; color: var(--accent); font-size: 13px; font-weight: 750; }
.load-more-wrap { padding-top: 40px; text-align: center; }
.primary-button, .header-action {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 750;
  cursor: pointer;
}
.primary-button:hover, .primary-button:focus-visible, .header-action:hover, .header-action:focus-visible { background: var(--accent-strong); outline: 2px solid transparent; }
.empty-state { padding: 80px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-state h3 { margin: 0; font: 500 28px Georgia, "Times New Roman", serif; }
.empty-state p { color: var(--muted); }

.detail-toolbar { max-width: 1500px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 56px); display: flex; justify-content: space-between; gap: 20px; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-weight: 750; text-decoration: none; }
.back-link::before { content: "←"; margin-right: 8px; }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; outline: 0; }
.sync-date { color: var(--muted); font-size: 12px; }
.detail-shell { max-width: 1500px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px) 100px; }
.detail-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(350px, .8fr); gap: clamp(32px, 5vw, 78px); align-items: start; }
.gallery-stage { overflow: hidden; aspect-ratio: 4/5; border-radius: 24px; background: var(--sand); }
.gallery-stage img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-top: 12px; }
.gallery-thumb { min-width: 0; padding: 0; overflow: hidden; aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: var(--sand); cursor: pointer; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--paper); }
.detail-summary { position: sticky; top: calc(var(--header-height) + 24px); }
.detail-summary h1 { margin: 0; font: 500 clamp(34px, 4vw, 58px)/1.03 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.detail-ref { margin: 12px 0 0; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; overflow-wrap: anywhere; }
.detail-price { margin: 24px 0; font-size: 23px; font-weight: 800; }
.option-group { padding: 19px 0; border-top: 1px solid var(--line); }
.option-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.option-heading strong { font-size: 13px; }
.option-heading span { color: var(--muted); font-size: 12px; }
.option-values { display: flex; flex-wrap: wrap; gap: 8px; }
.option-button { min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); cursor: pointer; }
.option-button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option-button:disabled { cursor: not-allowed; opacity: .35; text-decoration: line-through; }
.option-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.availability-note { margin: 14px 0 0; color: var(--success); font-size: 12px; }
.availability-note.unavailable { color: var(--danger); }

.screenshot-card { margin-top: 28px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.screenshot-label { margin: 0 0 13px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.screenshot-main { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; align-items: start; }
.screenshot-main img { width: 82px; height: 102px; border-radius: 9px; object-fit: cover; background: var(--sand); }
.screenshot-main h2 { margin: 0 0 7px; font: 500 17px/1.25 Georgia, "Times New Roman", serif; }
.screenshot-code { margin: 4px 0; color: var(--muted); font: 700 10px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.screenshot-options { margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; }
.screenshot-option { padding-top: 8px; border-top: 1px solid var(--line); }
.screenshot-option dt { color: var(--muted); font-size: 10px; }
.screenshot-option dd { margin: 3px 0 0; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.screenshot-price { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 850; }
.screenshot-date { margin: 7px 0 0; color: var(--muted); font-size: 10px; }

.detail-lower { margin-top: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .36fr); gap: clamp(34px, 6vw, 90px); align-items: start; }
.detail-section h2 { margin: 0 0 20px; font: 500 30px Georgia, "Times New Roman", serif; }
.product-description { color: #49423b; font-size: 15px; line-height: 1.72; }
.product-description img { width: auto; max-height: 860px; margin: 24px auto; border-radius: 14px; object-fit: contain; }
.product-description table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.product-description td, .product-description th { padding: 8px; border: 1px solid var(--line); text-align: left; }
.video-list { display: grid; gap: 12px; }
.video-card { position: relative; overflow: hidden; min-height: 210px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sand); }
.video-card iframe { width: 100%; min-height: 260px; border: 0; }
.video-play { min-height: 46px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 750; cursor: pointer; }

.error-view { max-width: 720px; min-height: 64vh; margin: 0 auto; padding: 90px 24px; text-align: center; }
.error-view h1 { margin: 0; font: 500 48px/1.05 Georgia, "Times New Roman", serif; }
.error-view p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.inline-button { display: inline-flex; align-items: center; text-decoration: none; }
.site-footer { padding: 40px clamp(18px, 4vw, 56px); display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.site-footer p { margin: 7px 0 0; }
.mobile-only { display: none; }

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-main { grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); }
  .gallery-thumbs { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 760px) {
  :root { --header-height: 66px; }
  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  .site-header { padding: 0 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-copy small { display: none; }
  .header-action { min-height: 42px; padding: 0 16px; }
  .hero-shell { padding: 34px 18px 26px; grid-template-columns: 1fr; gap: 26px; }
  .hero-copy h1 { font-size: clamp(39px, 12vw, 56px); }
  .hero-copy > p:last-child { margin-top: 16px; font-size: 14px; }
  .category-nav { padding: 0 18px 20px; }
  .catalog-layout { padding: 15px 14px 66px; grid-template-columns: 1fr; }
  .filter-backdrop { position: fixed; z-index: 49; inset: 0; display: block; background: rgba(23, 18, 14, .45); }
  .filter-panel { position: fixed; z-index: 50; inset: auto 0 0; max-height: 82vh; padding: 22px 20px 26px; overflow-y: auto; border-radius: 22px 22px 0 0; background: var(--paper); transform: translateY(105%); transition: transform .24s ease; }
  body.filter-open .filter-panel { transform: translateY(0); }
  .results-header { align-items: end; margin-bottom: 19px; }
  .product-grid { gap: 23px 10px; }
  .product-image-wrap { border-radius: 13px; }
  .product-card-body { padding-top: 10px; }
  .product-title { min-height: 38px; font-size: 14px; }
  .product-price { font-size: 12px; }
  .detail-toolbar { padding: 12px 18px; }
  .sync-date { display: none; }
  .detail-shell { padding: 0 0 70px; }
  .detail-main { grid-template-columns: 1fr; gap: 0; }
  .gallery-column { padding: 0 12px; }
  .gallery-stage { border-radius: 18px; }
  .gallery-thumbs { grid-template-columns: repeat(5, 1fr); gap: 7px; }
  .detail-summary { position: static; padding: 30px 18px 0; }
  .detail-summary h1 { font-size: 36px; }
  .detail-price { margin: 20px 0; }
  .screenshot-card { margin-left: -2px; margin-right: -2px; padding: 14px; }
  .screenshot-main { grid-template-columns: 72px minmax(0, 1fr); gap: 11px; }
  .screenshot-main img { width: 72px; height: 90px; }
  .screenshot-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-lower { margin-top: 56px; padding: 0 18px; grid-template-columns: 1fr; }
  .detail-section h2 { font-size: 27px; }
  .product-description { font-size: 14px; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 390px) {
  .brand-copy strong { font-size: 17px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screenshot-options { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
