/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; color: var(--text-muted); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
code, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Background telemetry grid, subtle on every theme */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 90%);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 12px 22px; border-radius: var(--radius-s); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-signal { background: var(--signal); color: #012B24; }
.btn-signal:hover { box-shadow: 0 8px 20px -8px var(--signal); }
.btn-ghost { background: transparent; border-color: var(--surface-line); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ============ Nav ============ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand-word .dot { color: var(--signal); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--text-muted);
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); border-bottom-color: var(--signal); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--surface-line); border-radius: var(--radius-s); padding: 8px 10px; }

/* Theme switcher */
.theme-switcher { position: relative; }
.theme-switcher-btn {
  display: flex; align-items: center; gap: 8px; background: var(--bg-sunken);
  border: 1px solid var(--surface-line); border-radius: 999px; padding: 6px 12px; font-size: .85rem; cursor: pointer; color: var(--text);
}
.theme-swatch { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--signal)); }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg-raised);
  border: 1px solid var(--surface-line); border-radius: var(--radius-m); box-shadow: var(--shadow-card);
  padding: 8px; min-width: 190px; display: none; flex-direction: column; gap: 2px;
}
.theme-menu.open { display: flex; }
.theme-menu button {
  display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: none;
  padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; font-size: .88rem; color: var(--text);
}
.theme-menu button:hover { background: var(--bg-sunken); }
.theme-menu .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.theme-menu button[aria-checked="true"] { font-weight: 700; }

/* ============ Hero ============ */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--primary); background: var(--primary-tint);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 var(--signal); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent);} 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.1rem, 3.6vw, 3.2rem); margin-bottom: .4em; }
.hero .lede { font-size: 1.1rem; max-width: 46ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-family: var(--font-display); font-size: 1.5rem; }
.hero-stats div span { font-size: .82rem; color: var(--text-muted); }
.hero-graphic { background: var(--bg-raised); border: 1px solid var(--surface-line); border-radius: var(--radius-l); padding: 18px; box-shadow: var(--shadow-card); }

/* ============ Sections ============ */
.section { padding: 64px 0; }
.section-sunken { background: var(--bg-sunken); }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.tag-label {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--signal); display: inline-block; margin-bottom: 10px;
}

/* ============ Product grid / cards ============ */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.product-card {
  background: var(--bg-raised); border: 1px solid var(--surface-line); border-radius: var(--radius-l);
  padding: 26px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--primary); }
.product-card .icon { width: 46px; height: 46px; color: var(--primary); }
.product-card .card-tag {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em; color: var(--signal);
  background: var(--signal-tint); display: inline-block; padding: 3px 9px; border-radius: 999px; width: fit-content;
}
.product-card h3 { font-size: 1.2rem; margin-bottom: 2px; }
.product-card .card-category { font-size: .8rem; color: var(--text-muted); margin-bottom: 6px; }
.product-card p { font-size: .92rem; margin-bottom: 0; }
.product-card .card-more { margin-top: auto; font-weight: 600; font-size: .88rem; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.product-card:hover .card-more { color: var(--signal); }

/* ============ Value props / feature list ============ */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.value-card { padding: 24px; border-left: 3px solid var(--signal); }
.value-card h3 { font-size: 1.05rem; }
.value-card p { font-size: .92rem; margin: 0; }

/* ============ Product detail page ============ */
.product-hero { padding: 52px 0 20px; border-bottom: 1px solid var(--surface-line); }
.breadcrumb { font-size: .82rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.product-hero-grid { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.spec-download-card {
  background: var(--bg-raised); border: 1px solid var(--surface-line); border-radius: var(--radius-l);
  padding: 24px; box-shadow: var(--shadow-card); position: sticky; top: 92px;
}
.spec-download-card h4 { font-size: .95rem; margin-bottom: 14px; }
.spec-download-card ul { list-style: none; padding: 0; margin: 0 0 18px; font-size: .86rem; }
.spec-download-card li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--surface-line); color: var(--text-muted); }
.spec-download-card li span:last-child { color: var(--text); font-family: var(--font-mono); font-size: .82rem; }
.file-meta { font-size: .78rem; color: var(--text-muted); margin-top: 10px; text-align: center; }

.detail-tabs { display: flex; gap: 6px; margin: 44px 0 22px; border-bottom: 1px solid var(--surface-line); flex-wrap: wrap; }
.detail-tabs button {
  background: none; border: none; padding: 10px 6px; margin-right: 18px; font-weight: 600; font-size: .92rem;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.detail-tabs button.active, .detail-tabs button:hover { color: var(--text); border-bottom-color: var(--signal); }
.detail-panel { display: none; }
.detail-panel.active { display: block; }
.feature-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 24px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.feature-list li svg { flex-shrink: 0; color: var(--signal); margin-top: 3px; }

.spec-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 24px; }
.spec-table th { text-align: left; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--surface-line); }
.spec-table td { padding: 12px 14px; border-bottom: 1px solid var(--surface-line); vertical-align: top; }
.spec-table td.spec-id { font-family: var(--font-mono); color: var(--primary); white-space: nowrap; font-size: .85rem; }
.interface-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.interface-chips span { font-family: var(--font-mono); font-size: .8rem; background: var(--primary-tint); color: var(--primary); padding: 5px 11px; border-radius: 999px; }

/* ============ Forms ============ */
.form-card {
  max-width: 620px; margin: 0 auto; background: var(--bg-raised); border: 1px solid var(--surface-line);
  border-radius: var(--radius-l); padding: 36px; box-shadow: var(--shadow-card);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-s); border: 1px solid var(--surface-line);
  background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: .95rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: .84rem; color: var(--text-muted); }
.checkbox-row input { width: auto; margin-top: 3px; }
.alert { padding: 12px 16px; border-radius: var(--radius-s); font-size: .88rem; margin-bottom: 18px; }
.alert-error { background: color-mix(in srgb, var(--warn) 14%, var(--bg-raised)); border: 1px solid var(--warn); color: var(--warn); }
.alert-success { background: var(--signal-tint); border: 1px solid var(--signal); color: color-mix(in srgb, var(--signal) 60%, black); }

/* ============ Admin ============ */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: var(--bg-sunken); border-right: 1px solid var(--surface-line); padding: 24px 18px; }
.admin-side a { display: block; padding: 10px 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--text-muted); font-size: .9rem; margin-bottom: 4px; }
.admin-side a.active, .admin-side a:hover { background: var(--primary-tint); color: var(--primary); }
.admin-main { padding: 30px 34px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: var(--bg-raised); border: 1px solid var(--surface-line); border-radius: var(--radius-m); padding: 18px; }
.kpi-card span { font-size: .8rem; color: var(--text-muted); }
.kpi-card strong { display: block; font-family: var(--font-display); font-size: 1.7rem; margin-top: 4px; }
.data-table-wrap { background: var(--bg-raised); border: 1px solid var(--surface-line); border-radius: var(--radius-m); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { text-align: left; background: var(--bg-sunken); padding: 12px 16px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--surface-line); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--surface-line); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-sunken); }
.badge { font-size: .74rem; padding: 3px 9px; border-radius: 999px; background: var(--signal-tint); color: color-mix(in srgb, var(--signal) 55%, black); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 260px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px; font-size: .85rem; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.current {
  min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s); text-decoration: none; color: var(--text); border: 1px solid transparent;
}
.pagination a:hover { border-color: var(--surface-line); }
.pagination span.current { background: var(--primary); color: #fff; }

/* ============ Privacy page ============ */
.legal-body h2 { margin-top: 2em; font-size: 1.3rem; }
.legal-body h3 { font-size: 1.05rem; margin-top: 1.4em; }
.legal-body ul { color: var(--text-muted); }
.reg-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 18px 0; }
.reg-table th, .reg-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--surface-line); }
.reg-table th { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; color: var(--text-muted); }
.toc { background: var(--bg-sunken); border-radius: var(--radius-m); padding: 20px 24px; margin-bottom: 30px; }
.toc a { display: block; padding: 4px 0; font-size: .9rem; color: var(--primary); text-decoration: none; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--surface-line); padding: 48px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid a { text-decoration: none; color: var(--text-muted); font-size: .9rem; line-height: 2; }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--surface-line); font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .product-hero-grid { grid-template-columns: 1fr; }
  .spec-download-card { position: static; }
  .product-grid, .value-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--surface-line); }
}
@media (max-width: 680px) {
  .nav-links { position: fixed; top: 62px; left: 0; right: 0; background: var(--bg-raised); flex-direction: column;
    padding: 18px 24px; border-bottom: 1px solid var(--surface-line); display: none; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .product-grid, .value-grid, .form-row, .feature-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 24px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
}
