/* Pharmacology v3 — Base layer
 * Reset + layout primitives + type rhythm + utility helpers.
 * Component-level patterns live in components.css.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga", "calt";
  text-wrap: pretty;
  overflow-x: hidden;
  min-height: 100vh;
}

img, video { display: block; max-width: 100%; height: auto; }
img { -webkit-user-drag: none; user-select: none; }
/* SVGs inside buttons / inline UI must stay icon-sized — never expand to fill
   their container even if a width/height attribute is missing. */
svg { display: inline-block; max-width: 100%; flex: none; }
button svg, a svg { width: 1.1em; height: 1.1em; }
.wa-icon { width: 18px; height: 18px; }
.btn--lg .wa-icon { width: 20px; height: 20px; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--gold-deep); }

::selection { background: var(--gold-pale); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Container & section primitives -------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.container--narrow { max-width: var(--container-narrow); }
.container--prose  { max-width: var(--container-prose); }

.section {
  padding-block: var(--section-y);
  position: relative;
}
.section--tight  { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--loose  { padding-block: clamp(5rem, 10vw, 9rem); }
@media (max-width: 720px) {
  .section--loose { padding-block: clamp(3.5rem, 8vw, 5rem); }
}
.section--paper  { background: var(--paper); }
.section--paper-2 { background: var(--paper-2); }
.section--white  { background: var(--white); }
.section--ink    { background: var(--ink); color: var(--paper); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--white); }
.section--ink .lede, .section--ink .body-soft { color: rgba(255,255,255,0.78); }

.section + .section { border-block-start: 0; }
.section--bordered  { border-block-start: 1px solid var(--hair); }
.section--bordered-b { border-block-end: 1px solid var(--hair); }

.hair-divider {
  height: 1px;
  background: var(--hair);
  margin-block: clamp(2rem, 5vw, 4rem);
}

/* --- Headings ------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
}

.display-1 {
  font-size: var(--fs-display-1);
  font-weight: 700;
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
}
.display-2 {
  font-size: var(--fs-display-2);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: var(--tracking-display);
}
h3, .h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
h4, .h4 { font-size: var(--fs-h4); line-height: 1.35; font-weight: 600; }

.display-1 strong,
.display-2 strong {
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, transparent 65%, var(--gold-pale) 65%);
  padding-inline: 0.06em;
}
/* On any dark surface (navy section, cta-strip, hero-full) the pale-mint
   highlight disappears into the background — switch to a brighter mint TEXT
   color with no background. */
.section--ink .display-1 strong,
.section--ink .display-2 strong,
.cta-strip .display-1 strong,
.cta-strip .display-2 strong,
.hero-full-title strong {
  color: var(--mint-soft);
  background: none;
  padding-inline: 0;
}

p { margin: 0; }

/* --- Text utilities ------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-deep);
  margin-block-end: 1rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}
.section--ink .eyebrow { color: var(--gold-soft); }

.lede {
  font-size: var(--fs-lede);
  line-height: var(--lh-lede);
  color: var(--ink-mute);
  font-weight: 400;
  max-width: 38rem;
}
.section--ink .lede { color: rgba(255,255,255,0.82); }

.commit-line {
  font-size: var(--fs-small);
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.commit-line::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(124, 185, 158,0.18);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(47,125,91,0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(47,125,91,0.05); }
}

.body-soft { color: var(--ink-mute); }
.mono { font-variant-numeric: tabular-nums; }

/* Headline section header — eyebrow + h2 + lede block */
.head-block {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-block-end: clamp(2rem, 5vw, 3.4rem);
  max-width: 44rem;
}
.head-block--center { margin-inline: auto; text-align: center; align-items: center; }
.head-block--center .eyebrow { margin-block-end: 0; }

/* --- Helpers -------------------------------------------------- */

.stack > * + * { margin-block-start: var(--stack, 1rem); }
.stack-sm { --stack: 0.5rem; }
.stack-md { --stack: 1rem; }
.stack-lg { --stack: 1.5rem; }
.stack-xl { --stack: 2.25rem; }

.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, 0.75rem); align-items: center; }
.cluster-sm { --cluster-gap: 0.5rem; }
.cluster-md { --cluster-gap: 1rem; }
.cluster-lg { --cluster-gap: 1.5rem; }

.grid { display: grid; gap: var(--grid-gap, 1.5rem); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 880px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.text-center { text-align: center; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

.hidden { display: none !important; }
@media (max-width: 720px) { .hide-on-mobile { display: none !important; } }
@media (min-width: 721px) { .hide-on-desktop { display: none !important; } }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -3rem;
  z-index: var(--z-toast);
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: inset-block-start var(--dur-fast) var(--ease-out);
}
.skip-link:focus { inset-block-start: 1rem; }

/* --- RTL helpers --------------------------------------------- */

.ar-flip { transition: transform var(--dur-fast) var(--ease-out); }
[dir="rtl"] .ar-flip { transform: scaleX(-1); }

/* Latin-only numeric blocks use Inter Tight even in RTL */
.numeric, .mono, .latin {
  font-family: var(--font-latin);
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}

/* --- Reveal-on-scroll system ---------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity calc(var(--dur-slow)) var(--ease-out),
    transform calc(var(--dur-slow)) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--reveal-step));
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
}

/* --- Page-load fade (above-the-fold hero) --------------------- */

.fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: fade-up 0.9s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; animation: none; }
}
