/*
Theme Name: KB Analytical
Theme URI: https://kbanalytical.com
Author: KB Analytical
Description: Clinical-minimal theme for KB Analytical — an independent peptide-testing lab. Includes a verifiable Certificate-of-Analysis registry (custom post type) and email order/contact forms. No page builder or WooCommerce required.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kb-analytical
*/

/* ============================================================
   KB Analytical — clinical-minimal design system
   ============================================================ */

:root {
  /* Palette */
  --ink:        #0b1220;
  --ink-2:      #1e2a3a;
  --text:       #33465b;
  --muted:      #64788d;
  --line:       #e3ecf3;
  --line-2:     #eef3f8;
  --bg:         #ffffff;
  --bg-soft:    #f6f9fc;
  --bg-soft-2:  #eef4f9;

  --brand:      #0891b2;   /* lab teal */
  --brand-deep: #0e7490;
  --brand-tint: #e6f6fa;
  --accent:     #2563eb;

  --pass:       #16a34a;
  --pass-tint:  #e8f6ee;
  --warn:       #d97706;
  --warn-tint:  #fdf3e5;
  --fail:       #dc2626;
  --fail-tint:  #fbeaea;

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Menlo", monospace;

  /* Shape */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15,30,50,.06), 0 1px 3px rgba(15,30,50,.05);
  --shadow:    0 10px 30px -12px rgba(14,50,80,.18);
  --shadow-lg: 0 24px 60px -20px rgba(14,50,80,.28);

  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand); }
img, svg { max-width: 100%; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-deep);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brand); border-radius: 2px; }

.muted { color: var(--muted); }
.lead  { font-size: 1.18rem; color: var(--text); }
.center { text-align: center; }
.mono { font-family: var(--mono); }

section { padding: 84px 0; }
section.tight { padding: 56px 0; }
.soft { background: var(--bg-soft); }
.dark {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(8,145,178,.22), transparent 60%),
    linear-gradient(180deg, #0b1220, #0e1b28);
  color: #c7d6e2;
}
.dark h1, .dark h2, .dark h3 { color: #fff; }
.dark .muted { color: #91a6ba; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--sans); font-weight: 600; font-size: .98rem;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(8,145,178,.7); }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.24); }
.btn-light:hover { background: rgba(255,255,255,.18); color:#fff; }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-size: 1.12rem; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand small { display:block; font-size:.62rem; letter-spacing:.18em; text-transform:uppercase; color:var(--muted); font-weight:600; margin-top:1px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: .96rem; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { background: var(--bg-soft); color: var(--brand-deep); }
.nav-links a.active { color: var(--brand-deep); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display:none; margin-left:auto; background:none; border:1px solid var(--line); border-radius:8px; width:42px; height:38px; cursor:pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display:block; position:relative; width:18px; height:2px; background:var(--ink); margin:0 auto; border-radius:2px; }
.nav-toggle span::before, .nav-toggle span::after { content:""; position:absolute; left:0; }
.nav-toggle span::before { top:-6px; } .nav-toggle span::after { top:6px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px; gap: 2px;
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-cta { margin: 8px 0 0; }
}

/* ---------- Hero ---------- */
.hero { padding: 92px 0 72px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { margin-top: 14px; }
.hero p.lead { max-width: 30em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-trust { display:flex; gap:26px; flex-wrap:wrap; margin-top:34px; padding-top:26px; border-top:1px solid var(--line); }
.hero-trust .t { }
.hero-trust .t b { display:block; font-size:1.5rem; color:var(--ink); letter-spacing:-.02em; }
.hero-trust .t span { font-size:.85rem; color:var(--muted); }
@media (max-width: 900px){ .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px){ .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .25s ease, border-color .2s;
}
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfe4ec; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-deep); margin-bottom: 16px;
}
.card h3 { margin-bottom: .35em; }
.card p { margin: 0; font-size: .96rem; }

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: 10px; font-size: 1.08rem; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 20px; }
.steps.cols { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .steps.cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .steps.cols { grid-template-columns: 1fr; } }
.step { position: relative; padding: 26px 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 700; font-family: var(--mono); font-size: .95rem; margin-bottom: 14px;
}
.step h3 { font-size: 1.08rem; }
.step p { margin: 0; font-size: .94rem; }

/* ---------- Pricing table ---------- */
.pricebar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:26px; }
.chip {
  border: 1px solid var(--line); background:#fff; color: var(--ink-2); border-radius: 999px;
  padding: 8px 16px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chip.active { background: var(--ink); color:#fff; border-color: var(--ink); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
table.price { width: 100%; border-collapse: collapse; min-width: 640px; background:#fff; }
table.price th, table.price td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line-2); }
table.price thead th { background: var(--bg-soft); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
table.price tbody tr:last-child td { border-bottom: none; }
table.price tbody tr:hover { background: #fafcfe; }
table.price .name { color: var(--ink); font-weight: 600; }
table.price .desc { font-size: .86rem; color: var(--muted); }
table.price .price { font-family: var(--mono); font-weight: 600; color: var(--ink); white-space: nowrap; }
.tag { display:inline-block; font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:3px 8px; border-radius:6px; vertical-align:middle; margin-left:6px; }
.tag.hplc { background: var(--brand-tint); color: var(--brand-deep); }
.tag.ms { background: #ece9fd; color:#5b46d6; }
.tag.quant { background: var(--pass-tint); color: var(--pass); }

/* ---------- Verify / COA ---------- */
.verify-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 30px; max-width: 620px; margin: 0 auto;
}
.search {
  display: flex; gap: 10px; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 20px;
  transition: border-color .2s, box-shadow .2s; background:#fff;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.search input { flex: 1; border: none; outline: none; font-size: 1.05rem; font-family: var(--mono); letter-spacing: .02em; color: var(--ink); background: transparent; }
.search input::placeholder { color: #9db1c2; font-family: var(--sans); letter-spacing: 0; }

.result { margin-top: 26px; }
.coa {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm);
}
.coa-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding: 22px 26px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.coa-head .id { font-family: var(--mono); font-size: .92rem; color: var(--muted); }
.coa-head h3 { margin: 4px 0 0; }
.badge {
  display:inline-flex; align-items:center; gap:7px; font-weight:700; font-size:.82rem;
  padding: 7px 14px; border-radius: 999px; white-space:nowrap;
}
.badge.pass { background: var(--pass-tint); color: var(--pass); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.fail { background: var(--fail-tint); color: var(--fail); }
.badge .dot { width:8px; height:8px; border-radius:50%; background: currentColor; }

.coa-body { padding: 26px; display: grid; grid-template-columns: 1.3fr .7fr; gap: 26px; }
@media (max-width: 640px){ .coa-body { grid-template-columns: 1fr; } }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: .95rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.metric { background: var(--bg-soft); border:1px solid var(--line-2); border-radius: var(--r); padding: 16px; text-align:center; }
.metric b { display:block; font-size: 2rem; letter-spacing:-.02em; color: var(--ink); font-family: var(--mono); }
.metric span { font-size:.8rem; color: var(--muted); text-transform: uppercase; letter-spacing:.08em; }
.metric.ok b { color: var(--pass); }

.qr { width: 128px; height: 128px; border-radius: 12px; border: 1px solid var(--line); padding: 8px; background:#fff; }
.qr-wrap { text-align:center; }
.qr-wrap small { display:block; color: var(--muted); margin-top:8px; font-family: var(--mono); font-size:.78rem; }

.chromo { width:100%; height: 120px; border:1px solid var(--line-2); border-radius: var(--r); background: var(--bg-soft); margin-top: 6px; }

.notice { padding: 16px 20px; border-radius: var(--r); font-size: .95rem; margin-top: 22px; display:flex; gap:12px; align-items:flex-start; }
.notice.err { background: var(--fail-tint); color: #a01d1d; }
.notice.info { background: var(--brand-tint); color: var(--brand-deep); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display:block; font-weight:600; color: var(--ink-2); font-size:.92rem; margin-bottom:6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size:.85rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--sans); font-size: 1rem; color: var(--ink); background:#fff; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.field textarea { min-height: 96px; resize: vertical; }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px){ .form-grid { grid-template-columns: 1fr; } }

.summary-card { background: var(--bg-soft); border:1px solid var(--line); border-radius: var(--r-lg); padding: 24px; position: sticky; top: 90px; }
.summary-row { display:flex; justify-content:space-between; padding: 10px 0; border-bottom:1px dashed var(--line); font-size:.95rem; }
.summary-row:last-of-type { border-bottom:none; }
.summary-total { display:flex; justify-content:space-between; align-items:baseline; margin-top:14px; padding-top:14px; border-top:2px solid var(--line); }
.summary-total b { font-size:1.6rem; font-family: var(--mono); color: var(--ink); }

/* ---------- Logos / trust strip ---------- */
.trust-strip { display:flex; flex-wrap:wrap; gap: 14px 34px; align-items:center; justify-content:center; opacity:.85; }
.trust-strip .item { display:flex; align-items:center; gap:8px; color: var(--muted); font-weight:600; font-size:.92rem; }

.stat-band { display:grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border:1px solid var(--line); border-radius: var(--r-lg); overflow:hidden; }
@media (max-width:640px){ .stat-band { grid-template-columns:1fr 1fr; } }
.stat-band .s { background:#fff; padding: 28px 20px; text-align:center; }
.stat-band .s b { display:block; font-size: 2.1rem; color: var(--ink); font-family: var(--mono); letter-spacing:-.02em; }
.stat-band .s span { font-size:.85rem; color: var(--muted); }
.dark .stat-band { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.dark .stat-band .s { background: rgba(255,255,255,.03); }
.dark .stat-band .s b { color:#fff; }
.dark .stat-band .s span { color: #91a6ba; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; color: var(--ink); display:flex; justify-content:space-between; gap:16px; }
.faq summary::-webkit-details-marker { display:none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 18px; margin: 0; color: var(--text); }

/* ---------- CTA band ---------- */
.cta-band { border-radius: var(--r-lg); padding: 54px; text-align:center; }
.cta-band h2 { color:#fff; }
.cta-band p { max-width: 40em; margin: 10px auto 26px; }

/* ---------- Footer ---------- */
.site-footer { background: #0b1220; color: #9fb2c4; padding: 60px 0 30px; margin-top: 20px; }
.footer-grid { display:grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.site-footer .brand { color:#fff; }
.site-footer .brand small { color:#7f93a8; }
.site-footer h4 { color:#fff; font-size:.82rem; letter-spacing:.1em; text-transform:uppercase; margin-bottom:14px; }
.site-footer a { color:#9fb2c4; display:block; padding:5px 0; font-size:.94rem; }
.site-footer a:hover { color:#fff; }
.footer-bottom { border-top:1px solid rgba(255,255,255,.1); margin-top:40px; padding-top:22px; display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; font-size:.85rem; color:#7f93a8; }
.footer-note { max-width: 34em; font-size:.9rem; line-height:1.6; }

/* ---------- Misc ---------- */
.reveal { opacity:0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity:1; transform:none; }
.pill { display:inline-flex; align-items:center; gap:7px; background: var(--pass-tint); color: var(--pass); font-weight:600; font-size:.85rem; padding:6px 13px; border-radius:999px; }
hr.sep { border:none; border-top:1px solid var(--line); margin: 0; }
.kbd { font-family: var(--mono); background: var(--bg-soft); border:1px solid var(--line); border-radius:6px; padding:2px 7px; font-size:.85rem; color: var(--ink-2); }
