/* The Wakalah base design: tokens, type, components. Logical properties only. Colors come from theme.json. */

:root {
	--wak-burgundy: var(--wp--preset--color--burgundy);
	--wak-cream: var(--wp--preset--color--cream);
	--wak-ink: var(--wp--preset--color--ink);
	/* Dark scheme. bg: page; white and light: raised surfaces; text: body copy; accent: brand rose for type on dark. */
	--wak-bg: var(--wp--preset--color--night);
	--wak-white: var(--wp--preset--color--surface);
	--wak-light: color-mix(in srgb, var(--wak-bg) 55%, var(--wak-white));
	--wak-text: var(--wak-cream);
	--wak-muted: color-mix(in srgb, var(--wak-cream) 64%, transparent);
	--wak-accent: var(--wp--preset--color--rose);
	--wak-line: color-mix(in srgb, var(--wak-cream) 12%, transparent);
	--wak-gutter: clamp(20px, 4vw, 44px);
	--wak-max: var(--wp--style--global--content-size, 1160px);
	--wak-frame: max(var(--wak-gutter), calc((100% - var(--wak-max)) / 2));
	--wak-radius: 14px;
	--wak-ease: cubic-bezier(.16, 1, .3, 1);
	--wak-focus: var(--wak-accent);
	/* One cell of the brand pattern, assets/brand/mark.svg. Use as a mask, see .wak-pattern. */
	--wak-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36.54 24.96' width='36.54' height='24.96' fill='%237b1d2f'%3E%3Cpath d='M16.72 12.53L18.16 9.22C18.52 8.42 17.74 8.11 17.74 8.11L10.47 4.86L8.71 8.95Z'/%3E%3Cpath d='M24.92 7.67L26.36 4.37C26.72 3.56 25.94 3.25 25.94 3.25L18.67 0L16.91 4.09Z'/%3E%3Cpath d='M29.76 10.85L22.77 20.45C20.1 19.49 16.87 18.23 14.36 16.94C12.59 16.04 11.93 15.82 11.93 15.82L0 19.79L1.19 20.28L5.61 18.78C7.03 19.44 10.14 21.12 12.15 22.07C15.66 23.68 18.58 24.96 19.73 24.72C20.15 24.63 21.07 24.3 21.56 24.14L27.61 22.07L36.54 9.74Z'/%3E%3C/svg%3E");
	--wak-pattern-size: 73.08px 49.92px;
	--wak-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 8h13M9 3l5 5-5 5' fill='none' stroke='%23020202' stroke-width='1.6'/%3E%3C/svg%3E");
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-block-start: 96px;
}

html.wak-locked { overflow: hidden; }

body {
	margin: 0;
	background: var(--wak-bg);
	color: var(--wak-text);
	font-family: var(--wp--preset--font-family--alexandria);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

img, svg, video { max-inline-size: 100%; block-size: auto; }

a { color: inherit; }

main:focus { outline: none; }

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

::selection { background: var(--wak-burgundy); color: var(--wak-cream); }

/* Type */

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--wak-text);
	font-weight: 900;
	line-height: 1.2;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

p { margin: 0; }

.wak-h1 {
	font-size: clamp(50px, 8vw, 104px);
	line-height: 1.1;
}

.wak-h2 {
	font-size: clamp(36px, 5vw, 64px);
	line-height: 1.15;
}

/* Tightened Latin only: letter-spacing would break the joins of Arabic script. */
:lang(en) .wak-h1, :lang(en) .wak-h2 { letter-spacing: -.02em; }

.wak-lead {
	font-size: clamp(17px, 1.6vw, 20px);
	font-weight: 300;
	line-height: 1.9;
	max-inline-size: 34em;
}

.wak-lead + .wak-btn { margin-block-start: 24px; }

/* Section number: "01 ——" */
.wak-num {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--wak-accent);
	font-size: 13px;
	font-weight: 400;
	font-variant-numeric: tabular-nums;
	letter-spacing: .08em;
	line-height: 1;
	unicode-bidi: isolate;
}

.wak-num::after {
	content: "";
	inline-size: 28px;
	block-size: 1px;
	background: currentColor;
	transition: inline-size .5s var(--wak-ease);
}

.wak-stat {
	display: block;
	inline-size: fit-content;
	color: var(--wak-accent);
	direction: ltr;
	font-size: clamp(52px, 6.5vw, 84px);
	font-variant-numeric: tabular-nums;
	font-weight: 900;
	line-height: 1.05;
}

[data-count] { font-variant-numeric: tabular-nums; }

/* Layout */

.wak-section {
	padding-block: clamp(64px, 9vw, 128px);
	padding-inline: var(--wak-frame);
}

.wak-section--tight { padding-block: clamp(32px, 4vw, 56px); }
.wak-section--light { background: var(--wak-light); }
.wak-section--white { background: var(--wak-white); }

.wak-section--burgundy {
	--wak-focus: var(--wak-cream);
	background: var(--wak-burgundy);
	color: var(--wak-cream);
}

.wak-section--burgundy :is(h1, h2, h3, h4, .wak-h1, .wak-h2, .wak-num, .wak-stat) { color: var(--wak-cream); }

.wak-section > .wak-num + * { margin-block-start: 20px; }
.wak-section > :is(.wak-h1, .wak-h2) + .wak-grid-3 { margin-block-start: clamp(32px, 5vw, 64px); }

.wak-grid-3 {
	display: grid;
	gap: clamp(12px, 1.6vw, 20px);
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {
	.wak-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	.wak-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Decorative pattern: a masked layer, so it takes the text color of its container. Keep it faint. */
.wak-pattern {
	background: currentColor;
	opacity: .08;
	pointer-events: none;
	-webkit-mask: var(--wak-pattern) 0 0 / var(--wak-pattern-size);
	mask: var(--wak-pattern) 0 0 / var(--wak-pattern-size);
}

/* Card */

.wak-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-inline-size: 0;
	padding: clamp(24px, 2.6vw, 34px);
	background: var(--wak-white);
	border-radius: var(--wak-radius);
	color: var(--wak-text);
	text-decoration: none;
}

.wak-card :is(h2, h3, h4, .wak-card__title) {
	font-size: clamp(20px, 1.9vw, 24px);
	line-height: 1.35;
	transition: color .35s var(--wak-ease);
}

.wak-card p {
	font-size: 15px;
	font-weight: 300;
	line-height: 1.8;
}

a.wak-card {
	--wak-focus: var(--wak-accent);
	transition: background-color .35s var(--wak-ease), color .35s var(--wak-ease);
}

@media (hover: hover) {
	a.wak-card:hover {
		background: var(--wak-burgundy);
		color: var(--wak-cream);
	}
	a.wak-card:hover :is(h2, h3, h4, .wak-card__title, .wak-num) { color: var(--wak-cream); }
	a.wak-card:hover .wak-num::after { inline-size: 56px; }
}

/* Button */

.wak-btn {
	--bg: var(--wak-burgundy);
	--fg: var(--wak-cream);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-block-size: 52px;
	padding-block: 12px;
	padding-inline: 28px;
	background: var(--bg);
	border: 1px solid var(--bg);
	border-radius: 999px;
	color: var(--fg);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .3s var(--wak-ease), color .3s var(--wak-ease), border-color .3s var(--wak-ease);
}

.wak-btn::after {
	content: "";
	flex: none;
	inline-size: 16px;
	block-size: 16px;
	background: currentColor;
	-webkit-mask: var(--wak-arrow) center / contain no-repeat;
	mask: var(--wak-arrow) center / contain no-repeat;
	transition: transform .4s var(--wak-ease);
}

:root[dir="rtl"] .wak-btn::after { transform: scaleX(-1); }

@media (hover: hover) {
	.wak-btn:hover {
		background: transparent;
		color: var(--bg);
	}
	.wak-btn:hover::after { transform: translateX(4px); }
	:root[dir="rtl"] .wak-btn:hover::after { transform: scaleX(-1) translateX(4px); }
}

.wak-btn--small {
	min-block-size: 44px;
	padding-inline: 20px;
	font-size: 14px;
}

.wak-btn--light {
	--bg: var(--wak-cream);
	--fg: var(--wak-burgundy);
	--wak-focus: var(--wak-cream);
}

.wak-btn--ghost {
	background: transparent;
	color: var(--bg);
}

@media (hover: hover) {
	.wak-btn--ghost:hover {
		background: var(--bg);
		color: var(--fg);
	}
}

/* Long text from the editor */

.wak-prose {
	max-inline-size: 44rem;
	font-weight: 300;
	line-height: 1.95;
}

.wak-prose > * + * { margin-block-start: 1.2em; }
.wak-prose :is(h2, h3, h4) { margin-block-start: 1.8em; }
.wak-prose h2 { font-size: clamp(26px, 3vw, 36px); }
.wak-prose h3 { font-size: clamp(21px, 2.2vw, 26px); }
.wak-prose strong { font-weight: 600; }
.wak-prose ul, .wak-prose ol { padding-inline-start: 1.2em; }
.wak-prose li + li { margin-block-start: .4em; }
.wak-prose li::marker { color: var(--wak-accent); }
.wak-prose img { border-radius: var(--wak-radius); }

.wak-prose a {
	color: var(--wak-accent);
	font-weight: 400;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.wak-prose blockquote {
	margin-inline: 0;
	padding-inline-start: 24px;
	border-inline-start: 2px solid var(--wak-accent);
	color: var(--wak-accent);
	font-size: 1.2em;
	font-weight: 400;
}

/* Marquee */

[data-marquee] {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px 48px;
	color: var(--wak-accent);
	font-size: clamp(20px, 2.4vw, 30px);
	font-weight: 800;
	line-height: 1.3;
}

[data-marquee].is-running {
	display: block;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, var(--wak-text) 6%, var(--wak-text) 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, var(--wak-text) 6%, var(--wak-text) 94%, transparent);
}

.wak-marquee__track {
	display: flex;
	inline-size: max-content;
	animation: wak-marquee 36s linear infinite;
}

.wak-marquee__group {
	display: flex;
	flex: none;
	align-items: center;
	gap: 64px;
	padding-inline-end: 64px;
	white-space: nowrap;
}

[data-marquee]:hover .wak-marquee__track,
[data-marquee]:focus-within .wak-marquee__track { animation-play-state: paused; }

@keyframes wak-marquee {
	to { transform: translateX(-50%); }
}

:root[dir="rtl"] .wak-marquee__track { animation-name: wak-marquee-rtl; }

@keyframes wak-marquee-rtl {
	to { transform: translateX(50%); }
}

/* Motion. The wak-motion class exists only with JS and no reduced-motion preference. */

.wak-motion [data-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .9s var(--wak-ease), transform .9s var(--wak-ease);
}

.wak-motion a.wak-card[data-reveal] {
	transition: opacity .9s var(--wak-ease), transform .9s var(--wak-ease), background-color .35s var(--wak-ease), color .35s var(--wak-ease);
}

.wak-motion [data-reveal].is-in {
	opacity: 1;
	transform: none;
}

.wak-motion .wak-grid-3 > [data-reveal]:nth-child(3n + 2) { transition-delay: .08s, .08s, 0s, 0s; }
.wak-motion .wak-grid-3 > [data-reveal]:nth-child(3n) { transition-delay: .16s, .16s, 0s, 0s; }

/* If motion.js never arrives, nothing stays hidden. */
.wak-motion:not(.wak-ready) [data-reveal] { animation: wak-show 0s 3s forwards; }

@keyframes wak-show {
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}
	[data-reveal] {
		opacity: 1 !important;
		transform: none !important;
	}
}
