/*
Theme Name: CORE LABS
Theme URI: https://corelabs.group
Description: Premium biotech storefront theme for CORE LABS. Matte black surfaces, restrained purple accent, condensed industrial headings. Built for WooCommerce.
Author: CORE LABS
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: corelabs
Tags: e-commerce, dark, custom-colors
WC requires at least: 8.0
*/

/* ============================================================
   CORE LABS design tokens
   Ported from the reference build so colour, type, spacing and
   motion stay identical across the two implementations.
   ============================================================ */

:root {
  /* Matte black surface ramp */
  /* CORE LABS surfaces — matte, slightly violet-cast near-black rather than
     neutral grey, so the ground agrees with the vial photography. */
  --ink-950: #08070B;   /* page */
  --ink-900: #111015;   /* card */
  --ink-800: #17151C;   /* elevated card, inputs */
  --ink-700: #201D28;
  --ink-600: #2A2536;
  --ink-500: #3A3348;
  --deep-purple: #2B173F;
  --glow-purple: rgba(123, 63, 178, 0.20);
  --border-purple: rgba(155, 93, 229, 0.20);

  /* Interactive purple — buttons, links, focus. Brighter than the brand
     tone on purpose: measured contrast, not taste. */
  /* Measured, not chosen by eye. White on --ui-500 is 6.57:1, so it carries
     button fills. --ui-400 is only 4.13:1 under white, so it is an ACCENT —
     icons, borders, hover states, text on dark (4.87:1) — never a fill behind
     body-sized white text. */
  --ui-500: #7B3FB2;   /* primary fill  — white on it 6.57:1 */
  --ui-400: #9B5DE5;   /* bright accent — 4.87:1 on the page ground */
  --ui-600: #5E2F88;   /* pressed */
  --ui-ring: #B98CF0;  /* focus ring */

  /* Minimum comfortable tap target. Apple and Google both say 44. */
  --tap: 44px;
  --tap-lg: 52px;      /* primary actions on mobile */

  /*
   * READING MEASURE — one number for the whole site.
   *
   * In `ch`, deliberately. A measure in px has to be re-tuned at every
   * breakpoint and drifts apart between phone and desktop; a measure in ch is
   * the same NUMBER OF CHARACTERS at every width and at every font size, so
   * one declaration covers both and cannot disagree with itself. Below about
   * 700px the viewport is already narrower than 62ch, so it simply never
   * binds on a phone — mobile keeps the layout it has, desktop stops sprawling.
   *
   * Any run of reading text gets `max-width: var(--measure)` and
   * `margin-inline: auto`. Short labels, headings and UI chrome do not.
   */
  --measure: 62ch;

  /* Brand purple — accent only, never a background wash */
  --accent-300: #A99CC6;
  --accent-400: #8763B0;
  --accent-500: #6A3E99;
  --accent-600: #5B3486;
  --accent-700: #4C2975;

  /* Type ramp */
  --mist-50:  #F5F3F7;
  --mist-100: #E6E2EB;
  --mist-300: #C9C3D2;
  --mist-400: #B0A9BD;
  --mist-500: #968FA4;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Display was Barlow Condensed. A condensed face set in caps at 40px+ is
     what makes a page read as a template: the letterforms crowd, the counters
     close up, and nothing looks deliberate. Space Grotesk is wide, technical
     and drawn for large sizes — it carries a lab brand without shouting. */
  /* One family for the whole site. Space Grotesk was a display face doing
     body work: at 9.5-12px its counters closed up and small text read as cheap.
     Plus Jakarta Sans carries headings and holds together at 11px. */
  /* 2026-09-21 (Noah): Poppins headings + DM Sans body — Plus Jakarta read as stock. */
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --transition: 180ms ease-out;
  --container: 1360px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink-950);
  color: var(--mist-300);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Ground texture ----------
   Flat #0A0A0A is what "template" looks like. Two fixed layers sit behind
   everything: a faint fractal-noise tile so large dark areas have grain
   instead of banding, and a wide purple bloom off the top so the page has a
   light source. Both are pointer-transparent and cost no requests. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(124, 58, 237, 0.16) 0%, rgba(124, 58, 237, 0.05) 38%, transparent 68%),
    radial-gradient(70% 50% at 85% 8%, rgba(139, 92, 246, 0.07) 0%, transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  /* Caps need air, not compression. Tracking opens as size drops. */
  letter-spacing: -0.005em;
  /*
   * 1.04 was set when these were all-caps, where there are no descenders to
   * collide. They render sentence case now, so a heading that wraps — "Batch
   * Traceability", "Documentation before hype." — put the descenders of one
   * line into the ascenders of the next.
   *
   * 1.26 is measured, not chosen: Plus Jakarta Sans reports a content area of
   * exactly 1.26em at every weight (400/600/700/800), so that is the point at
   * which consecutive lines stop overlapping at all. Anything below it leaves
   * ink in the next line's space — 1.04 cost 5.9px at 28px, 1.15 still cost
   * 2.8px. Do not tighten this without re-measuring the font.
   */
  line-height: 1.26;
  color: var(--mist-50);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); letter-spacing: -0.015em; }
h3 { font-size: 1.3rem; letter-spacing: 0.005em; }
h4 { font-size: 1.05rem; letter-spacing: 0.02em; }

/*
 * Small headings sit close to body size and wrap sooner, so they get a little
 * more than the 1.26 floor rather than a display setting.
 */
h3, h4 { line-height: 1.3; }

a { color: var(--accent-300); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-400); }

::selection { background: rgba(106, 62, 153, 0.4); color: var(--mist-50); }

:focus-visible {
  outline: 2px solid var(--accent-400);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

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

@media (min-width: 1024px) { .container { padding: 0 40px; } }

/* ---------- Research-use banner ---------- */
.cl-ruo-bar {
  background: var(--accent-700);
  color: #E2DBEE;
  text-align: center;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

/* ---------- Header ---------- */
.cl-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-700);
}

.cl-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.cl-logo { display: flex; align-items: center; gap: 12px; }
.cl-logo img { height: 40px; width: auto; }

.cl-nav { display: none; gap: 28px; }
@media (min-width: 1024px) { .cl-nav { display: flex; } }

.cl-nav a {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mist-400);
}
.cl-nav a:hover, .cl-nav .current-menu-item > a { color: var(--mist-50); }

.cl-header__icons { display: flex; align-items: center; gap: 4px; }

.cl-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  border: 0;
  background: none;
  color: var(--mist-300);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.cl-icon-btn:hover { background: var(--ink-800); color: var(--mist-50); }

/* ---------- Buttons ---------- */
.cl-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 14px 30px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ui-500);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  cursor: pointer;
  /* Transform and shadow are cheap to animate; background alone felt inert. */
  transition: background var(--transition), transform 90ms ease,
              box-shadow var(--transition);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
  -webkit-tap-highlight-color: transparent;
}

/* Primary actions get a taller target where thumbs are least accurate. */
@media (max-width: 782px) {
  .cl-btn,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button,
  .woocommerce a.button.alt,
  .woocommerce button.button.alt { min-height: var(--tap-lg); font-size: 15px; }
}

.cl-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
  background: var(--ui-400);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
}

/* Pressed: colour recedes and the button sinks, so a tap feels physical. */
.cl-btn:active,
.woocommerce a.button:active,
.woocommerce button.button:active,
.woocommerce input.button:active,
.woocommerce #respond input#submit:active,
.woocommerce a.button.alt:active,
.woocommerce button.button.alt:active {
  background: var(--ui-600);
  transform: translateY(0) scale(0.985);
  box-shadow: none;
}

/* Keyboard focus. Offset so the ring clears the button rather than hugging it. */
.cl-btn:focus-visible,
.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible,
.woocommerce input.button:focus-visible,
.woocommerce a.button.alt:focus-visible,
.woocommerce button.button.alt:focus-visible {
  outline: 3px solid var(--ui-ring);
  outline-offset: 3px;
}

/* Respect a reduced-motion preference — keep the colour change, drop the move. */
@media (prefers-reduced-motion: reduce) {
  .cl-btn, .woocommerce a.button, .woocommerce button.button,
  .woocommerce input.button, .woocommerce a.button.alt,
  .woocommerce button.button.alt { transition: background var(--transition); }
  .cl-btn:hover, .woocommerce a.button:hover,
  .woocommerce button.button:hover { transform: none; }
}

.cl-btn--secondary {
  background: transparent;
  border: 1px solid rgba(106, 62, 153, 0.6);
  color: var(--mist-50);
}
.cl-btn--secondary:hover {
  background: rgba(106, 62, 153, 0.1);
  border-color: var(--accent-400);
}

.woocommerce .button.disabled,
.woocommerce button.button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Badges ---------- */
.cl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--ink-500);
  border-radius: var(--radius-sm);
  background: var(--ink-700);
  color: var(--mist-400);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.cl-badge--accent {
  border-color: rgba(106, 62, 153, 0.5);
  background: rgba(106, 62, 153, 0.1);
  color: var(--accent-300);
}
.cl-badge--warn {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: #FCD34D;
}
