/*
 * Buddy theme styles. Tokens live in theme.json; this file only uses their variables.
 * No hex values here (site-style skill). Motion only inside prefers-reduced-motion: no-preference.
 */

/* ---------- base ---------- */
html { scroll-padding-top: 6rem; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--secondary); color: var(--wp--preset--color--contrast); }
:where(h1, h2, h3) { text-wrap: balance; }
:where(p) { text-wrap: pretty; }

a { text-decoration-color: var(--wp--preset--color--primary); text-decoration-thickness: 0.12em; text-underline-offset: 0.18em; }
:where(.is-style-section-dark, .is-style-section-dark-2) a { text-decoration-color: currentColor; }

:where(a, button, input, select, textarea, summary, .wp-element-button):focus-visible {
	outline: 3px solid var(--wp--preset--color--contrast);
	outline-offset: 3px;
	border-radius: 4px;
}
:where(.is-style-section-dark, .is-style-section-dark-2) :where(a, button, .wp-element-button):focus-visible {
	outline-color: var(--wp--preset--color--secondary);
}

.wp-element-button, .wp-block-button__link {
	transition: background-color var(--wp--custom--motion--fast) ease, transform var(--wp--custom--motion--fast) ease, box-shadow var(--wp--custom--motion--fast) ease;
}


/* ---------- header ---------- */
/* Sticky header: stick the template-part wrapper (the inner group has no room to stick inside it). */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: var(--wp--custom--z--header);
}
.buddy-header { border-bottom: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast); }
/* Header row: menu | logo (centered) | Subscribe. */
.buddy-header-row {
	display: grid !important;
	grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}
.buddy-header-row > * { margin: 0 !important; }
.buddy-header-row > .buddy-nav { justify-self: start; }
.buddy-header-row > .buddy-header-cta { justify-self: end; }
.buddy-header-cta .wp-block-button__link { white-space: nowrap; }
.buddy-header .buddy-header-logo {
	justify-self: center;
	font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
	line-height: 1;
}
.buddy-announcement { font-family: var(--wp--preset--font-family--heading); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- paragraph styles ---------- */
/* Die-cut label: use sparingly (max one per section). */
p.is-style-label {
	--chip: var(--wp--preset--color--secondary);
	display: inline-block;
	width: fit-content;
	padding: 0.45em 0.75em;
	background: var(--chip);
	color: var(--wp--preset--color--contrast);
	border: var(--wp--custom--ink--width-thin) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	box-shadow: var(--wp--preset--shadow--ink-sm);
	transform: rotate(-2deg);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 0.75rem;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
p.is-style-label.has-primary-background-color { --chip: var(--wp--preset--color--primary); }
p.is-style-label.has-white-background-color { --chip: var(--wp--preset--color--white); }

/* Highlighter swash: use sparingly (max one per section). */
.is-style-swash, mark.buddy-swash {
	position: relative;
	z-index: 0;
	display: inline-block;
	background: none;
	color: inherit;
	padding-inline: 0.2em;
}
.is-style-swash::before, mark.buddy-swash::before {
	content: "";
	position: absolute;
	inset: 0.05em -0.2em -0.02em;
	z-index: -1;
	background: var(--wp--preset--color--secondary);
	transform: rotate(-1.5deg);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M6 8 C46 3 112 7 195 3 C199 13 198 26 193 35 C141 39 72 33 7 38 C1 29 3 18 6 8Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M6 8 C46 3 112 7 195 3 C199 13 198 26 193 35 C141 39 72 33 7 38 C1 29 3 18 6 8Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
:where(.is-style-section-secondary) :is(.is-style-swash, mark.buddy-swash)::before { background: var(--wp--preset--color--white); }

.is-style-splash {
	font-family: var(--wp--preset--font-family--splash);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1;
	transform: rotate(-6deg);
	width: fit-content;
}

/* Marquee band: the text holds the sequence twice, so scrolling by half loops seamlessly.
   It starts full (nothing hidden off-screen), pauses on hover, and stays still under reduced motion. */
.is-style-marquee {
	width: max-content;
	white-space: nowrap;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0;
}
@media (prefers-reduced-motion: no-preference) {
	.is-style-marquee { animation: buddy-marquee 45s linear infinite; }
	.buddy-marquee-band:hover .is-style-marquee { animation-play-state: paused; }
	@keyframes buddy-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
}
.buddy-marquee-band { overflow: hidden; border-block: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast); }

/* ---------- headings ---------- */
.wp-block-heading.is-style-slab {
	display: inline-block;
	width: fit-content;
	padding: 0.12em 0.32em 0.18em;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--contrast);
	box-shadow: 8px 8px 0 var(--wp--preset--color--secondary);
	transform: rotate(-3deg);
}

/* ---------- images ---------- */
.wp-block-image.is-style-ink img {
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--ink);
}
.wp-block-image.is-style-blob img {
	border: 4px solid var(--wp--preset--color--contrast);
	border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
	aspect-ratio: 1;
	object-fit: cover;
}
@media (prefers-reduced-motion: no-preference) {
	.wp-block-image.is-style-blob img { animation: buddy-morph 10s ease-in-out infinite; }
	@keyframes buddy-morph {
		0%, 100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
		50% { border-radius: 63% 37% 36% 64% / 56% 64% 36% 44%; }
	}
}
.wp-block-image img { height: auto; }

/* ---------- groups ---------- */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--white);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--ink);
}
.wp-block-group.is-style-halftone {
	background-image: radial-gradient(circle at 2px 2px, var(--wp--preset--color--contrast-2) 1.4px, transparent 1.6px);
	background-size: 10px 10px;
}

/* ---------- inked art (buddy/art block) ---------- */
.buddy-art { display: block; line-height: 0; box-sizing: border-box; }
.buddy-art svg { width: 100%; height: auto; overflow: visible; }
.buddy-sticker-wrap { position: relative; }
.buddy-sticker {
	position: absolute;
	z-index: var(--wp--custom--z--sticker);
	width: clamp(96px, 16vw, 170px);
	pointer-events: none;
}
.buddy-sticker--top-left { top: -2.5rem; left: -2rem; }
.buddy-sticker--bottom-right { bottom: -2.5rem; right: -1.5rem; }
@media (max-width: 781px) {
	.buddy-sticker { width: 96px; }
	.buddy-sticker--top-left { top: -1.5rem; left: -0.5rem; }
	.buddy-sticker--bottom-right { bottom: -1.5rem; right: -0.5rem; }
}

/* ---------- cards & steps ---------- */
.buddy-price { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--xx-large); line-height: 1; }
.buddy-price small { font-family: var(--wp--preset--font-family--heading); font-size: var(--wp--preset--font-size--medium); font-weight: 600; }
.wp-block-group.is-style-card.buddy-plan--featured { box-shadow: 8px 8px 0 var(--wp--preset--color--primary); }

/* ---------- footer ---------- */
.buddy-wave { display: block; line-height: 0; margin-bottom: -1px; }
.buddy-wave svg { display: block; width: 100%; height: clamp(36px, 6vw, 72px); overflow: visible; }
.buddy-wordmark {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(3.5rem, 8.5vw, 8rem);
	line-height: 1;
	letter-spacing: -0.03em;
	margin: 0;
	padding-bottom: 0.08em;
	white-space: nowrap;
}
.buddy-wordmark a { color: var(--wp--preset--color--primary); text-decoration: none; }
.buddy-footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--wp--preset--spacing--30); }
.buddy-footer-brand .buddy-socials { margin-top: 0 !important; display: grid !important; grid-template-columns: repeat(2, auto); }
@media (min-width: 782px) {
	.buddy-footer-brand { flex-direction: row; align-items: center; gap: var(--wp--preset--spacing--40); }
}
.buddy-footer a { text-decoration: none; }
.buddy-footer a:hover { text-decoration: underline; }
.buddy-footer .wp-block-heading { font-family: var(--wp--preset--font-family--heading); font-size: var(--wp--preset--font-size--small); letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--secondary); }

/* ---------- print ---------- */
@media print {
	.buddy-header, .buddy-marquee-band, .buddy-footer, .buddy-sticker { display: none !important; }
	body { background: none; color: var(--wp--preset--color--contrast); }
}

/* footer link lists and swash text on colored sections */
.buddy-footer .wp-block-list { list-style: none; padding-left: 0; display: grid; gap: 0.4rem; }
mark.buddy-swash, .is-style-swash { color: var(--wp--preset--color--contrast); }

/* ======================================================================
 * PHONES FIRST (≤781px). 95%+ of visitors are on phones, so this is the
 * primary layout. Core block CSS is desktop-shaped, so these rules
 * override it below the core 782px breakpoint.
 * ====================================================================== */

/* Mobile menu overlay: full-screen, brand colors, big tap targets (all widths). */
.buddy-nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--base) !important;
	padding: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--40)) max(16px, var(--wp--preset--spacing--40)) var(--wp--preset--spacing--50) !important;
}
.buddy-nav .is-menu-open .wp-block-navigation__responsive-container-content,
.buddy-nav .is-menu-open .wp-block-navigation__container {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	width: 100%;
}
.buddy-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: var(--wp--preset--spacing--50); }
.buddy-nav .is-menu-open .wp-block-navigation__container { gap: var(--wp--preset--spacing--30); }
.buddy-nav .is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--x-large);
	color: var(--wp--preset--color--base) !important;
	padding-block: 0.15em;
}
.buddy-nav .is-menu-open .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--primary) !important; }
.buddy-nav .wp-block-navigation__responsive-container-open,
.buddy-nav .wp-block-navigation__responsive-container-close {
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
}
@media (max-width: 599px) {
	.buddy-nav .wp-block-navigation__responsive-container-open { display: inline-flex; }
}
/* Menu button: a tilted mint die-cut sticker with three wobbly ink lines; wiggles on hover/tap. */
.buddy-nav .wp-block-navigation__responsive-container-open {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--contrast);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	box-shadow: var(--wp--preset--shadow--ink-sm);
	transform: rotate(-2deg);
}
.buddy-nav .wp-block-navigation__responsive-container-open svg { display: none; }
.buddy-nav .wp-block-navigation__responsive-container-open::before {
	content: "";
	width: 30px;
	height: 30px;
	background: var(--wp--preset--color--contrast);
	-webkit-mask: url("../svg/menu-lines.svg") center / contain no-repeat;
	mask: url("../svg/menu-lines.svg") center / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
	.buddy-nav .wp-block-navigation__responsive-container-open:hover,
	.buddy-nav .wp-block-navigation__responsive-container-open:focus-visible,
	.buddy-nav .wp-block-navigation__responsive-container-open:active { animation: buddy-wiggle 450ms ease-in-out; }
	@keyframes buddy-wiggle {
		0%, 100% { transform: rotate(-2deg); }
		25% { transform: rotate(5deg) scale(1.05); }
		50% { transform: rotate(-6deg); }
		75% { transform: rotate(2deg); }
	}
}
.buddy-nav .wp-block-navigation__responsive-container-open svg,
.buddy-nav .wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; }

@media (max-width: 781px) {
	/* Header: menu left, logo center, Subscribe right (grid above). */
	.buddy-header-cta .wp-block-button__link { padding: 0.6em 0.55em; letter-spacing: 0.02em; font-size: 0.7rem; }
	.buddy-header .buddy-header-logo { font-size: 1.85rem; }

	/* Buttons in content: full width, at least 48px tall. */
	main .wp-block-buttons { flex-direction: column; align-items: stretch; }
	main .wp-block-button { width: 100%; }
	main .wp-block-button__link {
		width: 100%;
		min-height: 48px;
		display: flex;
		align-items: center;
		justify-content: center;
		text-align: center;
	}

	/* Swipeable rows: full-bleed, snap to cards, next card peeks in. */
	body .buddy-swipe {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: var(--wp--preset--spacing--30) !important;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--wp--style--root--padding-left);
		margin-inline: calc(-1 * var(--wp--style--root--padding-left)) calc(-1 * var(--wp--style--root--padding-right)) !important;
		padding: 4px var(--wp--style--root--padding-right) 14px var(--wp--style--root--padding-left);
		scrollbar-width: none;
	}
	body .buddy-swipe::-webkit-scrollbar { display: none; }
	body .wp-block-columns.buddy-swipe:not(.is-not-stacked-on-mobile) > .wp-block-column,
	body .buddy-swipe > * {
		flex: 0 0 78% !important;
		max-width: 340px;
		margin: 0 !important;
		scroll-snap-align: start;
	}



	/* Footer: brand blurb on top, link lists two-up. */
	body .buddy-footer-cols {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) !important;
	}
	.buddy-footer .buddy-wordmark { font-size: clamp(2.4rem, 13vw, 3.4rem); }
	.buddy-footer .wp-block-list { gap: 0; }
	.buddy-footer .wp-block-list a { display: inline-block; padding-block: 0.6rem; }
}

/* ======================================================================
 * SCRAPBOOK COMPONENTS (home redesign). Phone-first: base rules are the
 * phone layout; min-width: 782px adds the desktop layout.
 * ====================================================================== */

/* Polaroid photo with a strip of tape (image block style "polaroid"). */
.wp-block-image.is-style-polaroid {
	--tilt: -3deg;
	position: relative;
	margin: 0;
	padding: 10px 10px 12px;
	background: var(--wp--preset--color--white);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	box-shadow: var(--wp--preset--shadow--ink);
	transform: rotate(var(--tilt));
}
.wp-block-image.is-style-polaroid img { display: block; width: 100%; border-radius: 2px; }
.wp-block-image.is-style-polaroid figcaption {
	margin: 10px 0 0;
	text-align: center;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}
.wp-block-image.is-style-polaroid::before {
	content: "";
	position: absolute;
	z-index: 1;
	top: -14px;
	left: 50%;
	width: 88px;
	height: 26px;
	margin-left: -44px;
	background: color-mix(in srgb, var(--wp--preset--color--secondary) 75%, transparent);
	border-inline: 2px dashed color-mix(in srgb, var(--wp--preset--color--contrast) 25%, transparent);
	transform: rotate(calc(var(--tilt) * -1.6));
}
.buddy-tilt-right { --tilt: 3deg !important; }

/* Hero on phones: headline, blurb, photos, then the buttons (the columns flatten into one stack). */
@media (max-width: 781px) {
	.buddy-hero { flex-direction: column; gap: 0 !important; }
	.buddy-hero > .wp-block-column { display: contents; }
	.buddy-hero .buddy-collage { order: 1; margin-top: var(--wp--preset--spacing--40); }
	.buddy-hero .wp-block-buttons { order: 2; }
}

/* Hero collage: main polaroid, a second smaller one overlapping, stickers. */
.buddy-collage { position: relative; padding: var(--wp--preset--spacing--40) 0 var(--wp--preset--spacing--60); }
.buddy-collage > .wp-block-image:first-of-type { width: 84%; margin-left: 2%; }
.buddy-collage > .buddy-collage__second {
	--tilt: 5deg;
	position: absolute;
	right: 0;
	bottom: 0;
	width: 42%;
	z-index: 2;
}

/* Big typographic list (what's in the box). */
.buddy-bigwords { border-top: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast); }
.buddy-bigword-row {
	gap: var(--wp--preset--spacing--30) !important;
	padding-block: var(--wp--preset--spacing--30);
	border-bottom: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
}
.buddy-bigword-row .buddy-art { width: 52px; flex: none; }
.buddy-bigword-row .wp-block-heading {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(2.25rem, 10vw, 4.5rem);
	line-height: 0.95;
	margin: 0;
}
.buddy-bigword-row p { margin: 0.25rem 0 0; font-size: var(--wp--preset--font-size--small); }

/* Dog-walk trail (how it works): dashed inked path with paw markers. */
.buddy-trail { position: relative; display: grid; gap: var(--wp--preset--spacing--50); }
.buddy-trail::before {
	content: "";
	position: absolute;
	left: 27px;
	top: 28px;
	bottom: 28px;
	border-left: var(--wp--custom--ink--width) dashed var(--wp--preset--color--contrast);
}
.buddy-trail__step { display: grid !important; grid-template-columns: 56px 1fr; gap: var(--wp--preset--spacing--30) !important; align-items: start; }
.buddy-trail__step > .buddy-art {
	position: relative;
	z-index: 1;
	width: 56px;
	padding: 9px;
	background: var(--wp--preset--color--white);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: 50%;
	box-shadow: var(--wp--preset--shadow--ink-sm);
}
.buddy-trail__step .wp-block-heading { margin: 0.6rem 0 0.25rem; }
.buddy-trail__step p { margin: 0; }

/* Ways to earn (rewards). */
.buddy-earn { display: grid; gap: var(--wp--preset--spacing--30); margin: 0; padding: 0; list-style: none; }
.buddy-earn li { padding-left: 1.6rem; position: relative; }
.buddy-earn li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1rem;
	height: 1rem;
	background: var(--wp--preset--color--primary);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 50%;
}
.buddy-punch { max-width: 420px; margin-inline: auto; transform: rotate(2deg); }

/* Gift tag card. */
.buddy-gift-tag {
	position: relative;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) 3.75rem !important;
	background: var(--wp--preset--color--white);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--md) var(--wp--custom--radius--md) var(--wp--custom--radius--md) 46px;
	box-shadow: var(--wp--preset--shadow--ink);
	transform: rotate(-2deg);
}
.buddy-gift-tag::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 50%;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	border-radius: 50%;
	background: var(--wp--custom--color--base-tint);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
}
.buddy-gift-tag .is-style-splash { margin: 0; font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--primary); transform: none; }
.buddy-gift-tag .buddy-tag-line {
	margin: 0 0 var(--wp--preset--spacing--30);
	padding-bottom: 0.2rem;
	border-bottom: 2px dashed var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.05;
}

/* The pack: polaroid wall. Swipe row on phones (buddy-swipe), tilted grid on desktop. */
.buddy-pack > :nth-child(even) { --tilt: 2.5deg; }
.buddy-pack > :nth-child(3n) { --tilt: -1.5deg; }
.buddy-pack { padding-top: 1.25rem !important; }

@media (min-width: 782px) {
	.buddy-bigwords { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--wp--preset--spacing--60); border-top: 0; }
	.buddy-bigword-row { border-top: 0; }
	.buddy-bigword-row:nth-child(-n+2) { border-top: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast); }
	.buddy-bigword-row .buddy-art { width: 72px; }
	.buddy-collage > .buddy-collage__second { width: 40%; right: -4%; }
}

/* Very narrow phones: keep the logo truly centered by giving both header sides room. */
@media (max-width: 359px) {
	.buddy-header .buddy-header-logo { font-size: 1.6rem; }
	.buddy-header-cta .wp-block-button__link { padding: 0.65em 0.5em; font-size: 0.66rem; letter-spacing: 0.02em; }
}

/* ======================================================================
 * INKED BUTTONS (every button). Two inked outlines are injected by the
 * theme (functions.php: buddy_button_ink). Render 1 at rest; on hover the
 * button flips to render 2 (nudged, different squiggle) and its secondary
 * color. Slight alternating tilt + a small wiggle, like the menu button.
 * ====================================================================== */
.wp-block-button__link {
	--btn-bg: var(--wp--preset--color--primary);
	--btn-fg: var(--wp--preset--color--contrast);
	--btn-bg-hover: var(--wp--preset--color--secondary);
	--btn-fg-hover: var(--wp--preset--color--contrast);
	position: relative;
	isolation: isolate;
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: var(--btn-fg) !important;
	transform: rotate(-1deg);
}
.wp-block-buttons > .wp-block-button:nth-child(even) .wp-block-button__link { transform: rotate(1deg); }
.wp-block-button.is-style-outline .wp-block-button__link { --btn-bg: var(--wp--preset--color--white); }
.wp-block-button.buddy-btn-dark .wp-block-button__link { --btn-bg: var(--wp--preset--color--contrast); --btn-fg: var(--wp--preset--color--base); }
/* Extra .wp-block-button so hover beats the color variants above (the dark button went dark-on-dark). */
.wp-block-button .wp-block-button__link:is(:hover, :focus-visible) { --btn-bg: var(--btn-bg-hover); color: var(--btn-fg-hover) !important; }
.buddy-btn__ink {
	position: absolute;
	inset: -3px;
	width: calc(100% + 6px);
	height: calc(100% + 6px);
	z-index: -1;
	overflow: visible;
	pointer-events: none;
	filter: drop-shadow(3px 3px 0 var(--wp--preset--color--contrast));
}
.buddy-btn__ink path {
	fill: var(--btn-bg);
	stroke: var(--wp--preset--color--contrast);
	stroke-width: 3px;
	vector-effect: non-scaling-stroke;
	transition: fill var(--wp--custom--motion--fast) ease;
}
.buddy-btn__ink .buddy-r2 { display: none; transform: translate(1.5px, 1px); }
.wp-block-button__link:is(:hover, :focus-visible) .buddy-btn__ink .buddy-r1 { display: none; }
.wp-block-button__link:is(:hover, :focus-visible) .buddy-btn__ink .buddy-r2 { display: inline; }
@media (prefers-reduced-motion: no-preference) {
	.wp-block-button__link:is(:hover, :focus-visible) { animation: buddy-wiggle-sm 420ms ease-in-out; }
	@keyframes buddy-wiggle-sm {
		0%, 100% { rotate: 0deg; }
		30% { rotate: 1.5deg; }
		60% { rotate: -1.5deg; }
	}
}

/* ======================================================================
 * BADGES (buddy/badge) + boiling art (svg.buddy-boil, e.g. paw bloom). Two renders; on a gentle loop they flip back and
 * forth like stop-motion, and stop when hovered. No loop under reduced motion.
 * ====================================================================== */
.buddy-badge { display: block; line-height: 0; }
.buddy-badge svg { width: 100%; height: auto; overflow: visible; }
:is(.buddy-badge, .buddy-boil) .buddy-r2 { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
	:is(.buddy-badge, .buddy-boil) .buddy-r1 { animation: buddy-flip-a 1.8s steps(1, end) infinite; }
	:is(.buddy-badge, .buddy-boil) .buddy-r2 { animation: buddy-flip-b 1.8s steps(1, end) infinite; }
	:is(.buddy-badge, .buddy-art):hover .buddy-r { animation-play-state: paused; }
	@keyframes buddy-flip-a { 0% { opacity: 1; } 50% { opacity: 0; } }
	@keyframes buddy-flip-b { 0% { opacity: 0; } 50% { opacity: 1; } }
}

/* ======================================================================
 * SECTION TUNE-UPS
 * ====================================================================== */
/* What is in the box: light titles on coral (large text only: white on coral is 3.2:1), icons on white tiles. */
#box h2, #box .buddy-bigword-row .wp-block-heading { color: var(--wp--preset--color--white); }
.buddy-bigword-row .buddy-art {
	width: 60px;
	padding: 7px;
	background: var(--wp--preset--color--white);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	box-shadow: var(--wp--preset--shadow--ink-sm);
}
.buddy-bigword-row:nth-child(even) .buddy-art { transform: rotate(3deg); }
.buddy-bigword-row:nth-child(odd) .buddy-art { transform: rotate(-3deg); }

/* How it works: mascot under the copy, saying woof from a speech bubble up and to the right. */
.buddy-how-mascot { position: relative; max-width: 300px; margin: var(--wp--preset--spacing--50) auto 0; padding-top: 2.5rem; }
.buddy-how-mascot .buddy-how-mascot__dog { width: 64%; }
.buddy-how-mascot .buddy-how-mascot__woof { position: absolute; top: 0; right: 0; width: 46%; margin: 0; transform: rotate(6deg); }

/* Handwritten captions (polaroids, pack). */
.wp-block-image.is-style-polaroid figcaption {
	font-family: var(--wp--preset--font-family--hand);
	font-weight: 400;
	font-size: 1.25rem;
	line-height: 1.1;
}

/* Footer social icons: little die-cut circles. */
.buddy-socials { gap: 0.6rem !important; margin-top: var(--wp--preset--spacing--30) !important; }
.buddy-socials .wp-social-link {
	background: var(--wp--preset--color--white) !important;
	color: var(--wp--preset--color--contrast) !important;
	border: var(--wp--custom--ink--width-thin) solid var(--wp--preset--color--contrast);
	border-radius: 50%;
	box-shadow: 2px 2px 0 var(--wp--preset--color--secondary);
}
.buddy-socials .wp-social-link a { padding: 0.5rem !important; }
.buddy-socials .wp-social-link svg { width: 20px; height: 20px; }
.buddy-socials { flex-wrap: wrap; }
.buddy-socials .wp-social-link:hover { background: var(--wp--preset--color--secondary) !important; transform: rotate(-6deg); }

/* ======================================================================
 * MENU OVERLAY (redesigned): mint sheet with halftone, giant numbered
 * links on dashed ink rules, the two main actions and the mascot peeking in.
 * ====================================================================== */
.buddy-nav-extras { display: none; }
.buddy-nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--secondary) !important;
	background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent) 1.4px, transparent 1.6px) !important;
	background-size: 12px 12px !important;
	color: var(--wp--preset--color--contrast) !important;
}
.buddy-nav .is-menu-open .wp-block-navigation__container { counter-reset: buddy-nav; gap: 0 !important; width: 100%; }
.buddy-nav .is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 2px dashed var(--wp--preset--color--contrast); }
.buddy-nav .is-menu-open .wp-block-navigation-item__content {
	counter-increment: buddy-nav;
	display: flex !important;
	align-items: baseline;
	gap: 0.6rem;
	width: 100%;
	padding-block: 0.55rem !important;
	color: var(--wp--preset--color--contrast) !important;
	font-size: clamp(2rem, 9vw, 3rem);
}
.buddy-nav .is-menu-open .wp-block-navigation-item__content::before {
	content: counter(buddy-nav, decimal-leading-zero);
	font-family: var(--wp--preset--font-family--hand);
	font-size: 1.1rem;
	color: var(--wp--preset--color--contrast);
}
.buddy-nav .is-menu-open .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--contrast) !important; text-decoration: underline; text-decoration-color: var(--wp--preset--color--primary); }
.buddy-nav .wp-block-navigation__responsive-container-close {
	background: var(--wp--preset--color--primary);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	box-shadow: var(--wp--preset--shadow--ink-sm);
	transform: rotate(3deg);
	color: var(--wp--preset--color--contrast);
}
.buddy-nav .is-menu-open .buddy-nav-extras {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	width: 100%;
	margin-top: var(--wp--preset--spacing--50);
	position: relative;
}
.buddy-nav-extras__note { margin: 0; font-family: var(--wp--preset--font-family--hand); font-size: 1.6rem; transform: rotate(-2deg); }
.buddy-nav-extras .wp-block-buttons { flex-direction: column; align-items: stretch; gap: var(--wp--preset--spacing--30); }
.buddy-nav-extras .wp-block-button__link { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.buddy-nav-extras__mascot { width: 120px; justify-self: end; margin-right: -0.5rem; transform: rotate(8deg); }

/* ======================================================================
 * PHONES: centered headings, pack corkboard. DESKTOP: bigger art.
 * ====================================================================== */
@media (max-width: 781px) {
	main :is(h1, h2) { text-align: center; }
	main .wp-block-heading.is-style-slab { display: block; margin-inline: auto; }

	/* "caught being good": a corkboard that fits the screen, photos pinned on. */
	body .buddy-pack {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 1.4rem 0.9rem !important;
		padding: 1.6rem 1rem 1.4rem !important;
		/* Real cork photo (rotated portrait) in a wooden frame: ink line, wood band, a lighter bevel, and a soft inner shadow. */
		/* The frame is the same cork, darkened (the palette has no brown), so board and frame always match. */
		--cork-photo: image-set(url(../images/textures/corkboard-800.webp) 1x, url(../images/textures/corkboard-1600.webp) 2x);
		background:
			var(--cork-photo) center / cover padding-box,
			linear-gradient(color-mix(in srgb, var(--wp--preset--color--contrast) 58%, transparent), color-mix(in srgb, var(--wp--preset--color--contrast) 58%, transparent)) border-box,
			var(--cork-photo) center / cover border-box,
			var(--wp--custom--color--cork);
		border: 12px solid transparent;
		border-radius: var(--wp--custom--radius--label);
		outline: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
		box-shadow:
			var(--wp--preset--shadow--ink),
			inset 0 0 0 2px var(--wp--preset--color--contrast),
			inset 0 0 0 4px color-mix(in srgb, var(--wp--preset--color--white) 25%, transparent),
			inset 0 6px 14px color-mix(in srgb, var(--wp--preset--color--contrast) 45%, transparent);
	}
	/* Smaller photos that overlap like a well-used board. */
	body .buddy-pack { gap: 0 !important; padding: 1.8rem 0.9rem 1.6rem !important; }
	body .buddy-pack > * { width: 84%; position: relative; }
	body .buddy-pack > :nth-child(odd) { justify-self: start; z-index: 1; }
	body .buddy-pack > :nth-child(even) { justify-self: end; z-index: 2; translate: -14% 1.1rem; }
	body .buddy-pack > :nth-child(n+3) { margin-top: 0.5rem; }
	body .buddy-pack > :nth-child(1) { --tilt: -5deg; }
	body .buddy-pack > :nth-child(2) { --tilt: 4deg; }
	body .buddy-pack > :nth-child(3) { --tilt: 3deg; translate: 6% 0; }
	body .buddy-pack > :nth-child(4) { --tilt: -3.5deg; }
	body .buddy-pack > :last-child:nth-child(odd) { grid-column: 1 / -1; width: 46%; justify-self: center; z-index: 3; --tilt: -2deg; margin-top: 1.3rem; translate: 8% 0; }
	.buddy-pack .wp-block-image.is-style-polaroid { padding: 6px 6px 8px; box-shadow: var(--wp--preset--shadow--ink-sm); }
	.buddy-pack .wp-block-image.is-style-polaroid figcaption { font-size: 1.05rem; margin-top: 6px; }
	.buddy-pack .wp-block-image.is-style-polaroid::before {
		top: -9px;
		width: 16px;
		height: 16px;
		margin-left: -8px;
		background: var(--wp--preset--color--primary);
		border: 2px solid var(--wp--preset--color--contrast);
		border-radius: 50%;
		box-shadow: 1px 2px 0 var(--wp--preset--color--contrast);
		transform: none;
	}
	.buddy-pack > :nth-child(even)::before { background: var(--wp--preset--color--secondary) !important; }
}
@media (min-width: 782px) {
	.buddy-punch { max-width: 560px; }
	.buddy-how-mascot { max-width: 340px; margin-left: 0; }
}

/* ======================================================================
 * REWARDS (mint, dotted): the copy sits on a white inked card so it reads
 * cleanly over the dots; the slab title overlaps the top edge of the card.
 * ====================================================================== */
.buddy-rewards {
	background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--wp--preset--color--white) 55%, transparent) 1.5px, transparent 1.8px);
	background-size: 12px 12px;
}
.buddy-rewards .wp-block-heading.is-style-slab { position: relative; z-index: 1; box-shadow: 6px 6px 0 var(--wp--preset--color--contrast); }
.buddy-rewards__card {
	margin-top: -0.9rem !important;
	padding: 2rem var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) !important;
	background: var(--wp--preset--color--white);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: var(--wp--preset--shadow--ink);
	transform: rotate(-0.6deg);
}
.buddy-rewards__lead { margin: 0 0 var(--wp--preset--spacing--40); font-size: var(--wp--preset--font-size--medium); font-weight: 600; }
.buddy-rewards__card .buddy-earn li { padding-bottom: var(--wp--preset--spacing--30); border-bottom: 2px dashed color-mix(in srgb, var(--wp--preset--color--contrast) 30%, transparent); }
.buddy-rewards__note { margin: var(--wp--preset--spacing--40) 0 0; font-family: var(--wp--preset--font-family--hand); font-size: 1.35rem; line-height: 1.2; transform: rotate(-1deg); }
.buddy-rewards .wp-block-buttons { margin-top: var(--wp--preset--spacing--50); }

/* ======================================================================
 * JOIN THE PACK + FOLLOW: stacked on phones, two columns on desktop.
 * ====================================================================== */
.buddy-join__bloom { width: 130px; margin: 0 auto var(--wp--preset--spacing--30); }
.buddy-join__mail { text-align: center; }
.buddy-join__mail .wp-block-buttons { justify-content: center; }
.buddy-follow {
	position: relative;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) !important;
	background: var(--wp--preset--color--secondary);
	border: var(--wp--custom--ink--width) solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: var(--wp--preset--shadow--ink);
	transform: rotate(1.2deg);
}
.buddy-follow > * { margin-block: 0 !important; }
.buddy-follow > * + * { margin-top: var(--wp--preset--spacing--30) !important; }
.buddy-follow__handle {
	position: absolute;
	top: -1.1rem;
	left: var(--wp--preset--spacing--40);
	padding: 0.1em 0.5em;
	background: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	font-family: var(--wp--preset--font-family--hand);
	font-size: 1.3rem;
	transform: rotate(-4deg);
}
.buddy-follow > .buddy-follow__handle { margin: 0 !important; }
.buddy-follow__title { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--x-large); line-height: 1; }
.buddy-follow__feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.buddy-follow__feed .wp-block-image { margin: 0; }
.buddy-follow__feed img {
	display: block;
	width: 100%;
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--label);
	box-shadow: 2px 2px 0 var(--wp--preset--color--contrast);
}
.buddy-follow__feed .wp-block-image:nth-child(odd) { transform: rotate(-2deg); }
.buddy-follow__feed .wp-block-image:nth-child(even) { transform: rotate(2deg); }
