/* The public site on jannati.app: static, no JavaScript, same palette and face
   as the app (css/general.css, css/variables.css). The app itself lives on
   app.jannati.app; every call to action links there. */

@font-face {
	font-family: "Tajawal";
	src: url("fonts/Tajawal-Regular.woff2") format("woff2");
	font-weight: 400;
	size-adjust: 110%;
	ascent-override: 77%;
	descent-override: 23%;
	line-gap-override: 0%;
	font-display: swap;
}

@font-face {
	font-family: "Tajawal";
	src: url("fonts/Tajawal-Bold.woff2") format("woff2");
	font-weight: 700;
	size-adjust: 110%;
	ascent-override: 77%;
	descent-override: 23%;
	line-gap-override: 0%;
	font-display: swap;
}

:root {
	--bg: #faf7f2;
	--surface: #ffffff;
	--surface-3: #f1ebe1;
	--text: #1b1a17;
	--text-dim: #6a635a;
	--border: #e9e2d6;
	--accent-ink: #ab5902;
	--accent-grad: linear-gradient(135deg, #ff9843 0%, #e77b02 100%);
	--on-accent: #ffffff;
	/* The logo's theme colours: same values as css/general.css. */
	--brand-ink: #2a422b;
	--logo-deep: #2a422b;
	--logo-leaf: #628341;
	--logo-leaf-2: #5d7a42;
	--logo-house: none;
	--gutter: 16px;
	--measure: 1080px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #14120f;
		--surface: #1b1814;
		--surface-3: #2f2a22;
		--text: #f6f3ee;
		--text-dim: #a9a196;
		--border: #322c24;
		--accent-ink: #ffb784;
		--accent-grad: linear-gradient(135deg, #ff9c4e 0%, #ffb784 100%);
		--on-accent: #241706;
		--brand-ink: #f6f3ee;
		--logo-deep: #2a422b;
		--logo-leaf: #7fa65a;
		--logo-leaf-2: #7fa65a;
		--logo-house: #f6f3ee;
	}
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;

	/* "How it works" is an in-page link; glide to it, unless the visitor has
	   asked their system for less motion. */
	@media (prefers-reduced-motion: no-preference) {
		scroll-behavior: smooth;
	}
}

/* Land a little below the top edge rather than flush against it. */
[id] {
	scroll-margin-top: 16px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 17px/1.55 "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	display: grid;
	grid-template-rows: auto 1fr auto;
	min-height: 100dvh;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.2;
	font-weight: 700;
}

p {
	margin: 0;
}

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

a {
	color: var(--accent-ink);
}

/* One centred column for every band; each band is its own grid. */
.wrap {
	width: min(100% - 2 * var(--gutter), var(--measure));
	margin-inline: auto;
}

.btn {
	display: inline-grid;
	place-items: center;
	min-height: 48px;
	padding: 0 24px;
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	background: var(--accent-grad);
	color: var(--on-accent);
	transition: filter 0.15s, box-shadow 0.15s, border-color 0.15s, background-color 0.15s, transform 0.1s;

	/* A gradient can't fade to another colour, so the hover darkens it and lifts it. */
	&:hover {
		filter: brightness(0.93);
		box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-ink) 30%, transparent);
	}

	&:active { transform: scale(0.97); }

	&:focus-visible {
		outline: 2px solid var(--accent-ink);
		outline-offset: 2px;
	}

	&.btn--quiet {
		background: var(--surface);
		color: var(--text);
		border: 1px solid var(--border);

		&:hover {
			filter: none;
			box-shadow: none;
			border-color: var(--accent-ink);
			background-color: color-mix(in srgb, var(--accent-ink) 8%, var(--surface));
		}
	}

	&.btn--sm {
		min-height: 40px;
		padding: 0 18px;
		font-size: 15px;
	}
}

/* ---- Header ---- */
.site-head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 12px;
	padding-block: 12px;

	.logo {
		display: grid;
		grid-template-columns: auto auto;
		align-items: center;
		gap: 8px;

		/* Inline SVG (js/brand.js), coloured by the --logo-* variables above.
		   The aspect ratios are the viewBoxes'. */
		svg {
			display: block;
			height: 40px;
			aspect-ratio: 461.58 / 350.17;
		}

		svg + svg {
			height: 30px;
			aspect-ratio: 538.8 / 173.4;
		}
	}

	/* Logo, name, language and button share one row: smaller on a phone, and
	   on the narrowest the logo goes without the name. */
	@media (max-width: 30rem) {
		gap: 6px;

		.logo {
			gap: 6px;

			svg { height: 32px; }
			svg + svg { height: 22px; }
		}

		a.lang { padding-inline: 4px; }
		.btn { padding-inline: 14px; }
	}

	@media (max-width: 22rem) {
		.logo svg + svg { display: none; }
	}

	.lang {
		grid-column: 3;
		color: var(--text);
		text-decoration: none;
		font-weight: 700;
		padding: 8px;
	}
}

/* ---- Hero: the copy sits on the illustration's empty side ---- */
.hero {
	display: grid;
	grid-template-areas: "stack";
	border-radius: 24px;
	overflow: hidden;
	background: var(--surface-3);

	>* {
		grid-area: stack;
	}

	.hero-art img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: right center;
	}

	.hero-copy {
		position: relative;
		/* the flipped art (Arabic) is transformed, and would paint over it */
		display: grid;
		align-content: center;
		justify-items: start;
		gap: 16px;
		padding: 40px;
		max-width: 520px;
	}

	h1 {
		font-size: clamp(30px, 4.6vw, 46px);
	}

	.lede {
		color: var(--text-dim);
		font-size: 18px;
	}

	.actions {
		display: grid;
		grid-auto-flow: column;
		gap: 12px;
	}
}

/* The art's empty wall is on the left; in Arabic the copy starts on the right. */
[dir="rtl"] .hero .hero-art img {
	transform: scaleX(-1);
}

@media (max-width: 720px) {
	.hero {
		grid-template-areas: "copy" "art";

		.hero-copy {
			grid-area: copy;
			padding: 28px 20px 8px;
			max-width: none;
		}

		.hero-art {
			grid-area: art;
		}

		.hero-art img {
			aspect-ratio: 2 / 1;
			object-position: 75% center;
		}

		.actions {
			grid-auto-flow: row;
			justify-items: start;
		}
	}

	[dir="rtl"] .hero .hero-art img {
		object-position: 25% center;
	}
}

/* ---- Bands ---- */
main {
	display: grid;
	gap: 64px;
	padding-block: 8px 64px;
}

.band {
	display: grid;
	gap: 24px;

	>header {
		display: grid;
		gap: 8px;
	}

	h2 {
		font-size: clamp(24px, 3.2vw, 32px);
	}

	.sub {
		color: var(--text-dim);
	}
}

.services {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	/* all seven on one row on desktop */
	gap: 16px;
	padding: 0;
	margin: 0;
	list-style: none;

	/* The card is the <li> for a coming-soon service, and the link inside it
	   for a bookable one, so the whole card is the tap target. */
	.soon,
	.live a {
		display: grid;
		grid-template-rows: auto auto minmax(0, 1fr);
		justify-items: center;
		gap: 8px;
		height: 100%;
		padding: 20px 12px;
		text-align: center;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: 20px;
	}

	img {
		width: 72px;
		height: 72px;
	}

	h3 {
		font-size: 18px;
	}

	.state {
		font-size: 14px;
		color: var(--text-dim);
	}

	.live a {
		color: inherit;
		text-decoration: none;
		border-color: var(--accent-ink);

		&:hover h3 {
			text-decoration: underline;
		}
	}

	.soon img {
		opacity: 0.6;
	}
}

/* ---- A service's page ---- */
.svc-top {
	display: grid;
	gap: 16px;
}

.crumbs {
	display: grid;
	grid-auto-flow: column;
	justify-content: start;
	gap: 8px;
	font-size: 15px;
	color: var(--text-dim);

	a {
		color: var(--text-dim);
	}

	a::after {
		content: "›";
		margin-inline-start: 8px;
	}

	[dir="rtl"] & a::after {
		content: "‹";
	}
}

.svc-hero {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 16px 32px;
	padding: 32px;
	border-radius: 24px;
	background: var(--surface-3);

	>img {
		width: 144px;
		height: 144px;
	}

	.svc-copy {
		display: grid;
		justify-items: start;
		gap: 12px;
	}

	h1 {
		font-size: clamp(30px, 4.6vw, 44px);
	}

	.lede {
		color: var(--text-dim);
		font-size: 18px;
	}

	.area {
		color: var(--text-dim);
		font-size: 15px;
	}

	@media (max-width: 720px) {
		grid-template-columns: minmax(0, 1fr);
		padding: 24px 20px;

		>img {
			width: 112px;
			height: 112px;
		}
	}
}

/* Each option's choices, one per row, with a line of detail under some. */
.rows {
	display: grid;
	padding: 0;
	margin: 0;
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 20px;

	li {
		padding: 14px 20px;

		&+li {
			border-top: 1px solid var(--border);
		}
	}

	small {
		display: block;
		color: var(--text-dim);
		font-size: 14px;
	}
}

/* A service's rooms or jobs, and its add-ons: names only, in a compact grid. */
.names {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
	padding: 0;
	margin: 0;
	list-style: none;

	li {
		padding: 12px 16px;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: 14px;
	}
}

/* What a service covers ("What's included"): a tick, then the line. Two
   columns where there is room, one on a phone. */
.checks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 12px 24px;
	padding: 0;
	margin: 0;
	list-style: none;

	li {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		gap: 10px;
		align-items: start;

		&::before {
			content: "✓";
			color: var(--accent-ink);
			font-weight: 700;
		}
	}
}

.option {
	display: grid;
	gap: 12px;

	h3 {
		font-size: 18px;
	}
}

/* A service's questions: each one a row in the same card as .rows, the
   answer under its question. */
.faq {
	display: grid;
	margin: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 20px;

	>div {
		display: grid;
		gap: 6px;
		padding: 16px 20px;

		&+div {
			border-top: 1px solid var(--border);
		}
	}

	dt {
		font-weight: 700;
	}

	dd {
		margin: 0;
		color: var(--text-dim);
	}
}

.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	padding: 0;
	margin: 0;
	list-style: none;
	counter-reset: step;

	li {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas: "num title" "num text";
		align-content: start;
		/* a shorter card's rows must not stretch to the tallest one */
		column-gap: 14px;
		row-gap: 4px;
		padding: 20px;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: 20px;
		counter-increment: step;
		transition: border-color 0.15s, box-shadow 0.15s;

		/* Not a link, so only the border answers; a mouse only, or a tap on a
		   phone would leave the card lit. */
		@media (hover: hover) {
			&:hover {
				border-color: var(--accent-ink);
				box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-ink) 12%, transparent);
			}
		}

		&::before {
			grid-area: num;
			content: counter(step);
			display: grid;
			place-items: center;
			width: 36px;
			height: 36px;
			border-radius: 50%;
			background: var(--accent-grad);
			color: var(--on-accent);
			font-weight: 700;
		}
	}

	h3 {
		grid-area: title;
		font-size: 18px;
	}

	p {
		grid-area: text;
		color: var(--text-dim);
	}
}

.pros {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 16px 24px;
	padding: 28px;
	border-radius: 24px;
	background: var(--surface-3);

	.actions {
		display: grid;
		grid-auto-flow: column;
		gap: 12px;
	}

	@media (max-width: 720px) {
		grid-template-columns: minmax(0, 1fr);
		justify-items: start;

		.actions {
			grid-auto-flow: row;
			justify-items: start;
		}
	}
}

/* ---- Footer ---- */
.site-foot {
	border-top: 1px solid var(--border);
	padding-block: 24px;
	color: var(--text-dim);
	font-size: 15px;

	/* The © line takes the room; WhatsApp (when set) and the legal links sit
	   after it in content-sized columns, one under the other on a phone. */
	.wrap {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		grid-auto-flow: column;
		grid-auto-columns: auto;
		gap: 12px 24px;

		@media (max-width: 720px) {
			grid-auto-flow: row;
		}
	}

	nav {
		display: grid;
		grid-auto-flow: column;
		gap: 20px;
		justify-content: start;
	}

	a {
		color: var(--text-dim);
	}
}