/*
Theme Name: Elemental Purity Labs
Theme URI: https://elementalpuritylabs.com
Author: Elemental Purity Labs
Description: Bespoke theme for an analytical testing laboratory. Includes a certificate-of-analysis post type with public verification by ID or QR code, a multi-sample quote request form, and a contact form, all wired to the WordPress REST API.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: elemental-purity-labs
Tags: one-column, custom-menu, custom-logo, translation-ready
*/

/* =========================================================
   Elemental Purity Labs — Design System
   Brand: Navy #0A1933 / Medium Blue #3D78A8 / Light Blue #A7CEE0
   Type: Montserrat (display) · Open Sans (body) · IBM Plex Mono (data)
   ========================================================= */

:root {
  /* Brand */
  --navy:        #0A1933;
  --navy-700:    #142644;
  --navy-500:    #23385C;
  --blue:        #3D78A8;
  --blue-600:    #336890;
  --blue-light:  #A7CEE0;
  --tint:        #F1F6FA;
  --paper:       #F8FBFF;
  --white:       #FFFFFF;

  /* Semantic (COA pass/fail — lab report vernacular) */
  --pass:        #128C6E;
  --pass-bg:     #E6F5F1;
  --warn:        #B7791F;
  --warn-bg:     #FBF3E4;
  --fail:        #B4283C;
  --fail-bg:     #FBEAEC;

  /* Neutrals */
  --ink:         #0A1933;
  --ink-muted:   #56688A;
  --ink-faint:   #8A9AB4;
  --line:        #DCE6EF;
  --line-soft:   #EAF1F7;

  /* Type */
  --display: 'Montserrat', system-ui, -apple-system, sans-serif;
  --body:    'Open Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Space & shape */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(10,25,51,.06), 0 2px 8px rgba(10,25,51,.05);
  --shadow-md: 0 2px 4px rgba(10,25,51,.05), 0 12px 32px rgba(10,25,51,.09);
  --shadow-lg: 0 4px 8px rgba(10,25,51,.06), 0 24px 64px rgba(10,25,51,.14);
  --wrap: 1180px;
  --header-h: 76px;
  --gutter: 24px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: var(--navy);
}
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); letter-spacing: -0.01em; }
h4 { font-size: 1.02rem; font-weight: 700; letter-spacing: 0; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--blue-light);
  flex: none;
}
.eyebrow--center { justify-content: center; }
.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 62ch;
}
.mono { font-family: var(--mono); }
.center { text-align: center; }
.measure { max-width: 68ch; }
.measure-center { max-width: 68ch; margin-inline: auto; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 880px; }
.section { padding: clamp(64px, 8vw, 108px) 0; }
.section--tight { padding: clamp(48px, 5vw, 72px) 0; }
.section--tint { background: var(--tint); }
.section--paper { background: var(--paper); }
.section--navy { background: var(--navy); color: rgba(255,255,255,.82); }
.section--navy h2, .section--navy h3, .section--navy h4 { color: var(--white); }
.section--navy .lede { color: rgba(255,255,255,.72); }
.section--navy .eyebrow { color: var(--blue-light); }
.section--navy .eyebrow::before { background: rgba(167,206,224,.5); }
.section-head { margin-bottom: clamp(32px, 4vw, 52px); }
.section-head--center { text-align: center; }
.section-head--center .lede { margin-inline: auto; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-split { grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-split { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: .93rem;
  letter-spacing: .01em;
  padding: .85rem 1.6rem;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--navy); color: var(--white); }
.btn--primary:hover { background: var(--navy-500); box-shadow: var(--shadow-md); }
.btn--accent { background: var(--blue); color: var(--white); }
.btn--accent:hover { background: var(--blue-600); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy); background: var(--white); }
.btn--onnavy { background: var(--white); color: var(--navy); }
.btn--onnavy:hover { background: var(--blue-light); }
.btn--outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.32); }
.btn--outline-light:hover { border-color: var(--white); background: rgba(255,255,255,.08); }
.btn--lg { padding: 1.05rem 2rem; font-size: 1rem; }
.btn--sm { padding: .55rem 1rem; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}
.brand { display: block; flex: none; line-height: 0; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img, .brand .brand-img {
  width: clamp(108px, 13vw, 148px);
  height: auto;
  max-width: 100%;
  display: block;
}
.brand--footer img, .brand--footer .brand-img { width: clamp(132px, 17vw, 186px); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li { list-style: none; margin: 0; }
.nav a {
  font-family: var(--display);
  font-weight: 600;
  font-size: .88rem;
  color: var(--navy);
  padding: .5rem .8rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav a:hover { background: var(--tint); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: 14px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: .5rem .7rem;
  cursor: pointer;
  color: var(--navy);
}
@media (max-width: 1020px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700; font-size: .85rem; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 22px;
    box-shadow: var(--shadow-md);
    display: none;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .nav[data-open="true"] { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav a { display: block; padding: .8rem .2rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .nav a[aria-current="page"] { box-shadow: none; }
  .header-actions { margin: 14px 0 0; flex-direction: column; align-items: stretch; }
  .header-actions .btn { width: 100%; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: rgba(255,255,255,.8);
  padding: clamp(72px, 9vw, 128px) 0 clamp(64px, 8vw, 104px);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 380px at 78% 18%, rgba(61,120,168,.34), transparent 68%),
    radial-gradient(520px 340px at 6% 92%, rgba(167,206,224,.12), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { color: var(--white); max-width: 15ch; }
.hero h1 .hl { color: var(--blue-light); }
.hero-lede { color: rgba(255,255,255,.76); font-size: clamp(1.05rem, 1.6vw, 1.24rem); max-width: 52ch; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(36px, 5vw, 64px); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

/* Signature element: live HPLC chromatogram */
.chromo {
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(167,206,224,.22);
  border-radius: var(--r-lg);
  padding: 18px 18px 14px;
  backdrop-filter: blur(4px);
}
.chromo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 10px;
}
.chromo svg { width: 100%; height: auto; }
.chromo-trace {
  fill: none;
  stroke: var(--blue-light);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: trace 3.4s cubic-bezier(.4,.1,.2,1) .35s forwards;
}
.chromo-fill { fill: rgba(167,206,224,.14); opacity: 0; animation: fadein .9s ease 2.6s forwards; }
.chromo-axis { stroke: rgba(167,206,224,.22); stroke-width: 1; }
.chromo-label { font-family: var(--mono); font-size: 8px; fill: rgba(167,206,224,.75); letter-spacing: .08em; }
.chromo-peaklabel { font-family: var(--mono); font-size: 8.5px; fill: #fff; letter-spacing: .06em; opacity: 0; animation: fadein .6s ease 2.9s forwards; }
.chromo-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: .68rem;
  color: rgba(255,255,255,.6);
  border-top: 1px solid rgba(167,206,224,.18);
  padding-top: 10px;
  margin-top: 4px;
}
.chromo-foot b { color: var(--white); font-weight: 600; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .chromo-trace { stroke-dashoffset: 0; }
  .chromo-fill, .chromo-peaklabel { opacity: 1; }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(167,206,224,.2);
  border: 1px solid rgba(167,206,224,.2);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: clamp(40px, 5vw, 64px);
  position: relative;
  z-index: 2;
}
.hero-stats > div { background: var(--navy); padding: 22px 20px; }
.hero-stats dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-light); margin-bottom: 6px; }
.hero-stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 1.9rem); color: var(--white); letter-spacing: -.02em; }
.hero-stats small { display: block; font-family: var(--body); font-weight: 400; font-size: .78rem; color: rgba(255,255,255,.55); letter-spacing: 0; margin-top: 4px; }
@media (max-width: 780px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card--hover:hover { border-color: var(--blue-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { margin-bottom: .45em; }
.card p { color: var(--ink-muted); font-size: .95rem; }
.card-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--tint);
  color: var(--blue);
  margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }
.card-meta {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

/* Method list */
.method {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.method:last-child { border-bottom: 1px solid var(--line); }
.method-code {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--blue);
  padding-top: .3rem;
}
.method h3 { margin-bottom: .35em; }
.method p { color: var(--ink-muted); margin-bottom: .7em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .6rem;
  border-radius: 100px;
  background: var(--tint);
  color: var(--ink-muted);
  border: 1px solid var(--line);
}
@media (max-width: 640px) { .method { grid-template-columns: 1fr; gap: 10px; } }

/* Packages */
.pkg {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px;
  position: relative;
}
.pkg--featured { border-color: var(--navy); border-width: 2px; box-shadow: var(--shadow-md); }
.pkg-flag {
  position: absolute;
  top: -12px; left: 30px;
  background: var(--navy);
  color: var(--white);
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: 100px;
}
.pkg-name { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--navy); margin-bottom: .3rem; }
.pkg-price { font-family: var(--display); font-weight: 800; font-size: 2.2rem; letter-spacing: -.03em; color: var(--navy); }
.pkg-price small { font-family: var(--body); font-weight: 400; font-size: .85rem; color: var(--ink-faint); letter-spacing: 0; }
.pkg-note { font-size: .88rem; color: var(--ink-muted); margin: .6rem 0 1.4rem; }
.checklist { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 11px; }
.checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 11px; font-size: .93rem; color: var(--ink-muted); line-height: 1.45; }
.checklist li::before {
  content: "";
  width: 16px; height: 16px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--pass-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23128C6E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.4l3 3 6-6.5'/%3E%3C/svg%3E") center/12px no-repeat;
}
.checklist li.is-off { color: var(--ink-faint); }
.checklist li.is-off::before {
  background: var(--line-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' stroke='%238A9AB4' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4.5 8h7'/%3E%3C/svg%3E") center/12px no-repeat;
}
.pkg .btn { margin-top: auto; }

/* Steps (real sequence — numbering is meaningful) */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--blue);
}
.step h4 { margin-bottom: .3em; font-size: 1.08rem; font-family: var(--display); }
.step p { color: var(--ink-muted); font-size: .95rem; margin: 0; }
.section--navy .step { border-color: rgba(167,206,224,.2); }
.section--navy .step p { color: rgba(255,255,255,.7); }
.section--navy .step::before { color: var(--blue-light); }

/* ---------- Verify / COA ---------- */
.verify-bar {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.verify-bar input {
  border: 0;
  background: transparent;
  padding: .95rem 1rem;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  width: 100%;
}
.verify-bar input::placeholder { color: var(--ink-faint); letter-spacing: .04em; }
.verify-bar input:focus { outline: none; }
.verify-bar:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,120,168,.16), var(--shadow-md); }
.icon-btn {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--navy);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--blue-light); border-color: var(--blue-light); }
.icon-btn svg { width: 21px; height: 21px; }
@media (max-width: 560px) {
  .verify-bar { grid-template-columns: 1fr auto; }
  .verify-bar .btn { grid-column: 1 / -1; }
}
.verify-hint { font-size: .85rem; color: var(--ink-muted); margin-top: 12px; }
.verify-hint code {
  font-family: var(--mono);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .1rem .4rem;
  font-size: .85em;
  color: var(--navy);
  cursor: pointer;
}
.verify-hint code:hover { background: var(--blue-light); }

.coa {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.coa-top {
  background: var(--navy);
  color: var(--white);
  padding: 26px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.coa-id { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .1em; color: var(--blue-light); }
.coa-body { padding: 30px; }
.coa-status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .45rem .9rem;
  border-radius: 100px;
}
.coa-status--pass { background: var(--pass-bg); color: var(--pass); }
.coa-status--fail { background: var(--fail-bg); color: var(--fail); }
.coa-status--warn { background: var(--warn-bg); color: var(--warn); }
.coa-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; margin: 24px 0; }
.dl > div { background: var(--white); padding: 16px 18px; }
.dl dt { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.dl dd { margin: 0; font-weight: 600; font-size: .95rem; color: var(--navy); word-break: break-word; }
@media (max-width: 860px) { .dl { grid-template-columns: repeat(2, 1fr); } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
table.data th {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 12px 18px;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink-muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data td:first-child { color: var(--navy); font-weight: 600; }
table.data .num { font-family: var(--mono); color: var(--navy); }
.pill { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: .18rem .55rem; border-radius: 100px; }
.pill--pass { background: var(--pass-bg); color: var(--pass); }
.pill--fail { background: var(--fail-bg); color: var(--fail); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }

.coa-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 30px;
  border-top: 1px solid var(--line);
  background: var(--tint);
}
.coa-qr { display: flex; align-items: center; gap: 14px; }
.coa-qr canvas, .coa-qr img { width: 84px; height: 84px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 5px; }
.coa-qr p { font-size: .8rem; color: var(--ink-muted); margin: 0; max-width: 30ch; }

.empty-state, .error-state {
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  padding: clamp(32px, 5vw, 56px);
  text-align: center;
  background: var(--white);
}
.error-state { border-style: solid; border-color: #F0C6CD; background: var(--fail-bg); }
.error-state h3 { color: var(--fail); }
.empty-state p, .error-state p { color: var(--ink-muted); max-width: 46ch; margin-inline: auto; }
.is-hidden { display: none !important; }

.scanner {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--navy);
  margin-top: 18px;
}
.scanner video { width: 100%; max-height: 380px; object-fit: cover; display: block; }
.scanner-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: rgba(255,255,255,.8); font-family: var(--mono); font-size: .75rem; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
}
fieldset { border: 0; padding: 0; margin: 0 0 36px; }
fieldset:last-of-type { margin-bottom: 24px; }
legend {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
  padding: 0;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: .7rem;
}
legend span {
  font-family: var(--mono);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--blue);
}
.fieldset-note { font-size: .9rem; color: var(--ink-muted); margin: 0 0 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field-grid--3 { grid-template-columns: repeat(3, 1fr); }
.field-full { grid-column: 1 / -1; }
@media (max-width: 700px) { .field-grid, .field-grid--3 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--display);
  font-weight: 600;
  font-size: .85rem;
  color: var(--navy);
  letter-spacing: .01em;
}
.field .req { color: var(--fail); }
.field .help { font-size: .8rem; color: var(--ink-faint); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: .95rem;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: .72rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2356688A' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 15px;
  padding-right: 2.4rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(61,120,168,.15);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--fail);
  background: var(--fail-bg);
}
.field .err { font-size: .8rem; color: var(--fail); font-weight: 600; min-height: 0; }
.field .err:empty { display: none; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.choice {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px 16px 46px;
  cursor: pointer;
  display: block;
  transition: border-color .15s ease, background-color .15s ease;
}
.choice:hover { border-color: var(--blue-light); }
.choice input { position: absolute; left: 16px; top: 20px; accent-color: var(--blue); width: 17px; height: 17px; }
.choice strong { display: block; font-family: var(--display); font-size: .95rem; color: var(--navy); margin-bottom: 2px; }
.choice span { font-size: .84rem; color: var(--ink-muted); line-height: 1.45; display: block; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--tint); }
.choice:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }

.check-row { display: flex; gap: 11px; align-items: flex-start; font-size: .9rem; color: var(--ink-muted); }
.check-row input { margin-top: 4px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; }

/* Repeating sample rows */
.sample-row {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  background: var(--tint);
  margin-bottom: 14px;
}
.sample-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sample-row-head h4 { margin: 0; font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.link-btn {
  background: none; border: 0; padding: 0;
  font-family: var(--display); font-weight: 600; font-size: .82rem;
  color: var(--fail); cursor: pointer; text-decoration: underline;
}
.link-btn--neutral { color: var(--blue-600); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.form-status { font-size: .9rem; font-weight: 600; }
.form-status--error { color: var(--fail); }
.form-status--ok { color: var(--pass); }

.form-success {
  border: 1px solid var(--pass);
  background: var(--pass-bg);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 44px);
  text-align: center;
}
.form-success h3 { color: var(--pass); }
.form-success .ref { font-family: var(--mono); font-size: 1.1rem; letter-spacing: .08em; color: var(--navy); }

/* Aside / summary */
.sticky-side { position: sticky; top: calc(var(--header-h) + 20px); }
.summary-card {
  background: var(--navy);
  color: rgba(255,255,255,.78);
  border-radius: var(--r-lg);
  padding: 26px;
}
.summary-card h3 { color: var(--white); font-size: 1.1rem; }
.summary-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; font-size: .9rem; }
.summary-list li { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(167,206,224,.18); padding-bottom: 12px; }
.summary-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-list b { color: var(--white); font-weight: 600; text-align: right; }

/* ---------- Misc blocks ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.stat-row--3 { grid-template-columns: repeat(3, 1fr); }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 3.4vw, 2.6rem); letter-spacing: -.03em; color: var(--navy); line-height: 1; }
.stat span { font-size: .88rem; color: var(--ink-muted); display: block; margin-top: 8px; }
@media (max-width: 760px) { .stat-row, .stat-row--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .stat-row, .stat-row--3 { grid-template-columns: 1fr; } }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 44px 22px 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.03rem;
  color: var(--navy);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 8px; top: 20px;
  font-family: var(--mono); font-size: 1.4rem; font-weight: 400; color: var(--blue);
  transition: transform .2s ease;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 44px 22px 0; color: var(--ink-muted); font-size: .95rem; }

.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.info-list { min-width: 0; }
.info-list > div, .info-list p, .info-list a { min-width: 0; overflow-wrap: anywhere; }
.info-list dt, .info-list b {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--blue); display: block; margin-bottom: 5px;
}
.info-list a { color: var(--navy); font-weight: 600; }
.info-list p { margin: 0; color: var(--ink-muted); font-size: .95rem; }

.cta-band { background: var(--navy); color: rgba(255,255,255,.78); border-radius: var(--r-lg); padding: clamp(34px, 5vw, 56px); text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band .btn-row { justify-content: center; margin-top: 26px; }

.notice {
  border-left: 3px solid var(--blue-light);
  background: var(--tint);
  padding: 18px 22px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: .92rem;
  color: var(--ink-muted);
}

/* ---------- Page header (interior pages) ---------- */
.page-head {
  background: var(--navy);
  color: rgba(255,255,255,.78);
  padding: clamp(56px, 7vw, 92px) 0 clamp(48px, 6vw, 76px);
  position: relative;
  overflow: hidden;
}
.page-head::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(680px 320px at 82% 10%, rgba(61,120,168,.32), transparent 70%);
  pointer-events: none;
}
.page-head .wrap { position: relative; z-index: 2; }
.page-head h1 { color: var(--white); max-width: 20ch; }
.page-head .lede { color: rgba(255,255,255,.74); }
.page-head .eyebrow { color: var(--blue-light); }
.page-head .eyebrow::before { background: rgba(167,206,224,.45); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.6); padding: clamp(52px, 6vw, 76px) 0 32px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, .85fr) 1.15fr; gap: 34px; }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-about { margin-top: 18px; max-width: 34ch; line-height: 1.6; }
.footer-col h4 {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--blue-light); margin-bottom: 14px; font-weight: 500;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: rgba(255,255,255,.7); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 46px; padding-top: 22px;
  border-top: 1px solid rgba(167,206,224,.16);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: .82rem; color: rgba(255,255,255,.45);
}
.footer-bottom a { color: rgba(255,255,255,.55); }

.disclaimer {
  background: var(--navy-700);
  color: rgba(255,255,255,.55);
  font-size: .8rem;
  line-height: 1.6;
  padding: 18px 0;
  border-top: 1px solid rgba(167,206,224,.14);
}

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 var(--r-md) 0;
  font-family: var(--display); font-weight: 700; font-size: .9rem;
}
.skip:focus { left: 0; }

/* Print — COA pages should print clean */
@media print {
  .site-header, .site-footer, .disclaimer, .no-print { display: none !important; }
  body { background: #fff; }
  .coa { box-shadow: none; border-color: #999; }
}

/* ---------- Two-column form layouts ---------- */
/* Grid items default to min-width:auto, which lets a wide child stretch the
   whole page. min-width:0 is what keeps forms inside the viewport. */
.layout-aside > * { min-width: 0; }
.grid > *, .grid-split > * { min-width: 0; }

.layout-aside {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 980px) {
  .layout-aside { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}

/* ---------- Two-column form layouts ---------- */
/* Grid items default to min-width:auto, which lets a wide child stretch the
   whole page. min-width:0 is what keeps forms inside the viewport. */
.layout-aside > * { min-width: 0; }
.grid > *, .grid-split > * { min-width: 0; }

.layout-aside {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 980px) {
  .layout-aside { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}

/* ---------- WordPress integration ---------- */
.nav .current-menu-item > a,
.nav .current_page_item > a {
  color: var(--blue);
  box-shadow: inset 0 -2px 0 var(--blue);
  border-radius: 0;
}
@media (max-width: 1020px) {
  .nav .current-menu-item > a,
  .nav .current_page_item > a { box-shadow: none; }
}

.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content ul, .entry-content ol { color: var(--ink-muted); padding-left: 1.3em; }
.entry-content li { margin-bottom: .5em; }
.entry-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--blue-light);
  color: var(--ink-muted);
  font-style: normal;
}
.entry-content img { border-radius: var(--r-md); height: auto; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.entry-content th, .entry-content td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.entry-content code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .1rem .4rem;
}

.wp-block-button__link { border-radius: var(--r-md); background: var(--navy); font-family: var(--display); font-weight: 700; }
.alignwide, .alignfull { margin-inline: auto; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--mono);
  font-size: .85rem;
}
.nav-links .page-numbers {
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--navy);
  text-decoration: none;
}
.nav-links .page-numbers.current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* WordPress admin bar offset for the sticky header */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* ---------- Technique chips ---------- */
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  position: relative;
  z-index: 2;
}
.chips li {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-light);
  border: 1px solid rgba(167,206,224,.28);
  border-radius: 100px;
  padding: .38rem .8rem;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .chips li { font-size: .64rem; padding: .32rem .65rem; letter-spacing: .06em; }
}

/* ---------- Certificate: who it was issued to ---------- */
.coa-client {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 1.4em;
  padding: 12px 16px;
  background: var(--tint);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.coa-client span {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.coa-client b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  color: var(--navy);
}
.coa-client em {
  font-family: var(--mono);
  font-style: normal;
  font-size: .78rem;
  color: var(--blue);
}

/* ---------- Very small screens (320px and under) ---------- */
@media (max-width: 400px) {
  :root { --gutter: 16px; }

  /* Long button labels must be allowed to wrap rather than push the page wide */
  .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    overflow-wrap: anywhere;   /* long email addresses in CTAs */
    max-width: 100%;
  }
  .btn--lg { padding: .9rem 1.2rem; }

  .form-card { padding: 20px 16px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice { padding: 14px 14px 14px 42px; }
  .sample-row { padding: 16px 14px; }
  .coa-body, .coa-top, .coa-foot { padding-left: 18px; padding-right: 18px; }
  .dl { grid-template-columns: 1fr; }
  .coa-client { padding: 10px 12px; }
  .coa-client b { font-size: 1.02rem; }
  .verify-bar { padding: 8px; }
  .verify-bar input { padding: .8rem .6rem; font-size: .92rem; }
  .hero-stats > div { padding: 18px 14px; }
  .section-head h2, .page-head h1 { overflow-wrap: break-word; }
  legend { flex-wrap: wrap; }
}

/* Two-up definition grid, used when a certificate has only formula + mass */
.dl--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .dl--2 { grid-template-columns: 1fr; } }
.verify-hint code.is-static { cursor: default; }
.verify-hint code.is-static:hover { background: var(--tint); }

/* ---------- Certificate awaiting analysis ---------- */
.coa-status--draft { background: var(--tint); color: var(--ink-muted); }
.coa-draft {
  display: grid;
  gap: 4px;
  margin: 0 0 1.4em;
  padding: 14px 18px;
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.coa-draft b { font-family: var(--display); font-size: .98rem; color: #8A5A11; }
.coa-draft span { font-size: .88rem; color: var(--ink-muted); line-height: 1.5; }
