/* ==========================================================================
   Faraz Design — global styles (child theme)
   Tokens, fonts, base typography, header, menu, footer, 404, motion.
   Section and case-study components live in the plugin (core.css) and read
   these tokens.
   ========================================================================== */

@font-face {
	font-family: "Archivo";
	src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
	font-family: "IBM Plex Mono";
	src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Mono";
	src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-display: swap;
}

:root {
	--fd-ink: #0e0d0c;
	--fd-ink-2: #1c1a18;
	--fd-paper: #f3eee6;
	--fd-paper-2: #e8e0d3;
	--fd-accent: #e4411b;
	--fd-accent-2: #ff7a2f;
	--fd-muted: #69645c;
	--fd-muted-dark: #aaa397;
	--fd-muted-on-card: #57524b; /* secondary text on paper-2 (AA) */
	--fd-line: rgba(14, 13, 12, 0.16);
	--fd-line-dark: rgba(243, 238, 230, 0.18);

	--fd-font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
	--fd-font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--fd-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
	--fd-font-fa: "Vazirmatn", "Noto Naskh Arabic", Tahoma, sans-serif;

	--fd-fs-display: clamp(2.9rem, 0.9rem + 8.6vw, 10.5rem);
	--fd-fs-h1: clamp(2.25rem, 1.2rem + 4vw, 5.5rem);
	--fd-fs-h2: clamp(1.75rem, 1.1rem + 2.2vw, 3.25rem);
	--fd-fs-h3: clamp(1.15rem, 1rem + 0.5vw, 1.5rem);
	--fd-fs-lead: clamp(1.05rem, 0.98rem + 0.35vw, 1.3rem);
	--fd-fs-body: 1.0625rem;
	--fd-fs-small: 0.875rem;
	--fd-fs-label: 0.75rem;

	--fd-gutter: clamp(16px, 4vw, 48px);
	--fd-section: clamp(56px, 6.5vw, 112px);
	--fd-max: 1680px;
	--fd-header-h: 72px;
	--fd-radius: 0;
	--fd-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
	--fd-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

	/* v1.1 — 4px spacing scale and type ramp (layout rhythm informed by Clay; see DESIGN.md) */
	--fd-space-1: 4px;
	--fd-space-2: 8px;
	--fd-space-3: 12px;
	--fd-space-4: 16px;
	--fd-space-6: 24px;
	--fd-space-8: 32px;
	--fd-space-12: 48px;
	--fd-space-16: 64px;
	--fd-space-24: 96px;
	--fd-space-section: clamp(64px, 4rem + 2.6vw, 96px);
	--fd-space-card: clamp(24px, 1rem + 1.2vw, 32px);
	--fd-content-max: 1280px;
	--fd-fs-display-xl: clamp(2.5rem, 1.1rem + 4vw, 4.5rem);
	--fd-fs-display-lg: clamp(2rem, 1.35rem + 2.2vw, 3.5rem);
	--fd-fs-display-md: clamp(1.75rem, 1.25rem + 1.6vw, 2.75rem);
	--fd-fs-title-lg: clamp(1.25rem, 1.1rem + 0.4vw, 1.5rem);
	--fd-fs-title-md: 1.125rem;
}

@media (max-width: 767px) {
	:root { --fd-header-h: 60px; }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--fd-header-h) + 16px); }
body.fd-site {
	margin: 0;
	background: var(--fd-paper);
	color: var(--fd-ink);
	font-family: var(--fd-font-text);
	font-size: var(--fd-fs-body);
	line-height: 1.6;
	font-feature-settings: "ss01", "cv11";
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
	padding-top: var(--fd-header-h);
}
/* Pages that open with an overlay-ready section let the header float over it. */
body.fd-site:has(.fd-under-header) { padding-top: 0; }

.fd-site img, .fd-site video { max-width: 100%; height: auto; display: block; }
.fd-site a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.fd-site a:hover { text-decoration-color: var(--fd-accent); }
.fd-site :focus-visible { outline: 3px solid var(--fd-accent); outline-offset: 3px; }
.fd-site ::selection { background: var(--fd-accent); color: var(--fd-ink); }
.fd-site h1, .fd-site h2, .fd-site h3, .fd-site h4 { margin: 0; color: inherit; }
.fd-site p { margin: 0 0 1em; }

.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; z-index: 1000; top: 8px; left: 8px; padding: 12px 18px; background: var(--fd-accent); color: var(--fd-ink); font-weight: 600; }

#fd-main { position: absolute; top: var(--fd-header-h); outline: none; }

/* ---------- Type helpers (shared with plugin) ------------------------------ */

.fd-wrap { width: 100%; max-width: var(--fd-max); margin-inline: auto; padding-inline: var(--fd-gutter); box-sizing: border-box; }
.fd-eyebrow {
	font-family: var(--fd-font-mono);
	font-size: var(--fd-fs-label);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0 0 1.25rem;
	display: inline-flex;
	align-items: center;
	gap: 0.75em;
}
.fd-eyebrow::before { content: ""; width: 0.6em; height: 0.6em; background: var(--fd-accent); flex: none; }
.fd-display, .fd-h1, .fd-h2, .fd-h3 { font-family: var(--fd-font-display); font-weight: 800; font-stretch: var(--fd-wdth-xl, 112%); letter-spacing: -0.02em; text-wrap: balance; }
.fd-display { font-size: var(--fd-fs-display); line-height: 0.9; text-transform: var(--fd-display-case, uppercase); letter-spacing: -0.035em; }
.fd-h1 { font-size: var(--fd-fs-h1); line-height: 0.95; text-transform: var(--fd-display-case, uppercase); letter-spacing: -0.03em; }
.fd-h2 { font-size: var(--fd-fs-h2); line-height: 1; }
.fd-h3 { font-size: var(--fd-fs-h3); line-height: 1.1; font-weight: 750; font-stretch: var(--fd-wdth-m, 105%); letter-spacing: -0.01em; }
.fd-accent { font-style: normal; color: var(--fd-accent); }
.fd-lead { font-size: var(--fd-fs-lead); line-height: 1.45; max-width: 38ch; text-wrap: pretty; }
.fd-label { font-family: var(--fd-font-mono); font-size: var(--fd-fs-label); letter-spacing: 0.08em; text-transform: uppercase; }
.fd-muted { color: var(--fd-muted); }
.fd-theme-dark .fd-muted, [data-fd-theme="dark"] .fd-muted { color: var(--fd-muted-dark); }
.fd-fa, [lang="fa"] { font-family: var(--fd-font-fa); direction: rtl; unicode-bidi: isolate; line-height: 1.9; }

/* ---------- Buttons & links ----------------------------------------------- */

.fd-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.75em;
	min-height: 52px;
	padding: 0 1.5em;
	font-family: var(--fd-font-mono);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	background: var(--fd-ink);
	color: var(--fd-paper) !important;
	border: 1px solid var(--fd-ink);
	transition: background 0.25s var(--fd-ease), color 0.25s var(--fd-ease), border-color 0.25s;
	cursor: pointer;
}
.fd-btn:hover { background: var(--fd-accent); border-color: var(--fd-accent); color: var(--fd-ink) !important; }
.fd-btn--accent { background: var(--fd-accent); border-color: var(--fd-accent); color: var(--fd-ink) !important; }
.fd-btn--accent:hover { background: var(--fd-paper); border-color: var(--fd-paper); }
.fd-btn--ghost { background: transparent; color: inherit !important; border-color: currentColor; }
.fd-btn .fd-icon, .fd-link-arrow .fd-icon { width: 1.25em; height: 1.25em; transition: transform 0.3s var(--fd-ease); }
.fd-btn:hover .fd-icon, .fd-link-arrow:hover .fd-icon { transform: translateX(4px); }
.fd-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	min-height: 44px;
	font-family: var(--fd-font-mono);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	border-bottom: 1px solid currentColor;
}
.fd-link-arrow:hover { color: var(--fd-accent); }

/* ---------- Header ---------------------------------------------------------- */

.fd-header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 100;
	color: var(--fd-ink);
	transition: color 0.35s var(--fd-ease), background-color 0.35s var(--fd-ease), transform 0.4s var(--fd-ease);
}
.fd-header::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--fd-paper);
	opacity: 1;
	transition: opacity 0.35s var(--fd-ease), background-color 0.35s;
	z-index: -1;
	border-bottom: 1px solid var(--fd-line);
}
.fd-js .fd-header:not(.is-scrolled)::before { opacity: 0; }
.fd-header[data-theme="dark"] { color: var(--fd-paper); }
.fd-header[data-theme="dark"]::before { background: var(--fd-ink); border-color: var(--fd-line-dark); }
.fd-header.is-hidden { transform: translateY(-100%); }
.fd-header__bar {
	height: var(--fd-header-h);
	display: flex;
	align-items: center;
	gap: clamp(16px, 3vw, 48px);
	max-width: var(--fd-max);
	margin-inline: auto;
	padding-inline: max(var(--fd-gutter), env(safe-area-inset-left)) max(var(--fd-gutter), env(safe-area-inset-right));
	box-sizing: border-box;
}
.fd-logo { display: inline-flex; align-items: center; text-decoration: none !important; margin-right: auto; min-height: 44px; position: relative; min-width: 0; max-width: 100%; }
.fd-logo__img { height: clamp(28px, 3.2vw, 40px); width: auto; }
.fd-logo__img--paper { position: absolute; left: 0; top: 50%; transform: translateY(-50%); opacity: 0; }
.fd-header[data-theme="dark"] .fd-logo__img--paper { opacity: 1; }
.fd-header[data-theme="dark"] .fd-logo__img--ink:not(:only-child) { opacity: 0; }
.fd-logo { gap: 10px; }
.fd-logo__mark { width: 36px; height: auto; flex: none; }
.fd-logo__text { font-family: var(--fd-font-display); font-weight: 750; font-stretch: var(--fd-wdth-l, 108%); font-size: 1.0625rem; letter-spacing: -0.01em; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fd-nav__list { display: flex; gap: clamp(20px, 2.6vw, 44px); list-style: none; margin: 0; padding: 0; }
.fd-nav__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--fd-font-mono);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	position: relative;
}
.fd-nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px; background: var(--fd-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--fd-ease); }
.fd-nav__link:hover::after, .fd-nav__link[aria-current="page"]::after { transform: scaleX(1); }
.fd-header__cta {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 1.1em;
	font-family: var(--fd-font-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	background: var(--fd-accent);
	color: var(--fd-ink) !important;
}
.fd-header__cta:hover { background: currentColor; }
.fd-header__cta:hover { background: var(--fd-ink); color: var(--fd-paper) !important; }
.fd-header[data-theme="dark"] .fd-header__cta:hover { background: var(--fd-paper); color: var(--fd-ink) !important; }

.fd-header .fd-menu-toggle {
	display: none;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	min-width: 44px;
	padding: 0 4px;
	background: none;
	border: 0;
	color: inherit;
	font-family: var(--fd-font-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}
.fd-menu-toggle__icon { width: 22px; height: 10px; position: relative; }
.fd-menu-toggle__icon::before, .fd-menu-toggle__icon::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform 0.3s var(--fd-ease), top 0.3s; }
.fd-menu-toggle__icon::before { top: 0; }
.fd-menu-toggle__icon::after { top: 8px; }
.fd-menu-toggle[aria-expanded="true"] .fd-menu-toggle__icon::before { top: 4px; transform: rotate(45deg); }
.fd-menu-toggle[aria-expanded="true"] .fd-menu-toggle__icon::after { top: 4px; transform: rotate(-45deg); }

.fd-menu {
	position: fixed;
	inset: var(--fd-header-h) 0 0;
	background: var(--fd-ink);
	color: var(--fd-paper);
	padding: 32px var(--fd-gutter) 40px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.fd-menu[hidden] { display: none; }
.fd-menu__list { list-style: none; margin: 0; padding: 0; }
.fd-menu__list a {
	display: block;
	padding: 6px 0;
	font-family: var(--fd-font-display);
	font-weight: 800;
	font-stretch: var(--fd-wdth-xl, 112%);
	font-size: clamp(2.6rem, 14vw, 5rem);
	line-height: 1;
	text-transform: var(--fd-display-case, uppercase);
	letter-spacing: -0.03em;
	text-decoration: none !important;
}
.fd-menu__list a[aria-current="page"] { color: var(--fd-accent); }
.fd-menu__meta { font-family: var(--fd-font-mono); font-size: 0.8125rem; color: var(--fd-muted-dark); }
.fd-menu__meta a { color: var(--fd-paper); }
.fd-menu.is-open .fd-menu__list li { animation: fd-menu-in 0.5s var(--fd-ease-out) both; animation-delay: calc(var(--i) * 50ms); }
@keyframes fd-menu-in { from { opacity: 0; transform: translateY(18px); } }
body.fd-menu-open { overflow: hidden; }
body.fd-menu-open .fd-header { color: var(--fd-paper); }
body.fd-menu-open .fd-header::before { opacity: 1 !important; background: var(--fd-ink); }

@media (max-width: 900px) {
	.fd-js .fd-nav, .fd-js .fd-header__cta { display: none; }
	.fd-js .fd-menu-toggle { display: inline-flex; }
	.fd-nav__list { gap: 16px; }
}
@media (max-width: 900px) {
	html:not(.fd-js) .fd-header__bar { flex-wrap: wrap; height: auto; padding-block: 8px; }
	html:not(.fd-js) .fd-header__cta { display: none; }
}

/* ---------- Footer ---------------------------------------------------------- */

.fd-footer { background: var(--fd-ink); color: var(--fd-paper); padding: clamp(48px, 6vw, 80px) 0 32px; }
.fd-footer a { color: var(--fd-paper); }
.fd-footer__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--fd-line-dark); }
.fd-footer__statement { font-family: var(--fd-font-display); font-weight: 800; font-stretch: var(--fd-wdth-xl, 112%); font-size: var(--fd-fs-h2); line-height: 1; letter-spacing: -0.025em; max-width: 16ch; margin: 0; text-wrap: balance; }
.fd-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(auto-fit, minmax(160px, 1fr)); gap: 32px 40px; padding: 0 0 48px; }
.fd-footer__id .fd-logo { margin-bottom: 16px; }
.fd-footer__id p { color: var(--fd-muted-dark); }
.fd-footer__email { font-size: 1.0625rem; color: var(--fd-paper) !important; border-bottom: 1px solid var(--fd-accent) !important; }
@media (max-width: 700px) { .fd-footer__grid { grid-template-columns: 1fr 1fr; } .fd-footer__id { grid-column: 1 / -1; } }
.fd-footer__label { font-family: var(--fd-font-mono); font-size: var(--fd-fs-label); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fd-muted-dark); margin-bottom: 16px !important; }
.fd-footer__list { list-style: none; padding: 0; margin: 0; }
.fd-footer__list li { margin: 0 0 6px; }
.fd-footer__list a, .fd-footer__grid p a { display: inline-block; padding: 4px 0; text-decoration: none; border-bottom: 1px solid transparent; }
.fd-footer__list a:hover, .fd-footer__grid p a:hover { border-color: var(--fd-accent); }
.fd-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--fd-line-dark); font-size: var(--fd-fs-small); color: var(--fd-muted-dark); }
.fd-footer__legal p { margin: 0; max-width: 70ch; }

/* ---------- 404 ------------------------------------------------------------- */

.fd-404 { background: var(--fd-ink); color: var(--fd-paper); min-height: 80vh; padding: calc(var(--fd-header-h) + var(--fd-section)) 0 var(--fd-section); }
.fd-404 .fd-display { max-width: 12ch; margin-bottom: 32px; }
.fd-404__links { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 16px 40px; }

/* ---------- Generic page content (privacy, plain pages) -------------------- */

.fd-site .page-content, .fd-site .site-main:not(.fd-404) { max-width: 760px; margin-inline: auto; padding: var(--fd-section) var(--fd-gutter); }
.fd-site .page-header .entry-title { font-family: var(--fd-font-display); font-weight: 800; font-stretch: var(--fd-wdth-xl, 112%); font-size: var(--fd-fs-h1); line-height: 0.95; text-transform: uppercase; letter-spacing: -0.03em; margin-bottom: 40px; }
.fd-site .page-content h2 { font-family: var(--fd-font-display); font-weight: 750; font-stretch: var(--fd-wdth-l, 108%); font-size: var(--fd-fs-h3); margin: 2.2em 0 0.6em; }
.fd-site .page-content li { margin-bottom: 0.4em; }

/* Elementor full-width pages: remove gaps between our full-bleed sections. */
.elementor .e-con.fd-stack, .elementor .e-con:has(> .elementor-widget[class*="elementor-widget-fd-"]) { --padding-top: 0px; --padding-bottom: 0px; --padding-left: 0px; --padding-right: 0px; --gap: 0px; --content-width: 100%; }
.elementor-widget[class*="elementor-widget-fd-"] { width: 100%; }

/* ---------- Motion ---------------------------------------------------------- */

.fd-js [data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 0.9s var(--fd-ease-out), transform 1.1s var(--fd-ease-out); transition-delay: var(--d, 0ms); }
.fd-js [data-reveal].is-in { opacity: 1; transform: none; }
/* Mask reveal: a wipe panel slides away. Nothing is clipped, so the figure
   still intersects (reveal fires) and its lazy image still loads. */
.fd-js [data-reveal="mask"] { opacity: 1; transform: none; position: relative; }
.fd-js [data-reveal="mask"]::after { content: ""; position: absolute; inset: 0; background: var(--fd-wipe, var(--fd-paper)); transform-origin: bottom; transition: transform 1.1s var(--fd-ease-out); transition-delay: var(--d, 0ms); pointer-events: none; }
.fd-js .fd-theme-dark [data-reveal="mask"]::after, .fd-js [data-fd-theme="dark"] [data-reveal="mask"]::after { --fd-wipe: var(--fd-ink); }
.fd-js [data-reveal="mask"].is-in::after { transform: scaleY(0); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
	.fd-js [data-reveal], .fd-js [data-reveal="mask"] { opacity: 1; transform: none; }
	.fd-js [data-reveal="mask"]::after { display: none; }
}

/* Hello Elementor's reset styles every <button> pink; neutralise for ours. */
.fd-header .fd-menu-toggle:hover, .fd-header .fd-menu-toggle:focus { background: none; color: inherit; }
.fd-site button.fd-btn { font-family: var(--fd-font-mono); border-radius: 0; }

/* Without JS the nav wraps under the logo; keep the header in flow so it never covers content. */
html:not(.fd-js) .fd-header { position: relative; }
html:not(.fd-js) body.fd-site { padding-top: 0; }
