/* ==========================================================================
   JLS Casters — demo template
   Design system mirrored from ScrewFast (indigo primary / orange accent /
   gray scale / dark mode). Self-contained: no CDN, no build step.
   ========================================================================== */

:root {
  --white: #ffffff;
  --black: #000000;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #0b1120;

  /* Brand red — sampled from the client logo (#F81008 dominant, #EC1C18 average) */
  --red-50: #fff5f4;
  --red-100: #ffe4e1;
  --red-200: #ffc8c2;
  --red-300: #ffa39b;
  --red-400: #fb6f62;
  --red-500: #f5251a;
  --red-600: #e01507;
  --red-700: #b91208;
  --red-800: #910e06;
  --red-900: #6f0b05;

  /* Warm neutral surfaces — keeps the light theme from going cold/grey */
  --sand-50: #fdfaf9;
  --sand-100: #faf5f3;
  --sand-200: #f2ebe8;

  --amber-50: #fffbeb;
  --amber-200: #fde68a;
  --amber-500: #f0a202;
  --amber-700: #a16207;

  --green-100: #dcfce7;
  --green-600: #16a34a;
  --green-700: #15803d;

  /* semantic — light, warm, low-contrast backgrounds */
  --bg: var(--white);
  --bg-subtle: var(--sand-100);
  --bg-elevated: var(--white);
  --fg: #1f2937;
  --fg-muted: #4b5563;
  --fg-subtle: #6b7280;
  --border: #eee7e4;
  --border-strong: #ded4d0;
  --primary: var(--red-600);
  --primary-hover: var(--red-700);
  --accent: var(--red-600);
  --accent-hover: var(--red-700);
  --accent-soft: var(--red-50);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);

  --maxw: 1200px;
  --header-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html.dark {
  --bg: #17110f;
  --bg-subtle: #1f1815;
  --bg-elevated: #241b18;
  --fg: #f7f2f0;
  --fg-muted: #d9cec9;
  --fg-subtle: #b3a49e;
  --border: #33261f;
  --border-strong: #4a372e;
  --primary: var(--red-500);
  --primary-hover: var(--red-400);
  --accent: var(--red-400);
  --accent-hover: var(--red-300);
  --accent-soft: rgba(245, 37, 26, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding-left: 1.15rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1400px; }
.section { padding: 68px 0; }
.section-sm { padding: 44px 0; }
.section-tight { padding: 34px 0; }
.bg-subtle { background: var(--bg-subtle); }
.bg-dark { background: var(--gray-950); color: var(--gray-100); }
.bg-dark h2, .bg-dark h3 { color: #fff; }
/* brand-band replaces the old dark stats strip: bright, on-brand */
.brand-band {
  background:
    radial-gradient(680px 300px at 88% 0%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(180deg, var(--red-600), var(--red-700));
  color: #fff;
}
.brand-band .stat .n { color: #fff; }
.brand-band .stat .l { color: rgba(255,255,255,.88); }

.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g-auto-lg { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g-sidebar { grid-template-columns: 260px minmax(0, 1fr); gap: 44px; align-items: start; }

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.maxw-sm { max-width: 620px; }
.maxw-md { max-width: 820px; }

/* ---------- typography helpers ---------- */
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}
.lead { font-size: 1.075rem; color: var(--fg-muted); }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.bg-dark .lead, .bg-dark .muted { color: var(--gray-300); }
.section-head { max-width: 760px; margin-bottom: 34px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .94rem;
  line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline { border-color: var(--border-strong); color: var(--fg); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { color: var(--fg-muted); }
.btn-ghost:hover { color: var(--primary); }
.btn-light { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }
.btn-light:hover { background: var(--red-100); border-color: var(--red-200); }
.btn-white { background: #fff; color: var(--gray-900); }
.btn-white:hover { background: var(--gray-100); }
.btn-muted { background: #eae5e1; color: var(--fg); }
.btn-muted:hover { background: #ded7d2; }
html.dark .btn-muted { background: #2b211d; color: var(--gray-200); }
html.dark .btn-muted:hover { background: #362a25; }
.btn .btn-chev { font-size: 1.3em; line-height: 0; translate: 0 1px; transition: transform .15s; }
.btn:hover .btn-chev { transform: translateX(3px); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.btn-block { width: 100%; }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--border);
}
html.dark .badge { background: #2b211d; color: var(--gray-300); }
.badge-accent { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-200); }
html.dark .badge-accent { background: rgba(240,162,2,.16); color: #fcd34d; border-color: rgba(240,162,2,.34); }
.badge-primary { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
html.dark .badge-primary { background: rgba(224,21,7,.16); color: #ffb4ad; border-color: rgba(224,21,7,.32); }
.badge-green { background: var(--green-100); color: var(--green-700); border-color: #bbf7d0; }
html.dark .badge-green { background: rgba(22,163,74,.16); color: #86efac; border-color: rgba(22,163,74,.32); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-size: .84rem;
  font-weight: 600;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .18s, box-shadow .18s, border-color .18s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card-flush { padding: 0; overflow: hidden; }
.card-body { padding: 20px 22px; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .35em; }
.card-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--red-50);
  color: var(--primary);
  margin-bottom: 14px;
  font-weight: 800;
  font-size: .82rem;
}
html.dark .card-icon { background: rgba(224,21,7,.15); }

/* ---------- header / nav ---------- */
.announce {
  background: var(--red-600);
  color: #ffe9e7;
  font-size: .84rem;
  text-align: center;
  padding: 9px 16px;
  font-weight: 500;
}
.announce strong { color: #fff; }
.announce a { color: #fff; text-decoration: underline; font-weight: 700; }

.site-header {
  position: sticky;
  top: 10px;
  z-index: 60;
  background: transparent;
  padding: 0 14px;
}
/* floating capsule nav, ScrewFast-style */
.site-header .nav {
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  padding: 0 12px 0 8px;
  margin-top: 12px;
}
@supports (backdrop-filter: blur(10px)) {
  .site-header .nav { backdrop-filter: saturate(180%) blur(10px); }
}
.nav { display: flex; align-items: center; gap: 10px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.01em; font-size: 1.22rem; color: var(--fg); }
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, var(--red-500), var(--red-700));
  display: grid; place-items: center; color: #fff; font-size: .82rem; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand small { display: block; font-size: .64rem; font-weight: 600; letter-spacing: .12em; color: var(--fg-subtle); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.filters, [data-product-grid] { scroll-margin-top: 118px; } /* clear the sticky header on deep-link scroll */

.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 600; color: var(--fg-muted);
}
.nav-link:hover, .nav-link.is-active { color: var(--primary); background: var(--gray-100); }
html.dark .nav-link:hover, html.dark .nav-link.is-active { background: #2b211d; }
.nav-link .caret { width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-1px); }

.mega {
  position: absolute; top: calc(100% + 10px); left: -10px;
  width: min(860px, 88vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 26px;
}
.nav-item.open .mega, .nav-item.has-mega:focus-within .mega { display: grid; }
/* invisible bridge across the 10px offset gap so the hover path from the nav
   link to the panel never leaves the nav-item (menu stays open while crossing) */
.mega::before { content: ""; position: absolute; left: -10px; right: -10px; top: -12px; height: 12px; }
.mega h4 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--fg-subtle); margin: 0 0 10px;
}
.mega a { display: block; padding: 6px 8px; margin-left: -8px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; color: var(--fg-muted); }
.mega a:hover { background: var(--gray-100); color: var(--primary); }
html.dark .mega a:hover { background: #2b211d; }
.mega .mega-foot { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .85rem; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--fg-muted);
}
.icon-btn:hover { color: var(--primary); border-color: var(--border-strong); }
.lang-select {
  border: 1px solid var(--border); background: transparent; color: var(--fg-muted);
  border-radius: var(--radius-sm); padding: 8px 6px; font-size: .84rem; font-weight: 600;
}
.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
}

/* mobile drawer — floating panel under the capsule */
.drawer {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-top: 10px;
  padding: 6px 22px 22px;
}
.drawer.open { display: block; }
.drawer h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-subtle); margin: 16px 0 8px; }
.drawer a { display: block; padding: 8px 0; font-weight: 600; color: var(--fg-muted); border-bottom: 1px solid var(--border); }
@media (min-width: 1081px) { .drawer { display: none !important; } }

/* small screens: compact header so all actions fit */
@media (max-width: 640px) {
  .lang-select, .nav-actions .icon-btn[data-theme-toggle] { display: none; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-sm { padding: 8px 12px; font-size: .84rem; }
  .brand { gap: 9px; }
  .brand-logo { width: 38px; height: 38px; }
  .brand span { white-space: nowrap; }
  .brand small { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(760px 380px at 82% -12%, rgba(224, 21, 7, .08), transparent 62%),
    radial-gradient(560px 340px at 2% 110%, rgba(240, 162, 2, .08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--sand-50) 100%);
  color: var(--fg);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: end; padding: 48px 0 48px; }
.hero h1 { color: var(--fg); font-size: clamp(2.2rem, 3.8vw, 2.9rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
.hero .hl { color: var(--primary); }
.hero .lead { color: var(--fg-muted); max-width: 560px; }
.hero-media { position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.hero-media .cutout {
  width: 116%; max-width: none; height: auto;
  filter: drop-shadow(0 26px 30px rgba(31, 41, 55, .13));
}
@media (max-width: 940px) {
  .hero-media .cutout { width: 100%; max-width: 520px; margin-inline: auto; }
}
.hero-proof { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.avatars { display: flex; padding-left: 10px; }
.avatars .av {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .68rem; letter-spacing: .03em;
  border: 2.5px solid var(--bg);
  margin-left: -10px;
}
.avatars .av:first-child { margin-left: 0; }
.avatars .av-more { background: var(--gray-900); font-size: .62rem; }
.proof-rating {
  display: flex; align-items: center; gap: 9px;
  border-left: 1px solid var(--border-strong); padding-left: 16px;
  font-size: .92rem; color: var(--fg-muted); line-height: 1.35;
}
.proof-rating b { color: var(--fg); font-size: 1.02rem; }
.stars { color: var(--amber-500); font-size: 1.02rem; letter-spacing: 2.5px; white-space: nowrap; }
.stars .half {
  background: linear-gradient(90deg, var(--amber-500) 55%, #d8d3cf 55%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.hero-stats .n { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.hero-stats .l { font-size: .78rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .07em; }

@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; padding: 44px 0 52px; }
}
html.dark .hero {
  background:
    radial-gradient(760px 380px at 82% -12%, rgba(245, 37, 26, .14), transparent 62%),
    radial-gradient(560px 340px at 2% 110%, rgba(240, 162, 2, .10), transparent 60%),
    linear-gradient(180deg, #241b18 0%, var(--bg) 100%);
}
html.dark .avatars .av { border-color: #241b18; }
html.dark .proof-rating { border-left-color: var(--border-strong); }

/* trust strip */
.trust { display: flex; gap: 10px 28px; flex-wrap: wrap; align-items: center; justify-content: center; }
.trust-item { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 700; color: var(--fg-muted); letter-spacing: .01em; }
.trust-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); }

/* buyer logo wall */
.logo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 56px; }
.logo-mark { font-size: 1.24rem; font-weight: 700; color: var(--gray-400); white-space: nowrap; opacity: .9; }
html.dark .logo-mark { color: var(--gray-500); }

/* ---------- product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.product-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.product-thumb { position: relative; display: block; background: linear-gradient(160deg, var(--gray-50), var(--gray-100)); border-bottom: 1px solid var(--border); }
html.dark .product-thumb { background: linear-gradient(160deg, #241b18, #1f1815); }
.product-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 12px; }
.product-thumb .corner { position: absolute; top: 10px; left: 10px; }
.product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-sku { font-family: var(--mono); font-size: .72rem; color: var(--fg-subtle); letter-spacing: .02em; }
.product-name { font-weight: 700; font-size: 1rem; margin: 4px 0 10px; line-height: 1.35; }
.spec-mini { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 12px; margin-bottom: 14px; }
.spec-mini div { font-size: .8rem; color: var(--fg-muted); }
.spec-mini b { display: block; color: var(--fg); font-size: .92rem; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.price-req { font-size: .8rem; color: var(--fg-subtle); }
.price-req b { display: block; color: var(--fg); font-size: .9rem; }

/* filter bar */
.filters { display: flex; gap: 26px; flex-wrap: wrap; padding: 18px 20px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }
.filter-group { min-width: 170px; }
.filter-group .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--fg-subtle); font-weight: 700; margin-bottom: 8px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips .chip { padding: 5px 11px; font-size: .78rem; }

/* ---------- specs table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
table.spec { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.spec th, table.spec td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.spec thead th { background: var(--bg-subtle); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-subtle); }
table.spec tbody tr:last-child td { border-bottom: 0; }
table.spec tbody tr:hover { background: var(--bg-subtle); }
table.spec td:first-child { color: var(--fg-muted); width: 40%; }
table.spec.zebra tbody tr:nth-child(even) { background: var(--bg-subtle); }

/* ---------- accordion ---------- */
.acc { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-elevated); }
.acc-item + .acc-item { border-top: 1px solid var(--border); }
.acc-q {
  width: 100%; text-align: left; background: transparent; border: 0; color: inherit;
  padding: 16px 20px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.acc-q:hover { background: var(--bg-subtle); }
.acc-q .sign { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-weight: 700; color: var(--fg-subtle); }
.acc-item.open .sign { background: var(--primary); border-color: var(--primary); color: #fff; }
.acc-a { display: none; padding: 0 20px 18px; color: var(--fg-muted); font-size: .94rem; }
.acc-item.open .acc-a { display: block; }

/* ---------- docs (Starlight-like) ---------- */
.docs-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 46px; align-items: start; padding: 40px 0 70px; }
.docs-side { position: sticky; top: calc(var(--header-h) + 44px); }
.docs-search { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--fg); margin-bottom: 16px; }
.docs-nav h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-subtle); margin: 18px 0 8px; }
.docs-nav a { display: block; padding: 6px 10px; margin-left: -10px; border-radius: var(--radius-sm); font-size: .89rem; color: var(--fg-muted); border-left: 2px solid transparent; }
.docs-nav a:hover { background: var(--bg-subtle); color: var(--primary); }
.docs-nav a.is-active { color: var(--primary); font-weight: 700; border-left-color: var(--primary); background: var(--red-50); }
html.dark .docs-nav a.is-active { background: rgba(224,21,7,.14); }
.docs-body { max-width: 860px; }
.docs-body h2 { margin-top: 2.2em; padding-top: .2em; }
.docs-body h2:first-child { margin-top: 0; }
.docs-body h3 { margin-top: 1.6em; }
.docs-body p, .docs-body li { color: var(--fg-muted); }
.callout { border-left: 4px solid var(--accent); background: var(--red-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 18px; margin: 1.4em 0; }
html.dark .callout { background: rgba(224,21,7,.1); }
.callout.warn { border-color: #dc2626; background: #fef2f2; }
html.dark .callout.warn { background: rgba(220,38,38,.12); }
.callout.info { border-color: var(--amber-500); background: var(--amber-50); }
html.dark .callout.info { background: rgba(240,162,2,.12); }
.callout p:last-child { margin-bottom: 0; }
.formula { font-family: var(--mono); background: var(--red-50); color: var(--red-800); border: 1px solid var(--red-100); border-left: 4px solid var(--primary); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem; overflow-x: auto; }
html.dark .formula { background: rgba(245,37,26,.12); color: #ffd9d5; border-color: rgba(245,37,26,.3); }
.toc-inline { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.toc-inline a { color: var(--fg-muted); font-size: .9rem; }
.toc-inline a:hover { color: var(--primary); }
.toc-inline ul { columns: 2; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--fg); }
.field .hint { font-size: .76rem; color: var(--fg-subtle); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: .92rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--fg);
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.textarea { min-height: 118px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--fg-muted); font-weight: 400; }
.form-note { font-size: .78rem; color: var(--fg-subtle); }
.form-success { display: none; background: var(--green-100); border: 1px solid #86efac; color: #14532d; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 18px; }
html.dark .form-success { background: rgba(22,163,74,.16); color: #bbf7d0; border-color: rgba(22,163,74,.4); }
.form-success.show { display: block; }

/* ---------- misc blocks ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 30px; } }
.media-frame { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.media-frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 26px; }
.stat { text-align: center; }
.stat .n { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 800; color: var(--accent); letter-spacing: -.03em; }
.stat .l { font-size: .82rem; color: var(--fg-muted); }
.bg-dark .stat .l { color: var(--gray-400); }
/* brand band — bright red strip instead of a dark section */
.brand-band { background: linear-gradient(180deg, var(--red-600), var(--red-700)); color: #fff; }
.brand-band .stat .n { color: #fff; }
.brand-band .stat .l { color: rgba(255,255,255,.86); }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 30px; margin-bottom: 10px; color: var(--fg-muted); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 16px; height: 9px; border-left: 2px solid var(--green-600); border-bottom: 2px solid var(--green-600);
  transform: rotate(-45deg);
}

.tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-elevated); min-height: 190px;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .18s, box-shadow .18s;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.tile .tile-body { position: relative; z-index: 1; padding: 16px 18px; background: linear-gradient(to top, rgba(2,6,23,.92), rgba(2,6,23,.15) 75%, transparent); color: #fff; width: 100%; }
.tile .tile-body h3 { color: #fff; margin-bottom: 2px; font-size: 1.02rem; }
.tile .tile-body p { margin: 0; font-size: .82rem; color: var(--gray-300); }

.cta-band {
  background:
    radial-gradient(620px 260px at 88% 8%, rgba(224,21,7,.13), transparent 62%),
    radial-gradient(520px 300px at 6% 110%, rgba(240,162,2,.16), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--red-50) 100%);
  color: var(--fg);
  border: 1px solid var(--red-100);
  border-radius: var(--radius-lg); padding: 46px; text-align: center;
}
.cta-band h2 { color: var(--fg); }
.cta-band .lead { color: var(--fg-muted); }

.breadcrumb { font-size: .82rem; color: var(--fg-subtle); padding: 18px 0 0; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 7px; }

/* product gallery: large square frame on top, thumbnail strip below */
.gallery { display: grid; grid-template-columns: 1fr; gap: 12px; }
.gallery-thumbs { display: flex; flex-direction: row; gap: 10px; }
.gallery-thumbs button { flex: 1 1 0; min-width: 0; padding: 5px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.gallery-thumbs button.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--red-100); }
.gallery-thumbs button img { width: 100%; aspect-ratio: 4/3; object-fit: contain; }
.gallery-main { background: linear-gradient(160deg, var(--gray-50), var(--gray-100)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
html.dark .gallery-main { background: linear-gradient(160deg, #241b18, #1f1815); }
.gallery-main img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }

.buybox { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); padding: 22px; box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 34px 0 24px; overflow-x: auto; }
.tab-btn { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 11px 15px; font-weight: 600; color: var(--fg-subtle); white-space: nowrap; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card img { aspect-ratio: 16/9; object-fit: cover; }
.post-card .post-body { padding: 18px 20px 20px; }
.post-meta { font-size: .76rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }

.notice { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px 20px; background: var(--bg-subtle); font-size: .86rem; color: var(--fg-muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--sand-100); color: var(--fg-muted); padding: 54px 0 26px; border-top: 1px solid var(--border); }
.site-footer h4 { color: var(--fg); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.site-footer a { color: var(--fg-muted); font-size: .9rem; display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--primary); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 34px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom { margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--border-strong); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: #fff; }
.footer-social a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- responsive tidy ---------- */
@media (max-width: 1080px) { .g-sidebar, .docs-layout { grid-template-columns: 1fr; gap: 26px; } .docs-side { position: static; } }
@media (max-width: 860px) {
  .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding: 52px 0; }
  .cta-band { padding: 32px 22px; }
}
@media (max-width: 620px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .float-card { position: static; margin-top: 14px; }
}

/* demo banner injected by app.js */
.demo-bar {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 90; background: #fff; color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  padding: 8px 18px; font-size: .8rem; box-shadow: var(--shadow-lg);
  display: flex; gap: 12px; align-items: center;
}
.demo-bar b { color: var(--red-300); }
.demo-bar button { background: transparent; border: 0; color: var(--fg-subtle); font-size: 1rem; line-height: 1; }

/* ---------- motion: buttons, lightbox, panel & card transitions ---------- */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:hover .btn-chev { transform: translateX(3px); }
.btn:focus-visible, .chip:focus-visible, .tab-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip { transition: background .15s, color .15s, border-color .15s, transform .1s; }
.chip:active { transform: scale(.96); }

/* gallery: crossfade on image switch, click-to-zoom cursor */
.gallery-main { cursor: zoom-in; }
.gallery-main img { transition: opacity .15s ease; }
.gallery-main img.fading { opacity: 0; }

/* lightbox (product gallery fullscreen viewer) */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-start; overflow: auto; overscroll-behavior: contain;
  background: rgba(15, 23, 42, .8);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.lightbox.open { opacity: 1; visibility: visible; transition: opacity .22s ease; }
.lightbox img {
  margin: 44px auto 60px; /* top-anchored: always readable from the top, scrollable below */
  max-width: min(92vw, 1200px); max-height: 78vh; width: auto; height: auto;
  background: #fff; border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow-lg);
  transform: scale(.95); transition: transform .22s ease;
}
.lightbox.open img { transform: scale(1); }
.lightbox .lb-btn {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: #fff; color: var(--fg);
  font-size: 1.6rem; line-height: 1; display: grid; place-items: center;
  cursor: pointer; transition: transform .12s, color .12s, border-color .12s;
}
.lightbox .lb-btn:hover { color: var(--primary); border-color: var(--primary); transform: scale(1.06); }
.lightbox .lb-btn:active { transform: scale(.96); }
.lightbox .lb-close { top: 22px; right: 26px; }
.lightbox .lb-prev { left: 22px; top: 50%; translate: 0 -50%; }
.lightbox .lb-next { right: 22px; top: 50%; translate: 0 -50%; }

/* switch actions: tab panels, accordion answers */
.tab-panel.is-active { animation: panel-in .28s ease both; }
.acc-item.open .acc-a { animation: panel-in .24s ease both; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* product cards rise in (initial load, filter and sort re-flow) */
.product-card { animation: card-in .32s ease both; }
.product-card:nth-child(2) { animation-delay: .03s; }
.product-card:nth-child(3) { animation-delay: .06s; }
.product-card:nth-child(4) { animation-delay: .09s; }
.product-card:nth-child(5) { animation-delay: .12s; }
.product-card:nth-child(6) { animation-delay: .15s; }
.product-card:nth-child(n+7) { animation-delay: .18s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* accessibility: users who ask for less motion get none */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
