/*
 * Portfolio Page Template — Samanvi Technologies
 * Paired with: page-templates/template-portfolio.php
 */

/* ════════════════════════════════
   GENERATEPRESS OVERRIDES
════════════════════════════════ */
body.page-template-page-templates-template-portfolio-php .site-content,
body.page-template-page-templates-template-portfolio-php .site-inner,
body.page-template-page-templates-template-portfolio-php #primary,
body.page-template-page-templates-template-portfolio-php .site-main,
body.page-template-page-templates-template-portfolio-php article,
body.page-template-page-templates-template-portfolio-php .inside-article {
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
	width: 100% !important;
}
body.page-template-page-templates-template-portfolio-php .entry-header,
body.page-template-page-templates-template-portfolio-php .entry-title,
body.page-template-page-templates-template-portfolio-php .entry-content,
body.page-template-page-templates-template-portfolio-php .post-image,
body.page-template-page-templates-template-portfolio-php .featured-image,
body.page-template-page-templates-template-portfolio-php .generate-featured-image,
body.page-template-page-templates-template-portfolio-php .page-header-image,
body.page-template-page-templates-template-portfolio-php .inside-page-hero,
body.page-template-page-templates-template-portfolio-php .generate-page-header,
body.page-template-page-templates-template-portfolio-php .entry-footer {
	display: none !important;
}
body.page-template-page-templates-template-portfolio-php .portfolio-wrapper {
	display: block;
	width: 100%;
	overflow-x: hidden;
}

/* ════════════════════════════════
   TOKENS
════════════════════════════════ */
:root {
	--pf-black: #091628;
	--pf-mid: #174060;
	--pf-light-bg: #edf5f8;
	--pf-white: #ffffff;
	--pf-muted: #6fa3c0;
	--pf-teal: #00a896;
	--pf-teal-dark: #028090;
	--pf-blue: #1f4e8a;
	--pf-blue-border: rgba(31, 78, 138, 0.22);
	--pf-radius-lg: 18px;
	--pf-shadow-card: 0 8px 32px rgba(9, 22, 40, 0.10);
	--pf-shadow-card-hover: 0 22px 56px rgba(9, 22, 40, 0.22);
}

.portfolio-wrapper * { box-sizing: border-box; }
.portfolio-wrapper a { color: inherit; text-decoration: none; }
.portfolio-wrapper img { display: block; max-width: 100%; }

/* ════════════════════════════════
   HERO
════════════════════════════════ */
.pf-hero {
	background: linear-gradient(135deg, #091628 0%, #0d2040 55%, #174060 100%);
	color: var(--pf-white);
	padding: 0 50px;
	position: relative;
	overflow: hidden;
	height: 100vh;
	height: 100dvh;
	min-height: 560px;
	max-height: 900px;
}
.pf-hero::before {
	content: "";
	position: absolute; inset: 0;
	background:
		radial-gradient(circle at 80% 20%, rgba(0, 168, 150, 0.18), transparent 40%),
		radial-gradient(circle at 15% 90%, rgba(31, 78, 138, 0.35), transparent 45%);
	pointer-events: none;
}
.pf-hero-inner {
	position: relative;
	max-width: 1280px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 60px;
	align-items: center;
	height: 100%;
}

.pf-hero-content { padding: 0 0 40px; position: relative; }

.pf-eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 14px;
	border: 1px solid rgba(0, 168, 150, 0.4);
	border-radius: 999px;
	font-family: "Space Grotesk", sans-serif;
	font-size: 0.72rem; font-weight: 500; letter-spacing: 1.5px;
	text-transform: uppercase; color: var(--pf-teal);
	background: rgba(0, 168, 150, 0.08);
	opacity: 0; transform: translateY(12px);
	animation: pfFadeUp 0.7s 0.1s ease forwards;
}
.pf-eyebrow::before {
	content: ""; width: 6px; height: 6px; border-radius: 50%;
	background: var(--pf-teal); box-shadow: 0 0 8px var(--pf-teal);
}

.pf-headline {
	font-family: "Space Grotesk", sans-serif;
	font-size: clamp(2.8rem, 4vw, 4.8rem);
	line-height: 1.05; font-weight: 700;
	letter-spacing: -2px;
	margin: 20px 0 18px;
	max-width: 680px;
	color: var(--pf-white);
}
.pf-headline .headline-line { display: block; overflow: hidden; }
.pf-headline .headline-line > span {
	display: inline-block;
	transform: translateY(110%);
	animation: pfRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.pf-headline .headline-line:nth-child(1) > span { animation-delay: 0.15s; }
.pf-headline .headline-line:nth-child(2) > span { animation-delay: 0.30s; }
.pf-headline .accent {
	color: transparent;
	background: linear-gradient(90deg, var(--pf-teal), #5ee0c4);
	-webkit-background-clip: text;
	background-clip: text;
}

.pf-hero-body {
	font-size: 0.97rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.78);
	max-width: 540px;
	margin: 0 0 36px;
	opacity: 0; transform: translateY(12px);
	animation: pfFadeUp 0.7s 0.55s ease forwards;
}

.pf-hero-stats {
	display: flex; gap: 48px; flex-wrap: wrap;
	padding-top: 28px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	opacity: 0; transform: translateY(12px);
	animation: pfFadeUp 0.7s 0.7s ease forwards;
}
.pf-stat-num {
	font-family: "Space Grotesk", sans-serif;
	font-size: 2.4rem; font-weight: 700; color: var(--pf-white);
	letter-spacing: -1.5px; line-height: 1;
}
.pf-stat-num .suffix { color: var(--pf-teal); }
.pf-stat-label {
	font-family: "Space Grotesk", sans-serif;
	font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase;
	color: var(--pf-muted); margin-top: 8px; font-weight: 500;
}

/* Hero visual */
.pf-hero-visual {
	position: relative;
	height: 100%;
	overflow: hidden;
	border-radius: 24px 24px 0 0;
}
.pf-hero-visual img {
	width: 100%; height: 100%;
	object-fit: cover;
	object-position: center top;
	filter: brightness(0.92) saturate(1.05);
	transform: scale(1.12);
	transition: transform 8s ease;
}
.pf-hero.is-loaded .pf-hero-visual img { transform: scale(1); }
.pf-hero-visual::before { content: none; }

/* wd-ai-visual orbital — CSS self-contained (home.css not loaded here) */
.pf-hero-content .wd-ai-visual {
	position: absolute;
	top: 0; right: 0;
	width: 150px; height: 150px;
	opacity: 0.55;
	pointer-events: none;
	z-index: 0;
}
.pf-hero-content .wd-ai-visual circle {
	fill: none;
	stroke: #00a896;
	stroke-width: 1;
	opacity: 0.35;
	transform-origin: center;
	animation: wdOrbit 18s linear infinite;
}
.pf-hero-content .wd-ai-visual circle:nth-child(2) { animation-duration: 24s; animation-direction: reverse; }
.pf-hero-content .wd-ai-visual circle:nth-child(3) { animation-duration: 30s; }
.pf-hero-visual .wd-ai-mark {
	opacity: 0.95;
	filter: drop-shadow(0 0 14px rgba(0, 168, 150, 0.55));
	transform-box: view-box;
	transform-origin: 140px 140px;
	animation: wdMarkBreath 4.5s ease-in-out infinite;
}
.pf-hero-content .wd-ai-visual .node {
	fill: #5ee0c4;
	stroke: none;
	transform-box: view-box;
	transform-origin: 140px 140px;
	animation: wdNodeOrbitOuter 22s linear infinite, wdNodeBlink 3s ease-in-out infinite;
}
.pf-hero-content .wd-ai-visual .node:nth-child(6) {
	animation: wdNodeOrbitMiddle 18s linear infinite reverse, wdNodeBlink 3s ease-in-out 0.5s infinite;
}
.pf-hero-content .wd-ai-visual .node:nth-child(7) {
	animation: wdNodeOrbitMiddle 18s linear infinite reverse, wdNodeBlink 3s ease-in-out 1s infinite;
}
.pf-hero-content .wd-ai-visual .node:nth-child(8) {
	animation: wdNodeOrbitMiddle 18s linear infinite reverse, wdNodeBlink 3s ease-in-out 1.5s infinite;
}
@keyframes wdOrbit       { to { transform: rotate(360deg); } }
@keyframes wdNodeOrbitOuter  { to { transform: rotate(360deg); } }
@keyframes wdNodeOrbitMiddle { to { transform: rotate(360deg); } }
@keyframes wdMarkBreath {
	0%, 100% { transform: scale(1);    opacity: 0.95; }
	50%      { transform: scale(1.06); opacity: 1;    }
}
@keyframes wdNodeBlink {
	0%, 100% { opacity: 0.4; r: 2; }
	50%      { opacity: 1;   r: 3.5; }
}
.pf-hero-visual::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to right, #091628 0%, transparent 28%),
		linear-gradient(to top, rgba(9, 22, 40, 0.5), transparent 40%);
	pointer-events: none;
}

.pf-hero-tag {
	position: absolute;
	bottom: 15%; right: 32px;
	z-index: 3;
	background: rgba(9, 22, 40, 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 14px 20px;
	border-radius: 14px;
	opacity: 0; transform: translateY(20px);
	animation: pfFadeUp 0.8s 1.1s ease forwards;
}
.pf-hero-tag-name {
	display: flex; align-items: center; gap: 8px;
	font-size: 13px; font-weight: 700; color: var(--pf-white);
}
.pf-hero-tag-name::before {
	content: ""; width: 8px; height: 8px; border-radius: 50%;
	background: var(--pf-teal); box-shadow: 0 0 10px var(--pf-teal);
	animation: pfPulse 2s ease-in-out infinite;
}
.pf-hero-tag-role {
	font-size: 11px; color: var(--pf-muted);
	letter-spacing: 0.06em; text-transform: uppercase;
	margin-top: 2px;
}

@keyframes pfFadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes pfRise   { to { transform: translateY(0); } }
@keyframes pfPulse  {
	0%, 100% { transform: scale(1); opacity: 1; }
	50%      { transform: scale(1.4); opacity: 0.6; }
}
@keyframes pfSpin   { to { transform: rotate(360deg); } }

/* ════════════════════════════════
   FILTER
════════════════════════════════ */
.pf-filter-section {
	background: var(--pf-light-bg);
	padding: 36px 50px 0;
	position: sticky; top: 0; z-index: 10;
	border-bottom: 1px solid var(--pf-blue-border);
}
.pf-filter-inner {
	max-width: 1200px; margin: 0 auto;
	display: flex; flex-wrap: wrap; gap: 8px;
	padding-bottom: 24px;
}
.pf-chip {
	padding: 9px 18px;
	border: 1.5px solid var(--pf-blue-border);
	background: var(--pf-white);
	border-radius: 999px;
	font-family: "Space Grotesk", sans-serif;
	font-size: 0.82rem; font-weight: 500;
	letter-spacing: 0.5px;
	color: var(--pf-mid);
	cursor: pointer;
	transition: all 0.2s ease;
}
.pf-chip:hover {
	border-color: var(--pf-teal); color: var(--pf-teal);
	transform: translateY(-1px);
}
.pf-chip.is-active {
	background: var(--pf-black);
	border-color: var(--pf-black);
	color: var(--pf-white);
}
.pf-chip .count {
	display: inline-block; margin-left: 6px;
	font-size: 11px; opacity: 0.55; font-weight: 500;
}

/* ════════════════════════════════
   GRID + FILTER ANIMATION
════════════════════════════════ */
.pf-grid-section {
	background: var(--pf-light-bg);
	padding: 48px 50px 100px;
}
.pf-grid {
	max-width: 1200px; margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	perspective: 1200px;
}
.pf-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: var(--pf-mid);
	font-family: "Space Grotesk", sans-serif;
}

.pf-card {
	position: relative;
	display: block;
	border-radius: var(--pf-radius-lg);
	overflow: hidden;
	background: var(--pf-white);
	box-shadow: var(--pf-shadow-card);
	aspect-ratio: 4 / 3;
	transform-origin: center center;
	transition:
		transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		box-shadow 0.35s ease,
		opacity 0.45s ease;
	will-change: transform, opacity;
}
.pf-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--pf-shadow-card-hover);
}

.pf-card.is-shuffling { animation: pfCardOut 0.45s cubic-bezier(0.55, 0, 0.7, 0.2) forwards; }
@keyframes pfCardOut {
	0%   { opacity: 1; transform: translateY(0) scale(1) rotateY(0) rotateX(0); filter: blur(0); }
	100% { opacity: 0; transform: translateY(40px) scale(0.55) rotateY(60deg) rotateX(-12deg); filter: blur(4px); }
}
.pf-card.is-entering { animation: pfCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
@keyframes pfCardIn {
	0%   { opacity: 0; transform: translateY(60px) scale(0.7) rotateY(-45deg); filter: blur(6px); }
	60%  { opacity: 1; filter: blur(0); }
	100% { opacity: 1; transform: translateY(0) scale(1) rotateY(0); filter: blur(0); }
}
.pf-card.is-hidden { display: none; }

.pf-card-thumb-wrap {
	width: 100%; height: 100%;
	overflow: hidden;
	position: relative;
}
.pf-card-thumb {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.pf-card:hover .pf-card-thumb { transform: scale(1.07); }

.pf-card::after {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(180deg, transparent 50%, rgba(9, 22, 40, 0.82) 100%);
	opacity: 0; transition: opacity 0.3s ease;
	pointer-events: none;
}
.pf-card:hover::after { opacity: 1; }

.pf-card-info {
	position: absolute; left: 18px; right: 18px; bottom: 18px;
	z-index: 3;
	opacity: 0; transform: translateY(10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}
.pf-card:hover .pf-card-info { opacity: 1; transform: translateY(0); }
.pf-card-title {
	font-family: "Space Grotesk", sans-serif;
	color: var(--pf-white); font-size: 1.05rem; font-weight: 600;
	letter-spacing: -0.3px; margin-top: 4px;
}
.pf-card-cat {
	font-family: "Space Grotesk", sans-serif;
	color: var(--pf-teal); font-size: 0.65rem; font-weight: 500;
	text-transform: uppercase; letter-spacing: 1.5px;
}
.pf-card-visit {
	position: absolute; top: 18px; right: 18px;
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px;
	background: var(--pf-teal);
	color: var(--pf-white);
	border-radius: 999px;
	font-family: "Space Grotesk", sans-serif;
	font-size: 0.68rem; font-weight: 500; letter-spacing: 1.2px;
	text-transform: uppercase;
	opacity: 0; transform: translateY(-6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 3;
}
.pf-card:hover .pf-card-visit { opacity: 1; transform: translateY(0); }

/* ════════════════════════════════
   CTA
════════════════════════════════ */
.pf-cta {
	background: var(--pf-black);
	color: var(--pf-white);
	padding: 72px 50px;
	text-align: center;
	position: relative; overflow: hidden;
}
.pf-cta::before {
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(circle at 50% 0%, rgba(0, 168, 150, 0.25), transparent 50%);
}
.pf-cta-inner { position: relative; max-width: 720px; margin: 0 auto; }
.pf-cta h2 {
	font-family: "Space Grotesk", sans-serif;
	font-size: clamp(2rem, 3.5vw, 3.2rem);
	font-weight: 700; letter-spacing: -1.5px;
	margin: 0 0 14px; line-height: 1.1;
	color: var(--pf-white);
}
.pf-cta h2 .accent { color: var(--pf-teal); }
.pf-cta p {
	color: rgba(255, 255, 255, 0.72);
	font-size: 16px; margin: 0 0 32px;
}
.pf-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 14px 28px;
	background: var(--pf-teal); color: #fff;
	border-radius: 10px;
	font-family: "Space Grotesk", sans-serif;
	font-weight: 500; font-size: 0.82rem;
	letter-spacing: 0.8px; text-transform: uppercase;
	transition: all 0.2s ease;
	/* <button> resets */
	border: none; cursor: pointer; text-decoration: none;
	-webkit-appearance: none; appearance: none;
}
.pf-btn:hover { background: var(--pf-teal); color: #fff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,168,150,.45); }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 980px) {
	.pf-hero { padding: 60px 28px; height: auto; min-height: auto; max-height: none; }
	.pf-hero-inner { grid-template-columns: 1fr; gap: 0; height: auto; }
	.pf-hero-content { padding: 20px 0; }
	.pf-hero-visual { display: none; }
	.pf-filter-section { padding: 24px 28px 0; }
	.pf-grid-section { padding: 36px 28px 80px; }
	.pf-cta { padding: 60px 28px; }
	.pf-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
	.pf-hero-stats { gap: 32px; }
}
@media (max-width: 600px) {
	.pf-hero { padding: 48px 20px; }
	.pf-filter-section { padding: 18px 0 0; }
	.pf-filter-inner { flex-wrap: nowrap; overflow-x: auto; padding: 0 20px 18px; -webkit-overflow-scrolling: touch; }
	.pf-chip { flex-shrink: 0; }
	.pf-grid-section { padding: 28px 20px 64px; }
	.pf-grid { grid-template-columns: 1fr; gap: 18px; }
	.pf-stat-num { font-size: 1.8rem; }
	.pf-hero-stats { gap: 24px; }
}
