/**
 * Shared styles for the purplish.io pages: tokens, base type, buttons, header, phone menu, footer
 * and the scroll entrance. Loaded only on pages with the purplish-site body class, so the demo
 * store keeps Purple's look.
 */

:root {
	--purple: #8f43ee;
	--purple-hover: #9a56f0;
	--purple-deep: #6a24c9;
	--night: #160b33;
	--plum: #2a1160;
	--text: #1a1530;
	--muted: #5c5670;
	--line: #e6e2ee;
	--line-hover: #cdbdf0;
	--soft: #f6f4fb;
	--tint: #efe8fd;
	--white: #fff;
	--max: 1200px;
	--gutter: clamp(20px, 4vw, 40px);
	--space: clamp(88px, 10vw, 140px);
	--radius: 18px;
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--shadow: 0 1px 2px rgba(26, 21, 48, 0.05), 0 12px 32px -12px rgba(26, 21, 48, 0.16);
	--shadow-lg: 0 2px 4px rgba(22, 11, 51, 0.08), 0 40px 80px -24px rgba(22, 11, 51, 0.45);
	color-scheme: light;
	interpolate-size: allow-keywords;
}

html:has(> body.purplish-site) { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: #cbbcef var(--soft); }
body.purplish-site {
	margin: 0;
	background: var(--white);
	color: var(--text);
	font-family: "TikTok Sans", system-ui, sans-serif;
	font-size: 1.0625rem;
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

/*
 * Purple's global styles still print on these pages (heading sizes and colors, link underline,
 * button fills, block gap margins). :root :where() matches their weight and wins by coming later,
 * while every class rule below still overrides these resets.
 */
:root :where(.purplish-site *, .purplish-site *::before, .purplish-site *::after) { box-sizing: border-box; }
:root :where(.purplish-site img) { display: block; max-width: 100%; height: auto; }
:root :where(.purplish-site a) { color: inherit; text-decoration: none; }
:root :where(.purplish-site h1, .purplish-site h2, .purplish-site h3, .purplish-site p, .purplish-site ul, .purplish-site figure, .purplish-site blockquote) { margin: 0; }
:root :where(.purplish-site h1, .purplish-site h2, .purplish-site h3) { color: inherit; font-family: inherit; }
:root :where(.purplish-site ul) { padding: 0; list-style: none; }
:root :where(.purplish-site .wp-site-blocks > *, .purplish-site .is-layout-flow > *, .purplish-site .is-layout-flex > *) { margin-block: 0; }
.purplish-site { -webkit-tap-highlight-color: transparent; }
.purplish-site ::selection { background: var(--purple); color: #fff; }
.purplish-site :focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 6px; }
.purplish-site .is-dark :focus-visible, .purplish-site .cta :focus-visible { outline-color: #c9a7ff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

:root :where(.purplish-site h2) {
	font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
	font-weight: 700;
	line-height: 1.06;
	letter-spacing: -0.035em;
	text-wrap: balance;
}
:root :where(.purplish-site h3) { font-size: 1.3125rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance; }
.lead { color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.6; text-wrap: pretty; }
.head { max-width: 760px; margin: 0 auto clamp(48px, 6vw, 72px); text-align: center; }
.head .lead { max-width: 600px; margin: 20px auto 0; }

/*
 * Buttons: hover fills 10% lighter and borders brighten, like Purple's buttons.
 * .btn is a plain link; .is-btn is a Button block, styled through its inner link.
 */
.btn,
.is-btn > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 26px;
	border: 1.5px solid transparent;
	border-radius: 12px;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out);
}
.btn:active,
.is-btn > .wp-block-button__link:active { transform: scale(0.98); }
.btn--primary,
.is-btn--primary > .wp-block-button__link { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn--primary:hover,
.is-btn--primary > .wp-block-button__link:hover { background: var(--purple-hover); border-color: var(--purple-hover); }
.btn--ghost,
.is-btn--ghost > .wp-block-button__link { border-color: rgba(255, 255, 255, 0.32); color: #fff; }
.btn--ghost:hover,
.is-btn--ghost > .wp-block-button__link:hover { border-color: rgba(255, 255, 255, 0.7); background: none; }
.btn--line,
.is-btn--line > .wp-block-button__link { border-color: #d6cfe3; color: var(--text); background: #fff; }
.btn--line:hover,
.is-btn--line > .wp-block-button__link:hover { border-color: var(--purple-hover); background: #fff; }
.btn--hdr { border-color: rgba(255, 255, 255, 0.38); color: inherit; }
.btn--hdr:hover { border-color: rgba(255, 255, 255, 0.8); }
.is-scrolled .btn--hdr { border-color: #d6cfe3; }
.is-scrolled .btn--hdr:hover { border-color: var(--purple-hover); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; border-radius: 10px; }

/* Header: clear over a dark band, white once the page scrolls. */
.header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 50;
	color: #fff;
	transition: color 0.4s ease;
}
/* The white bar and its blur live on one layer that fades, so the blur eases in with the color instead of switching on. */
.header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 1px 0 var(--line);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}
.admin-bar .header { top: var(--wp-admin--admin-bar--height, 32px); }
.header.is-scrolled { color: var(--text); }
.header.is-scrolled::before { opacity: 1; }
.header .btn--hdr { transition: background-color 0.2s ease, border-color 0.4s ease, transform 0.2s var(--ease-out); }
.header .wrap { display: flex; align-items: center; gap: 32px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.02em; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 6px; }
.nav a { display: block; padding: 8px 14px; border-radius: 8px; font-size: 0.9375rem; font-weight: 500; opacity: 0.78; transition: opacity 0.2s ease; }
.nav a:hover, .nav a[aria-current] { opacity: 1; }
.header .btn--hdr { margin-left: 8px; }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 10px; }
.menu-btn svg { margin: auto; }
.menu-btn:active, .sheet-menu__close:active { background: color-mix(in srgb, currentColor 10%, transparent); }

.sheet-menu {
	inset: 12px 12px auto;
	width: auto;
	margin: 0;
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: #fff;
	color: var(--text);
	box-shadow: var(--shadow-lg);
	max-height: calc(100dvh - 24px);
	overscroll-behavior: contain;
	transform-origin: top right;
	opacity: 0;
	transition: opacity 0.16s ease, translate 0.16s ease, scale 0.16s ease, display 0.16s allow-discrete, overlay 0.16s allow-discrete;
}
/* Opens a touch slower than it closes. The panel turns opaque before it finishes moving, so the page doesn't show through it. */
.sheet-menu:popover-open { opacity: 1; transition-duration: 0.16s, 0.28s, 0.28s, 0.28s, 0.28s; transition-timing-function: var(--ease-out); }
@starting-style { .sheet-menu:popover-open { opacity: 0; } }
.sheet-menu::backdrop { background: rgba(22, 11, 51, 0); transition: background-color 0.2s ease, display 0.2s allow-discrete, overlay 0.2s allow-discrete; }
.sheet-menu:popover-open::backdrop { background: rgba(22, 11, 51, 0.45); }
@starting-style { .sheet-menu:popover-open::backdrop { background: rgba(22, 11, 51, 0); } }
html:has(.sheet-menu:popover-open) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
	.sheet-menu { translate: 0 -10px; scale: 0.97; }
	.sheet-menu:popover-open { translate: 0 0; scale: 1; }
	@starting-style { .sheet-menu:popover-open { translate: 0 -10px; scale: 0.97; } }
	.sheet-menu li { transition: opacity 0.3s var(--ease-out), translate 0.3s var(--ease-out); }
	.sheet-menu li:nth-child(2) { transition-delay: 0.03s; }
	.sheet-menu li:nth-child(3) { transition-delay: 0.06s; }
	.sheet-menu li:nth-child(4) { transition-delay: 0.09s; }
	@starting-style { .sheet-menu:popover-open li { opacity: 0; translate: 0 6px; } }
}
.sheet-menu__top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px 12px; }
.sheet-menu__close { width: 44px; height: 44px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--text); }
.sheet-menu ul a { display: block; padding: 14px 12px; border-radius: 10px; font-size: 1.125rem; font-weight: 500; }
@media (hover: hover) { .sheet-menu ul a:hover { background: var(--soft); } }
.sheet-menu ul a:active { background: var(--soft); }
.sheet-menu ul a[aria-current] { color: var(--purple-deep); }
.sheet-menu .btn { width: 100%; margin-top: 8px; }

/* Footer */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 40px; padding: 36px 0 28px; }
.footer .brand { color: var(--text); font-size: 1.0625rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.footer__links a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); transition: color 0.2s ease; }
.footer__links a:hover, .footer__links a[aria-current] { color: var(--purple-deep); }
.legal { padding: 22px 0 32px; border-top: 1px solid var(--line); font-size: 0.8125rem; line-height: 1.6; }

/* Scroll entrance. The default state is the finished layout; it only starts hidden when motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
	.js .rv { opacity: 0; translate: 0 36px; transition: opacity 0.9s var(--ease-out), translate 0.9s var(--ease-out); transition-delay: var(--d, 0s); }
	.js .rv.from-left { translate: -48px 0; }
	.js .rv.from-right { translate: 48px 0; }
	.js .rv.is-in { opacity: 1; translate: 0 0; }
}
/* Entrance delays as classes, so blocks don't need inline styles. */
.d-08 { --d: 0.08s; }
.d-10 { --d: 0.1s; }
.d-12 { --d: 0.12s; }
.d-16 { --d: 0.16s; }
.d-20 { --d: 0.2s; }
@media (prefers-reduced-motion: no-preference) and (max-width: 900px) {
	.js .rv.from-left:not(.is-in), .js .rv.from-right:not(.is-in) { translate: 0 36px; }
}

@media (max-width: 900px) {
	.nav, .header .btn--hdr { display: none; }
	.menu-btn { display: grid; }
}
@media (max-width: 600px) {
	.header .wrap { height: 64px; }
}
