/*!
 * Dark mode for the homepage (shared parts: css/site-theme.css).
 * Light mode is the homepage as designed (its dark/light rhythm: hero, services and portfolio are dark by design),
 * so only the light sections are re-coloured here: «چرا رنگ پنجم», testimonials, brands and the contact section.
 */
html[data-theme="dark"] .sec-title h2.rp-h1 { color: #f2f2f5; }
html[data-theme="dark"] .sec-title p { color: #a3a3ac; }

/* ------------------------------------------------------------------ «چرا رنگ پنجم» (content side) */
html[data-theme="dark"] .rp-about {
	--rp-ink: #f2f2f5; --rp-muted: #a3a3ac; --rp-line: rgba(255, 255, 255, .09);
	--rp-surface: #18181b; --rp-bg: #111113;
}
html[data-theme="dark"] .rp-content { background: radial-gradient(520px 320px at 0% 0%, rgba(251, 72, 72, .09), transparent 70%), #111113; }
html[data-theme="dark"] .rp-pane::before { -webkit-text-stroke-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .rp-about .rp-lead,
html[data-theme="dark"] .rp-mile p,
html[data-theme="dark"] .rp-faq-a p { color: #b9b9c1; }
html[data-theme="dark"] .rp-stat:hover { box-shadow: 0 22px 40px -22px rgba(0, 0, 0, .9); }
html[data-theme="dark"] .rp-step-node { border-color: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 7px #202024, 0 18px 34px -22px rgba(0, 0, 0, .9); }
html[data-theme="dark"] .rp-link-base { fill: rgba(255, 255, 255, .22); }
html[data-theme="dark"] .rp-link-head { stroke: rgba(255, 255, 255, .35); }
html[data-theme="dark"] .rp-years-line { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .rp-year { color: rgba(255, 255, 255, .4); }
html[data-theme="dark"] .rp-year::after { border-color: rgba(255, 255, 255, .25); }
html[data-theme="dark"] .rp-year.is-past { color: rgba(255, 255, 255, .62); }
html[data-theme="dark"] .rp-year.is-active { color: #f2f2f5; }
html[data-theme="dark"] .rp-year.is-active::after { background: #111113; }
html[data-theme="dark"] .rp-faq-q i { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .rp-faq-item.is-open { box-shadow: 0 18px 36px -24px rgba(251, 72, 72, .35); }

/* ------------------------------------------------------------------ testimonials */
html[data-theme="dark"] .rp-tm { --tm-ink: #f2f2f5; --tm-muted: #a3a3ac; --tm-line: rgba(255, 255, 255, .09); background: #0f0f11; }
html[data-theme="dark"] .rp-tm-stage { background: #18181b; }
html[data-theme="dark"] .rp-tm-tags li { background: #222226; }
html[data-theme="dark"] .rp-tm-nav { background: #18181b; }
html[data-theme="dark"] .rp-tm-rail button[aria-selected="true"] { background: #232327; }
html[data-theme="dark"] .rp-tm-arrows button { background: #18181b; }
/* logos with a white background: shown light-on-dark (white turns black and drops out) */
html[data-theme="dark"] .rp-tm-rail img,
html[data-theme="dark"] .rp-tm-logo { filter: grayscale(1) invert(1); }
html[data-theme="dark"] .rp-tm-doc--logo .rp-tm-paper img { mix-blend-mode: normal; }
html[data-theme="dark"] .rp-tm-rail button:hover img,
html[data-theme="dark"] .rp-tm-rail button:focus-visible img,
html[data-theme="dark"] .rp-tm-rail button[aria-selected="true"] img { filter: grayscale(1) invert(1) brightness(1.25); }
/* the letter keeps its paper look; the panel around it goes dark */
html[data-theme="dark"] .rp-tm-doc { background: radial-gradient(circle at 50% 42%, rgba(251, 72, 72, .14), transparent 62%), #1d1d21; }

/* ------------------------------------------------------------------ brands */
html[data-theme="dark"] .rp-br { --br-ink: #f2f2f5; --br-line: rgba(255, 255, 255, .09); background: #0f0f11; }
html[data-theme="dark"] .rp-br-toggle { background: #18181b; }
html[data-theme="dark"] .rp-br-toggle:hover { background: #f2f2f5; border-color: #f2f2f5; color: #151517; }
html[data-theme="dark"] .rp-br-logo { background: #18181b; transition: background-color .35s, border-color .3s, box-shadow .4s, transform .4s; }
html[data-theme="dark"] .rp-br-logo img { filter: grayscale(1) invert(1); mix-blend-mode: screen; opacity: .6; }
/* on hover the card lights up and the logo shows in its own colours */
html[data-theme="dark"] .rp-br-logo:hover, html[data-theme="dark"] .rp-br-logo:focus-visible { background: #fff; }
html[data-theme="dark"] .rp-br-logo:hover img, html[data-theme="dark"] .rp-br-logo:focus-visible img { filter: none; mix-blend-mode: normal; opacity: 1; }

/* ------------------------------------------------------------------ contact (map + details; the form card is dark already) */
html[data-theme="dark"] .rp-ct { --ct-ink: #f2f2f5; --ct-muted: #a3a3ac; --ct-line: rgba(255, 255, 255, .09); background: #0f0f11; }
html[data-theme="dark"] .rp-ct .rp-live-pill,
html[data-theme="dark"] .rp-ct-place,
html[data-theme="dark"] .rp-ct-copy { background: #18181b; }
html[data-theme="dark"] .rp-ct .rp-live-text b { color: #f2f2f5; }
html[data-theme="dark"] .rp-ct .rp-live-text small { color: #a3a3ac; }
html[data-theme="dark"] .rp-ct-copy:hover { background: #f2f2f5; border-color: #f2f2f5; color: #151517; }
html[data-theme="dark"] .rp-ct-map { background: #1b1b1e; }

html[data-theme="dark"] .rp-ct-routes { background: rgba(24, 24, 27, .86); }
html[data-theme="dark"] .rp-ct-routes a:hover { background: #f2f2f5; color: #151517 !important; }
html[data-theme="dark"] .rp-ct-label { background: #f2f2f5; color: #151517; }
html[data-theme="dark"] .rp-ct-label::after { border-top-color: #f2f2f5; }
html[data-theme="dark"] .rp-ct-pin { border-color: #18181b; }

/* ------------------------------------------------------------------ خدمات ما (home services)
   Follows the light / dark toggle: LIGHT = white section with dark headings; DARK = the original dark section.
   The service cards are dark photo cards in both modes (same as the /services/ list page). */
html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) { background-color: #ffffff; }
html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .sec-title p { color: #6b6b72; }
html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .sec-title h2.rp-h1 { color: #29292B; }
html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .sec-title h2.rp-h1 .highlight-red { color: #fb4848; }
html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc { box-shadow: 0 24px 44px -30px rgba(20, 20, 24, .55); }
html[data-theme="dark"] .services-area.rp-services-home:not(.rp-svc-list) { background-color: #151517; }
.services-area.rp-services-home { transition: background-color .4s ease; }
.services-area.rp-services-home .sec-title h2.rp-h1, .services-area.rp-services-home .sec-title p { transition: color .4s ease; }

/* logo wall: the "View project" pill sits on the card that turns white on hover; keep it dark so it stays readable */
html[data-theme="dark"] .rp-br-tip { background: #29292B; color: #fff; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35); }

/* home services, light mode, stacked cards (phones and touch tablets): the card text is made for the dark glass
   panel of the mouse layout, so here the card becomes a light card with dark text, readable on the white section */
@media (max-width: 767px), (hover: none) {
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc {
		overflow: hidden; border: 1px solid #ececf0; border-radius: 18px; background: #fff;
	}
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc .text-holder { padding: 34px 18px 18px; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc .text h3,
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc .text h3 a { color: #29292B; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-body .svc-sum { color: #6b6b72; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-body .svc-tags { border-top-color: #ececf0; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-body .svc-tags li { color: #55555c; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-btn { color: #29292B !important; border-color: #e2e2e6; background: #f6f6f8; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-btn .rp-svc-btn-ico { color: #fff; }
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-btn:hover,
	html:not([data-theme="dark"]) .services-area.rp-services-home:not(.rp-svc-list) .rp-svc-btn:focus-visible { color: #fff !important; }
}

/* ------------------------------------------------------------------ نمونه‌کارها (homepage showcase) in light mode
   The section was dark in both themes; in light mode it now sits on light paper like the services above it.
   The cards stay dark photos with white text (their own gradient keeps them readable). Dark mode keeps css/portfolio-home.css. */
html[data-theme="light"] #rp-portfolio:not(.rp-pf--archive) {
	background: radial-gradient(900px 420px at 85% 0%, rgba(251, 72, 72, .07), transparent 70%), #f6f6f7;
	color: #29292B;
}
html[data-theme="light"] #rp-portfolio .rp-pf-head .sec-title p { color: #6b6b72; }
html[data-theme="light"] #rp-portfolio .rp-pf-head .sec-title .rp-h1 { color: #29292B; }
html[data-theme="light"] #rp-portfolio .rp-pf-card { background: #e6e6ea; box-shadow: 0 22px 40px -30px rgba(20, 20, 24, .55); }
html[data-theme="light"] #rp-portfolio .rp-pf-veil { background: linear-gradient(180deg, rgba(246, 246, 247, 0) 0%, rgba(246, 246, 247, .72) 25%, rgba(246, 246, 247, .95) 55%, #f6f6f7 80%); }
html[data-theme="light"] #rp-portfolio .rp-pf-more-eyebrow { color: #6b6b72; }
html[data-theme="light"] #rp-portfolio .rp-pf-more h3 { color: #29292B; }
html[data-theme="light"] #rp-portfolio .rp-pf-more p { color: #5c5c62; }
html[data-theme="light"] #rp-portfolio .rp-pf-allbtn { background: #29292B; color: #fff !important; }
html[data-theme="light"] #rp-portfolio .rp-pf-allbtn:hover { box-shadow: 0 14px 30px -14px rgba(20, 20, 24, .55); }
html[data-theme="light"] #rp-portfolio .rp-pf-consult { background: #fff; box-shadow: inset 0 0 0 1px #e2e2e6; color: #29292B !important; }
html[data-theme="light"] #rp-portfolio .rp-pf-consult:focus-visible { outline-color: #fb4848; }
@media (max-width: 767px) {
	html[data-theme="light"] #rp-portfolio .rp-pf-veil { background: linear-gradient(180deg, rgba(246, 246, 247, 0) 0%, rgba(246, 246, 247, .86) 30%, #f6f6f7 55%); }
}

/* light mode: the faded last row of projects dissolves into the light paper (no dark card shadow under the veil) */
html[data-theme="light"] #rp-portfolio .rp-pf-grid.is-all .rp-pf-item:nth-child(n+10) .rp-pf-card {
	box-shadow: none;
	-webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 85%);
	mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 85%);
}
@media (max-width: 767px) {
	html[data-theme="light"] #rp-portfolio .rp-pf-grid.is-all .rp-pf-item:nth-child(n+9) .rp-pf-card {
		box-shadow: none;
		-webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 85%);
		mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 85%);
	}
}
