/* ==========================================================================
   TraceGrid — shared design system
   Light base + dark navy band (#0f172a) + per-SKU accent (red/blue/orange)
   Zero external dependencies: system fonts, inline SVG, hand-written CSS.
   ========================================================================== */

:root {
  --accent: #e41c24;            /* default = red (main SKU / 320E) */
  --accent-strong: #c1121a;
  --accent-soft: #fdecec;

  --ink: #0b1220;
  --muted: #5b6678;
  --faint: #8a94a6;
  --line: #e3e8f0;
  --soft: #f5f7fb;

  --band: #0f172a;
  --band-2: #131c33;
  --band-ink: #e7edf6;
  --band-muted: #9aa7bd;
  --band-card: rgba(255, 255, 255, .05);
  --band-card-line: rgba(255, 255, 255, .13);

  --ok: #1a9e5c;
  --err: #d0323c;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 14px 34px -16px rgba(15, 23, 42, .28);
  --shadow-lg: 0 28px 70px -24px rgba(15, 23, 42, .40);

  --maxw: 1180px;
  --header-h: 68px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* per-SKU accent overrides */
body.accent-red    { --accent: #e41c24; --accent-strong: #c1121a; --accent-soft: #fdecec; }
body.accent-blue   { --accent: #1278c4; --accent-strong: #0d5f9e; --accent-soft: #eaf3fb; }
body.accent-orange { --accent: #ee7e24; --accent-strong: #d4660f; --accent-soft: #fdf0e4; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.015em; margin: 0; font-weight: 750; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), var(--shadow-sm);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px; border-radius: 5px;
  border: 2px solid rgba(255,255,255,.55);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-size: 18px; }
.brand-text small { font-size: 10.5px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav > a,
.nav-drop-toggle {
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  color: var(--muted); border: 0; background: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav > a:hover, .nav-drop-toggle:hover { color: var(--ink); background: var(--soft); }
.nav > a.active { color: var(--ink); }
.nav-drop { position: relative; }
.nav-drop-toggle svg { width: 14px; height: 14px; transition: transform .18s ease; }
.nav-drop.open .nav-drop-toggle svg { transform: rotate(180deg); }
.nav-drop-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 264px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-drop.open .nav-drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drop-menu a {
  display: flex; flex-direction: column; gap: 1px; padding: 11px 14px; border-radius: 9px;
}
.nav-drop-menu a:hover { background: var(--soft); }
.nav-drop-menu a b { font-size: 15px; font-weight: 700; }
.nav-drop-menu a span { font-size: 12.5px; color: var(--faint); font-weight: 550; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; padding: 10px; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 22px; border-radius: var(--radius-sm); font-weight: 750; font-size: 16px;
  border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
  white-space: nowrap; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent-strong); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: #fff; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--faint); background: var(--soft); }
.btn-on-dark { background: #fff; color: var(--band); }
.btn-on-dark:hover { background: #eef2f8; }
.btn-outline-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-on-dark:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn-sm { padding: 10px 16px; font-size: 14.5px; }
.btn-lg { padding: 17px 28px; font-size: 17px; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
section { padding: 84px 0; }
.section-head { max-width: 760px; margin: 0 0 46px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 750;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}
.section-head h2 { font-size: clamp(30px, 4vw, 46px); margin: 0 0 14px; }
.section-head .lede { font-size: 19px; color: var(--muted); max-width: 680px; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: 0; background: linear-gradient(180deg, #fff, var(--soft)); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 72px 0 64px; }
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 { font-size: clamp(40px, 5.2vw, 68px); letter-spacing: -.03em; margin: 0 0 22px; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { font-size: 21px; color: var(--muted); max-width: 560px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 36px; }
.hero-price { font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); margin: 0 0 14px; }
.hero-price small { font-size: 14px; color: var(--muted); font-weight: 600; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 18px 20px; }
.metric b { display: block; font-size: 26px; color: var(--accent); letter-spacing: -.02em; }
.metric span { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 750; letter-spacing: .06em; }

.hero-media { display: grid; place-items: center; }
.hero-media img { max-height: 560px; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(15,23,42,.22)); }

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: #fff; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.card .icon { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.card .icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 20px; margin: 0 0 10px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* --------------------------------------------------------------------------
   Dark band
   -------------------------------------------------------------------------- */
.band { background: radial-gradient(1200px 600px at 20% -10%, var(--band-2), var(--band)); color: var(--band-ink); }
.band .section-head h2 { color: #fff; }
.band .section-head .lede { color: var(--band-muted); }
.band .section-head .eyebrow { color: #fff; opacity: .75; }
.band .card { background: var(--band-card); border-color: var(--band-card-line); }
.band .card:hover { background: rgba(255,255,255,.09); }
.band .card .icon { background: rgba(255,255,255,.1); color: #fff; }
.band .card h3 { color: #fff; }
.band .card p { color: var(--band-muted); }

/* --------------------------------------------------------------------------
   Product cards (homepage)
   -------------------------------------------------------------------------- */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.product-card {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.product-card .flag {
  position: absolute; top: 16px; left: 16px; z-index: 2; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 750; letter-spacing: .04em; color: #fff;
}
.product-card .thumb { padding: 30px 30px 8px; background: #fff; }
.product-card .thumb img { height: 220px; width: 100%; object-fit: contain; }
.product-card .body { padding: 6px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.product-card .kicker { font-size: 12.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.product-card h3 { font-size: 22px; margin: 6px 0 4px; }
.product-card .sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.product-card .specs { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card .specs li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink); }
.product-card .specs li svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.product-card .price { font-size: 13px; color: var(--faint); margin: 0 0 16px; font-weight: 600; }
.product-card .cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* accent chips per card via inline data */
.card-red    { --c: #e41c24; }
.card-blue   { --c: #1278c4; }
.card-orange { --c: #ee7e24; }

/* --------------------------------------------------------------------------
   Gallery + lightbox
   -------------------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #f8fafc; cursor: zoom-in; position: relative; }
.gallery figure img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .3s ease; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figure figcaption { padding: 11px 14px; font-size: 13px; color: var(--muted); background: #fff; border-top: 1px solid var(--line); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(8, 13, 24, .92); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(88vw, 1100px); max-height: 82vh; object-fit: contain; border-radius: 8px; }
.lightbox .lb-caption { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: #cbd5e1; font-size: 14px; }
.lightbox .lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; font-size: 26px; cursor: pointer;
  display: grid; place-items: center; transition: background .15s ease;
}
.lightbox .lb-btn:hover { background: rgba(255,255,255,.22); }
.lightbox .lb-prev { left: 24px; }
.lightbox .lb-next { right: 24px; }
.lightbox .lb-close { position: absolute; top: 24px; right: 24px; width: 46px; height: 46px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 50%; font-size: 22px; cursor: pointer; display: grid; place-items: center; }

/* --------------------------------------------------------------------------
   Specs table (detail page)
   -------------------------------------------------------------------------- */
.specs { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.specs td { padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: 16px; vertical-align: top; }
.specs tr:last-child td { border-bottom: 0; }
.specs td:first-child { width: 36%; color: var(--muted); font-weight: 600; background: #fafbfd; }
.specs td:last-child { color: var(--ink); }

/* --------------------------------------------------------------------------
   Compare table
   -------------------------------------------------------------------------- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.compare-table th, .compare-table td { padding: 18px 22px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15.5px; vertical-align: top; }
.compare-table thead th { position: sticky; top: var(--header-h); z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.compare-table thead th:first-child { width: 22%; }
.compare-table thead th .p-name { font-size: 17px; font-weight: 750; display: block; }
.compare-table thead th .p-res { display: block; font-size: 13px; color: var(--faint); font-weight: 600; margin-top: 2px; }
.compare-table thead th .p-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-bottom: 8px; }
.compare-table .col-260 { --c: #1278c4; }
.compare-table .col-320 { --c: #e41c24; }
.compare-table .col-h38 { --c: #ee7e24; }
.compare-table thead th .p-dot { background: var(--c); }
.compare-table th.row { background: #fafbfd; color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.compare-table td.row-label { color: var(--muted); font-weight: 600; }
.compare-table .featured { background: var(--accent-soft); }
.compare-table .featured td { border-left: 3px solid var(--accent); }
.compare-table .yes { color: var(--ok); font-weight: 700; }
.compare-table .no { color: var(--faint); }
.compare-table tfoot td { border-bottom: 0; padding: 22px; background: #fafbfd; }
.compare-table .c-cta { text-align: center; }

/* --------------------------------------------------------------------------
   Quote form
   -------------------------------------------------------------------------- */
.quote-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 44px; align-items: start; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 650; color: var(--ink); }
.field label .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; font-size: 16px; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--faint); margin-top: 6px; }
.form-status { display: none; margin-top: 20px; padding: 15px 18px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; }
.form-status.ok { display: block; background: #eafaf1; color: var(--ok); border: 1px solid rgba(26,158,92,.3); }
.form-status.err { display: block; background: var(--accent-soft); color: var(--err); border: 1px solid rgba(208,50,60,.25); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.quote-aside h3 { font-size: 22px; margin-bottom: 14px; }
.quote-aside ul { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 14px; }
.quote-aside ul li { display: flex; gap: 12px; font-size: 15.5px; color: var(--muted); }
.quote-aside ul li svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band { background: radial-gradient(900px 500px at 80% -20%, var(--band-2), var(--band)); color: var(--band-ink); }
.cta-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
.cta-band h2 { color: #fff; font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 14px; }
.cta-band p { color: var(--band-muted); font-size: 18px; }
.cta-band .actions { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: #070c16; color: #aeb8c9; padding: 64px 0 0; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand .brand-text small { color: #6b7789; }
.site-footer p.about { color: #7f8a9c; max-width: 300px; line-height: 1.7; }
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.site-footer ul a { color: #aeb8c9; }
.site-footer ul a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #6b7789; font-size: 13px; }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 48px; }
  .hero-media { order: -1; }
  .hero-media img { max-height: 340px; }
  .cta-inner { grid-template-columns: 1fr; }
  .cta-band .actions { justify-content: flex-start; }
  .quote-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px 20px; gap: 4px;
    box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav > a, .nav-drop-toggle { padding: 14px; font-size: 17px; }
  .nav-drop-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 8px; min-width: 0; display: none; }
  .nav-drop.open .nav-drop-menu { display: block; }
  .nav-toggle { display: flex; }
  .header-actions .btn { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .container, .header-inner { padding-left: 20px; padding-right: 20px; }
  section { padding: 60px 0; }
  .grid, .grid-2, .product-grid, .metrics, .gallery, .form-grid { grid-template-columns: 1fr; }
  .gallery figure img { aspect-ratio: auto; }
  .hero-inner { padding-top: 34px; }
  .hero .lead { font-size: 18px; }
  .specs td { padding: 13px 16px; font-size: 15px; }
  .form-card { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .compare-table thead th { top: 0; }
}
