/* ============================================================================
   ALPHA PEPTIDES — DESIGN TOKENS + PRIMITIVES
   Measured off alpha-peptides.com (source-cdp/design-tokens.json,
   inline/apex-sitewide-css.css). Every value below is the source's.

   Load order: ap-tokens.css -> ap-chrome.css -> ap-card.css -> ap-home.css
   ========================================================================= */

/* ---------- Self-hosted Outfit (variable, 300-900) ------------------------
   The source loads Outfit from fonts.googleapis.com; we self-host the same
   variable font files (v15) so there is no third-party request. */
@font-face {
	font-family: 'Outfit';
	font-style: normal;
	font-weight: 300 900;
	font-display: swap;
	src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Outfit';
	font-style: normal;
	font-weight: 300 900;
	font-display: swap;
	src: url('../fonts/outfit-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Palette / scale ---------------------------------------------- */
:root {
	--ap-bg:        #FFFFFF;
	--ap-cream:     #F4F6FA;
	--ap-cream-2:   #ECEFF6;
	--ap-line:      #E2E6ED;
	--ap-line-2:    #C7CDD8;
	--ap-ink:       #0B1322;
	--ap-ink-2:     #3A4458;
	--ap-ink-3:     #6E7890;
	--ap-ink-4:     #9AA6BD;
	--ap-dark:      #070F1E;
	--ap-dark-2:    #0C1828;
	--ap-dark-3:    #16243A;
	--ap-dark-line: rgba(255,255,255,0.08);
	--ap-dark-ink:  #F2F5FA;
	--ap-dark-ink-2:#9AA6BD;
	--ap-blue:      #2563EB;
	--ap-blue-2:    #1D4ED8;
	--ap-blue-grad: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
	--ap-green:     #1FAB57;
	--ap-green-2:   #16933F;
	--ap-green-3:   #2DD968;
	--ap-sage:      #BFD8C8;
	--ap-sage-2:    #7FB69E;
	--ap-sky:       #DCE9F7;
	--ap-shadow:    0 12px 36px rgba(7,15,30,0.08);
	--ap-radius:    14px;
	--ap-gut:       clamp(20px, 4vw, 56px);
	--ap-max:       1280px;
	--ap-hdr-h:     72px;
	--ap-font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	/* ap-chrome.js writes the measured promo-bar height here at runtime. The
	   source ships 0px and lets JS raise it, which costs a 39px jump on first
	   paint; we seed the measured value instead so the header never shifts.
	   Desktop promo = 12.5px * 1.65 + 18 = 39; phone (<=768, slim bar) =
	   10.5px * 1.65 + 8 = 26. */
	--ap-promo-h: 39px;
	--ap-fixed-header-offset: calc(var(--ap-promo-h) + 94px);
}
@media (max-width: 768px) {
	:root { --ap-promo-h: 26px; }
}

html { scroll-padding-top: var(--ap-fixed-header-offset); }

/* ---------- Base ---------------------------------------------------------- */
body.ap-stg {
	font-family: var(--ap-font);
	background: var(--ap-bg);
	color: var(--ap-ink);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
body.ap-stg * { box-sizing: border-box; }
body.ap-stg img { max-width: 100%; height: auto; }
body.ap-stg a { color: #2872FA; }

/* The source sets --ap-hdr-h to 92px sitewide (header pill height). */
body.ap-stg,
body.ap-stg .ap-hdr { --ap-hdr-h: 92px; }

/* Headings inherit a 1.5 line-height, not the body's 1.65 (the source gets this
   from Blocksy's heading typography). Measured: with 1.65 the dark Process
   section came out +3px at 1440 and +10px at 390 — one unstyled h3 per column;
   1.5 lands both widths exactly on the source's 699 / 1201. Any .ap-* heading
   class that declares its own line-height still wins (higher specificity). */
body.ap-stg h1,
body.ap-stg h2,
body.ap-stg h3,
body.ap-stg h4,
body.ap-stg h5,
body.ap-stg h6 { line-height: 1.5; }

/* ---------- Typography primitives ---------------------------------------- */
body.ap-stg .ap-h1,
body.ap-stg .ap-h2,
body.ap-stg .ap-h3 {
	font-family: var(--ap-font);
	margin: 0;
	color: var(--ap-ink);
	letter-spacing: -0.025em;
}
body.ap-stg .ap-h1 { font-weight: 800; font-size: clamp(40px, 5.6vw, 84px); line-height: 1.02; color: var(--ap-dark-ink); }
body.ap-stg .ap-h2 { font-weight: 800; font-size: clamp(30px, 4vw, 52px); line-height: 1.06; }
body.ap-stg .ap-h2-sub { font-weight: 600; color: var(--ap-ink-2); }
body.ap-stg .ap-h2--light { color: var(--ap-dark-ink); }
body.ap-stg .ap-h2--light .ap-h2-sub { color: var(--ap-dark-ink-2); }

body.ap-stg .ap-eyebrow {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ap-ink-3);
	margin-bottom: 14px;
}
body.ap-stg .ap-eyebrow--light { color: var(--ap-dark-ink-2); }

body.ap-stg .ap-grad {
	background: linear-gradient(135deg, var(--ap-green) 0%, #2DD968 60%, #4FE883 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

body.ap-stg .ap-lede {
	font-size: clamp(16px, 1.3vw, 18px);
	color: var(--ap-ink-2);
	line-height: 1.55;
	max-width: 540px;
	margin: 0 0 28px;
}
body.ap-stg .ap-body { font-size: 16px; color: var(--ap-ink-2); line-height: 1.6; margin: 0 0 18px; max-width: 560px; }
body.ap-stg .ap-body--light { color: var(--ap-dark-ink-2); }

body.ap-stg .ap-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ap-blue);
	font-weight: 600;
	font-size: 14.5px;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}
body.ap-stg .ap-link:hover { color: var(--ap-blue-2); }
body.ap-stg .ap-arrow { display: inline-block; transition: transform .15s ease; }
body.ap-stg a:hover .ap-arrow { transform: translateX(3px); }

/* ---------- Layout utility ----------------------------------------------- */
body.ap-stg .ap-wrap {
	max-width: var(--ap-max);
	margin: 0 auto;
	padding-left: var(--ap-gut);
	padding-right: var(--ap-gut);
}

/* ---------- Buttons ------------------------------------------------------- */
body.ap-stg .ap-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 26px;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	font-size: 15.5px;
	text-decoration: none !important;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
body.ap-stg .ap-btn--primary {
	background: var(--ap-blue-grad);
	color: #fff !important;
	box-shadow: 0 12px 28px rgba(37,99,235,0.34), inset 0 1px 0 rgba(255,255,255,0.22);
}
body.ap-stg .ap-btn--primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 36px rgba(37,99,235,0.40), inset 0 1px 0 rgba(255,255,255,0.24);
}
body.ap-stg .ap-btn--ghost {
	background: transparent;
	color: var(--ap-ink) !important;
	border-color: var(--ap-line-2);
}
body.ap-stg .ap-btn--ghost:hover { background: var(--ap-cream); border-color: var(--ap-ink); }
body.ap-stg .ap-btn--dark { background: var(--ap-ink); color: var(--ap-bg) !important; }
body.ap-stg .ap-btn--dark:hover { background: var(--ap-dark-2); }
body.ap-stg .ap-btn--ghost-light {
	background: transparent;
	color: var(--ap-dark-ink) !important;
	border-color: rgba(242,245,250,0.45);
}
body.ap-stg .ap-btn--ghost-light:hover { background: rgba(242,245,250,0.10); border-color: var(--ap-dark-ink); }
body.ap-stg .ap-cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- Badges -------------------------------------------------------- */
body.ap-stg .ap-badge-sale {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: var(--ap-blue);
	color: #fff;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 6px;
}
body.ap-stg .ap-badge-best {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: #0B1322;
	color: #fff;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.06em;
	border-radius: 6px;
}

/* ---------- Generic card / list primitives (source design system) --------- */
body.ap-stg .ap-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--ap-bg);
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	overflow: hidden;
	text-decoration: none !important;
	color: var(--ap-ink) !important;
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body.ap-stg .ap-card:hover {
	transform: translateY(-4px);
	border-color: var(--ap-ink);
	box-shadow: 0 18px 40px rgba(7,15,30,0.12);
}
body.ap-stg .ap-card__img {
	aspect-ratio: 1 / 1;
	background:
		radial-gradient(ellipse at 50% 100%, rgba(31,171,87,0.06), transparent 60%),
		linear-gradient(180deg, #FAFBFC 0%, #ECEFF6 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}
body.ap-stg .ap-card__img img { max-width: 80%; max-height: 80%; object-fit: contain; }
body.ap-stg .ap-card__info {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	padding: 18px 22px;
	border-top: 1px solid var(--ap-line);
}
body.ap-stg .ap-card__name { font-weight: 700; font-size: 16px; letter-spacing: -0.005em; }
body.ap-stg .ap-card__price { font-weight: 700; font-size: 17px; color: var(--ap-ink); }
body.ap-stg .ap-card__price-old {
	display: inline-block;
	margin-right: 6px;
	color: var(--ap-ink-3);
	font-weight: 500;
	font-size: 14px;
	text-decoration: line-through;
}
body.ap-stg .ap-card__sale {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	padding: 5px 10px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
	border-radius: 4px;
	box-shadow: 0 6px 14px rgba(220,38,38,0.32), inset 0 1px 0 rgba(255,255,255,0.22);
}

body.ap-stg .ap-tests {
	list-style: none;
	padding: 0;
	margin: 0;
	background: var(--ap-bg);
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	overflow: hidden;
}
body.ap-stg .ap-tests li {
	display: grid;
	grid-template-columns: 60px 1fr;
	gap: 20px;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid var(--ap-line);
	transition: background .2s ease;
}
body.ap-stg .ap-tests li:last-child { border-bottom: 0; }
body.ap-stg .ap-tests li:hover { background: var(--ap-cream); }
body.ap-stg .ap-tests__num { font-size: 22px; font-weight: 800; color: var(--ap-green); letter-spacing: -0.02em; }
body.ap-stg .ap-tests b { display: block; color: var(--ap-ink); font-size: 16px; font-weight: 700; margin-bottom: 2px; }
body.ap-stg .ap-tests em { display: block; font-style: normal; color: var(--ap-ink-3); font-size: 13px; }

body.ap-stg .ap-spec {
	background: var(--ap-cream);
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	padding: 8px 24px;
	margin: 0;
}
body.ap-stg .ap-spec > div {
	display: grid;
	grid-template-columns: 150px 1fr;
	align-items: center;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--ap-line);
}
body.ap-stg .ap-spec > div:last-child { border-bottom: 0; }
body.ap-stg .ap-spec dt {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ap-ink-3);
	margin: 0;
}
body.ap-stg .ap-spec dd { margin: 0; font-weight: 600; font-size: 15px; color: var(--ap-ink); }
@media (max-width: 600px) {
	body.ap-stg .ap-spec > div { grid-template-columns: 110px 1fr; }

	/*
	 * Fixed-header offset at phone widths.
	 *
	 * The source pins `--ap-fixed-header-offset: 82px` below 600px. Ours derived it from
	 * `calc(var(--ap-promo-h) + 94px)`, and --ap-promo-h only steps down at <=768 — so at 390
	 * we computed 26 + 94 = 120px against the source's ~84px, a +36px offset on EVERY page.
	 * Found by tuju-shop while measuring archives; the cause is here, not in the archives.
	 */
	:root { --ap-fixed-header-offset: 82px; }
}

/* ---------- Prose (page / post / SEO zone) -------------------------------- */
body.ap-stg .ap-prose { color: var(--ap-ink-2); font-size: 16px; line-height: 1.75; }
body.ap-stg .ap-prose h2 {
	font-family: var(--ap-font);
	font-weight: 800;
	font-size: clamp(26px, 3.2vw, 38px);
	line-height: 1.12;
	letter-spacing: -0.02em;
	color: var(--ap-ink);
	margin: 0 0 16px;
}
body.ap-stg .ap-prose h3 {
	font-family: var(--ap-font);
	font-weight: 800;
	font-size: 18px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--ap-ink);
	margin: 28px 0 10px;
}
body.ap-stg .ap-prose p { margin: 0 0 16px; }
body.ap-stg .ap-prose p:last-child { margin-bottom: 0; }
body.ap-stg .ap-prose a { color: var(--ap-blue); text-decoration: underline; text-underline-offset: 3px; }
body.ap-stg .ap-prose strong { color: var(--ap-ink); font-weight: 700; }
body.ap-stg .ap-prose ul,
body.ap-stg .ap-prose ol { margin: 0 0 16px; padding-left: 20px; }
body.ap-stg .ap-prose li { margin: 0 0 6px; }

/* ---------- Generic page / post shells (P8 / P9 restyle these) ----------- */
body.ap-stg .ap-page,
body.ap-stg .ap-post { padding: clamp(28px, 4vw, 56px) 0 clamp(48px, 7vw, 96px); }
body.ap-stg .ap-page__head,
body.ap-stg .ap-post__head { margin-bottom: clamp(18px, 2.4vw, 28px); }
body.ap-stg .ap-page__head .ap-h2,
body.ap-stg .ap-post__head .ap-h2 { font-size: clamp(30px, 3.6vw, 44px); }

/* ---------- Shared animation --------------------------------------------- */
@keyframes apPulse {
	0%   { box-shadow: 0 0 0 0   rgba(31,171,87,0.45); }
	70%  { box-shadow: 0 0 0 10px rgba(31,171,87,0); }
	100% { box-shadow: 0 0 0 0   rgba(31,171,87,0); }
}
