/*
 * Website layer — design doc §3 (replaceable by design).
 * The durable brand tokens live in tokens.css; this file may be redesigned
 * wholesale in a future version provided §2 is preserved.
 */

/* ---------- Base ---------- */

body {
	-webkit-font-smoothing: antialiased;
	margin: 0;
}

p {
	max-width: 68ch;
}

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

[id] {
	scroll-margin-top: 88px; /* keep anchor targets clear of the sticky header */
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* Accessibility floor (§7.6): visible focus everywhere */
:focus-visible {
	outline: 2px solid var(--wp-coral-interactive);
	outline-offset: 2px;
}

/* §3.4: respect prefers-reduced-motion — disable all transitions/animations */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* Visually hidden, available to assistive tech (WP convention) */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Skip link (§7.6) */
.wisp-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 10px 16px;
	background: var(--wp-bg);
	color: var(--wp-link);
	font-weight: 600;
}

.wisp-skip-link:focus {
	left: 12px;
	top: 12px;
}

/* ---------- Layout primitives (§3.2) ---------- */

.wisp-section {
	padding-block: clamp(4rem, 2.5rem + 4vw, 6rem); /* 64px mobile → 96px desktop */
	padding-inline: 24px;
}

.wisp-container {
	max-width: 70rem; /* 1120px */
	margin-inline: auto;
}

.wisp-section-alt {
	background: var(--wp-bg-alt);
}

/* ---------- Header (§3.2) ---------- */

.wisp-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp-bg);
	border-bottom: 1px solid var(--wp-border);
}

.wisp-header-inner {
	max-width: 70rem;
	margin-inline: auto;
	padding: 14px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.wisp-header-nav {
	display: flex;
	align-items: center;
	gap: clamp(16px, 3vw, 32px);
}

.wisp-header-nav a:not(.wisp-button) {
	color: var(--wp-text);
	text-decoration: none;
	font-weight: 400;
}

.wisp-header-nav a:not(.wisp-button):hover {
	color: var(--wp-link);
}

.wisp-header .wisp-button {
	padding: 10px 20px;
	font-size: 0.9375rem;
}

/* ---------- Wordmark (§2.2 — durable) ---------- */

.wisp-wordmark {
	font-weight: 600;
	letter-spacing: -0.01em;
	font-size: 1.375rem;
	color: var(--wp-plum);
	text-decoration: none;
	line-height: 1;
}

/* ---------- Buttons and CTAs (§3.3) ---------- */

.wisp-button {
	display: inline-block;
	background: var(--wp-button-bg);
	color: var(--wp-button-text);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	padding: 14px 26px;
	border-radius: 999px; /* pill — website-layer choice (§2.5) */
	text-decoration: none;
	transition: background-color 150ms ease-out;
}

.wisp-button:hover {
	background: var(--wp-button-bg-hover);
}

.wisp-link-cta {
	color: var(--wp-link);
	font-weight: 600;
	text-decoration: none;
}

.wisp-link-cta:hover {
	text-decoration: underline;
}

.wisp-support-line {
	color: var(--wp-text-muted);
	font-size: 0.875rem;
}

.wisp-appstore-badge img {
	width: 160px;
	height: auto;
}

/* ---------- Eyebrows and the pattern-arrow motif (§3.1) ---------- */

.wisp-eyebrow {
	color: var(--wp-coral-interactive);
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0 0 12px;
}

/* Coral-underlined pairing inside the hero H1 (motif use 1 of 3) */
.wisp-motif-pair {
	text-decoration: underline;
	text-decoration-color: var(--wp-coral);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
}

/* App-format pattern line, e.g. “Bloating → Yogurt · 9/13 · ~5h” */
.wisp-pattern-line {
	color: var(--wp-text-secondary);
	font-weight: 600;
	font-size: 0.9375rem;
	letter-spacing: 0.01em;
	margin: 0 0 8px;
}

.wisp-arrow {
	color: var(--wp-coral);
}

/* ---------- Hero (§3.2) ---------- */

.wisp-hero-grid {
	display: grid;
	grid-template-columns: 11fr 9fr; /* text ~55% / device ~45% */
	gap: clamp(32px, 5vw, 64px);
	align-items: start;
}

@media (max-width: 781px) {
	.wisp-hero-grid {
		grid-template-columns: 1fr; /* stacked: text, then device */
	}
}

.wisp-hero-grid h1 {
	margin: 0 0 16px;
}

.wisp-hero-sub {
	color: var(--wp-text-secondary);
	font-size: 1.1875rem;
	margin: 0;
}

.wisp-cta-row {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
	margin-block: 24px 12px;
}

/* ---------- Device frame (§3.3) ---------- */

.wisp-device {
	border: 1px solid var(--wp-border);
	border-radius: 20px;
	background: var(--wp-bg-alt);
	padding: 10px;
	max-width: 320px;
	margin-inline: auto;
}

.wisp-device img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

/* ---------- How it works ---------- */

.wisp-steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
}

@media (max-width: 781px) {
	.wisp-steps {
		grid-template-columns: 1fr;
	}
}

.wisp-step h3 {
	margin: 0 0 8px;
}

.wisp-step p {
	margin: 0;
	color: var(--wp-text-secondary);
}

.wisp-step .wisp-device {
	margin: 24px 0 0;
	max-width: 220px;
}

/* ---------- Feature bento (§3.2) ---------- */

.wisp-bento {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	gap: 24px;
	margin-top: 40px;
}

.wisp-card {
	background: var(--wp-bg);
	border: 1px solid var(--wp-border);
	border-radius: 8px;
	padding: clamp(24px, 3vw, 32px); /* §3.3: 24–32px, no shadows */
}

.wisp-card--large {
	grid-row: span 2;
}

.wisp-card h3 {
	margin: 0 0 8px;
}

.wisp-card p {
	margin: 0;
	color: var(--wp-text-secondary);
}

.wisp-card .wisp-device {
	margin: 24px auto 0;
	max-width: 280px;
}

@media (max-width: 781px) {
	.wisp-bento {
		grid-template-columns: 1fr;
	}

	.wisp-card--large {
		grid-row: auto;
	}
}

/* ---------- Callout band (§3.2) ---------- */

.wisp-callout-inner {
	border-left: 3px solid var(--wp-coral);
	border-radius: 0; /* square corners on the callout border */
	padding-left: clamp(20px, 4vw, 40px);
}

.wisp-callout-inner h2 {
	margin-top: 0;
}

.wisp-callout-grid {
	display: flex;
	gap: clamp(32px, 5vw, 64px);
	align-items: center;
	flex-wrap: wrap;
}

.wisp-callout-grid > div:first-child {
	flex: 1 1 400px;
}

.wisp-callout-grid .wisp-device {
	flex: 0 1 220px;
	margin: 0;
}

/* ---------- Closing CTA ---------- */

.wisp-closing {
	text-align: left;
}

/* ---------- Cards on Support page ---------- */

.wisp-card-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-top: 40px;
}

@media (max-width: 781px) {
	.wisp-card-row {
		grid-template-columns: 1fr;
	}
}

/* ---------- Footer (§3.2) ---------- */

.wisp-footer {
	background: var(--wp-footer-bg);
	color: var(--wp-footer-text);
	padding: 56px 24px;
}

.wisp-footer-inner {
	max-width: 70rem;
	margin-inline: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 32px 64px;
	justify-content: space-between;
	align-items: flex-start;
}

.wisp-footer .wisp-wordmark {
	color: var(--wp-footer-text); /* §2.2: Off-white on Plum/dark */
}

.wisp-footer-tagline {
	color: var(--wp-footer-text-secondary);
	margin: 8px 0 0;
}

.wisp-footer-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.wisp-footer a {
	color: var(--wp-footer-text);
	text-decoration: none;
}

.wisp-footer a:hover {
	text-decoration: underline;
}

.wisp-footer :focus-visible {
	outline-color: var(--wp-footer-text);
}

.wisp-footer-meta {
	color: var(--wp-footer-text-secondary);
	font-size: 0.875rem;
	margin: 24px 0 0;
}

/* ---------- Legal / plain document pages (§5.4) ---------- */

.wisp-doc-updated {
	color: var(--wp-text-muted);
	font-size: 0.875rem;
}

/* ---------- Scroll fade-up (§3.4) ---------- */
/* JS adds .wisp-fade-init on load, so nothing is hidden without JS.
   The whole block sits behind no-preference, so reduced-motion users never
   see elements move. */
@media (prefers-reduced-motion: no-preference) {
	.wisp-fade-init {
		opacity: 0;
		transform: translateY(12px);
		transition: opacity 300ms ease-out, transform 300ms ease-out;
	}

	.wisp-fade-init.wisp-fade-in {
		opacity: 1;
		transform: none;
	}
}
