/*
 * Scroll-reveal + small interaction styles.
 *
 * Replaces the animation library used by the original build. Every rule is
 * scoped to .nessa-js, which app.js adds only when it is ready to initialize
 * the elements. If a cache plugin delays JavaScript past first paint, app.js
 * leaves everything visible rather than starting a late, disruptive reveal.
 */

/*
 * No will-change here on purpose. It promotes every revealed element to its own
 * compositing layer, and a promoted layer stops honouring an ancestor's
 * border-radius clip - which squared off the corners of the rounded media cards.
 * Opacity and transform transitions are accelerated without it anyway.
 */
.nessa-js [data-reveal] {
	opacity: 0;
	transform: var(--nessa-reveal-from, none);
}

/*
 * Timing taken from the source bundle: tween durations clustered at 0.5-0.8s
 * (0.7s most common) with Framer Motion's default easeOut, and index-based
 * stagger delays of 0.05-0.1s per sibling.
 */
.nessa-js [data-reveal].nessa-revealed {
	opacity: 1;
	transform: none;
	transition:
		opacity var(--nessa-reveal-duration, 0.7s) cubic-bezier(0, 0, 0.58, 1),
		transform var(--nessa-reveal-duration, 0.7s) cubic-bezier(0, 0, 0.58, 1);
	transition-delay: var(--nessa-reveal-delay, 0ms);
}

/* Fallback reveal: final state applied outright, with no transition to complete. */
.nessa-js [data-reveal].nessa-reveal-now {
	opacity: 1;
	transform: none;
	transition: none;
}

/* Mobile menu open/close, mirroring the original height animation. */
.nessa-mobile-menu {
	overflow: hidden;
}

.nessa-js .nessa-mobile-menu[hidden] {
	display: block;
	height: 0;
	visibility: hidden;
}

.nessa-js .nessa-mobile-menu {
	height: auto;
	visibility: visible;
	transition: height 0.3s ease;
}

/* Cards hidden by a category filter. */
[data-nessa-cat][hidden],
[data-nessa-tileset][hidden] {
	display: none !important;
}

/*
 * Generous breathing room between switcher tabs/leaf icon and the portfolio/cards section below.
 */
.nessa-switcher-tabs-wrap {
	margin-bottom: 3.5rem; /* 56px on mobile */
}

@media (min-width: 1024px) {
	.nessa-switcher-tabs-wrap {
		margin-bottom: 5rem; /* 80px on desktop */
	}
}

/*
 * Switcher tabs active and idle styling.
 * Active tab title, underline bar, and rhombus pointer use #0a9124.
 */
[data-testid^="tab-by-"][aria-selected="true"] {
	color: #0a9124 !important;
}

[data-testid^="tab-by-"][aria-selected="false"] {
	color: #9ca3af; /* text-gray-400 */
}

[data-testid^="tab-by-"][aria-selected="false"]:hover {
	color: #374151; /* text-gray-700 */
}

.nessa-tab-indicator-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 4px;
	background-color: #0a9124;
	border-radius: 9999px;
}

.nessa-tab-indicator-rhombus {
	position: absolute;
	left: 50%;
	bottom: 1px;
	width: 12px;
	height: 12px;
	background-color: #0a9124;
	transform: translate(-50%, 50%) rotate(45deg);
	border-radius: 1px;
}

/*
 * High-performance, bulletproof scrolling card architecture.
 * Ensures 100% border-radius clip on GPU-accelerated compositing layers across all browsers.
 */
.nessa-solution-card {
	position: relative;
	height: 18rem; /* 288px default */
	border-radius: 1.5rem; /* 24px */
	overflow: hidden;
	isolation: isolate;
	transform: translateZ(0);
	-webkit-mask-image: -webkit-radial-gradient(white, black);
	mask-image: radial-gradient(white, black);
	background-color: #0f172a;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.08);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

@media (min-width: 1024px) {
	.nessa-solution-card {
		height: 20rem; /* 320px */
	}
}

.nessa-solution-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.22), 0 10px 15px -5px rgba(0, 0, 0, 0.12);
}

/* Card image layer */
.nessa-solution-card .card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center bottom;
	transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Application artwork crop: anchor to bottom and scale so top banner is cleanly hidden */
.nessa-solution-card.is-app .card-img {
	height: 184%;
	top: auto;
	bottom: 0;
	transform-origin: center bottom;
}

.nessa-solution-card:hover .card-img {
	transform: scale(1.08);
}

/* Full coverage card overlays */
.nessa-solution-card .card-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.nessa-solution-card.is-app .card-overlay {
	background: linear-gradient(180deg, 
		rgba(0, 0, 0, 0.6) 0%, 
		rgba(0, 0, 0, 0.15) 30%, 
		rgba(0, 0, 0, 0.35) 60%, 
		rgba(0, 0, 0, 0.92) 100%
	);
}

.nessa-solution-card.is-product .card-overlay {
	background: linear-gradient(180deg, 
		rgba(15, 23, 42, 0.75) 0%, 
		rgba(15, 23, 42, 0.35) 30%, 
		rgba(15, 23, 42, 0.6) 65%, 
		rgba(15, 23, 42, 0.95) 100%
	);
}

/* Top pill badge */
.nessa-solution-card .card-badge {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 2;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 0.3rem 0.75rem;
	border-radius: 9999px;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #ffffff;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* Bottom text content */
.nessa-solution-card .card-content {
	position: absolute;
	inset-x: 0;
	bottom: 0;
	padding: 1.25rem;
	z-index: 2;
}

.nessa-solution-card .card-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.25;
	margin: 0 0 0.25rem 0;
}

.nessa-solution-card .card-meta {
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.82);
	line-height: 1.25;
	margin: 0;
}

/* Bottom hover accent indicator line */
.nessa-solution-card .card-accent-line {
	position: absolute;
	inset-x: 0;
	bottom: 0;
	height: 4px;
	background: linear-gradient(90deg, #f97316, #10b981);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 3;
}

.nessa-solution-card:hover .card-accent-line {
	transform: scaleX(1);
}

.nessa-toast-region:empty {
	display: none;
}

/* Editor content inside the blog templates. */
.nessa-prose {
	color: #374151;
	line-height: 1.75;
}

.nessa-prose > * + * {
	margin-top: 1.25rem;
}

.nessa-prose h2 {
	font-size: 1.875rem;
	font-weight: 800;
	color: #111827;
	margin-top: 2.5rem;
	line-height: 1.25;
}

.nessa-prose h3 {
	font-size: 1.5rem;
	font-weight: 700;
	color: #111827;
	margin-top: 2rem;
	line-height: 1.3;
}

.nessa-prose h4 {
	font-size: 1.25rem;
	font-weight: 700;
	color: #111827;
	margin-top: 1.5rem;
}

.nessa-prose a {
	color: #f58220;
	text-decoration: underline;
}

.nessa-prose a:hover {
	color: #059669;
}

.nessa-prose ul,
.nessa-prose ol {
	padding-left: 1.5rem;
}

.nessa-prose ul {
	list-style: disc;
}

.nessa-prose ol {
	list-style: decimal;
}

.nessa-prose li + li {
	margin-top: 0.5rem;
}

.nessa-prose blockquote {
	border-left: 4px solid #10b981;
	padding-left: 1.25rem;
	font-style: italic;
	color: #4b5563;
}

.nessa-prose img {
	border-radius: 1rem;
	height: auto;
	max-width: 100%;
}

.nessa-prose code {
	background: #f3f4f6;
	border-radius: 0.25rem;
	padding: 0.125rem 0.375rem;
	font-size: 0.9em;
}

.nessa-prose pre {
	background: #111827;
	color: #f9fafb;
	border-radius: 0.75rem;
	padding: 1.25rem;
	overflow-x: auto;
}

.nessa-prose table {
	width: 100%;
	border-collapse: collapse;
}

.nessa-prose th,
.nessa-prose td {
	border: 1px solid #e5e7eb;
	padding: 0.625rem 0.875rem;
	text-align: left;
}

/* Pagination + category links inherit the site's pill styling. */
.nessa-blog .nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	border-radius: 9999px;
	border: 1px solid #e5e7eb;
	font-weight: 600;
	color: #374151;
	transition: all 0.2s ease;
}

.nessa-blog .nav-links .page-numbers:hover {
	border-color: #6ee7b7;
	color: #059669;
}

.nessa-blog .nav-links .page-numbers.current {
	background: linear-gradient(to right, #f97316, #10b981);
	border-color: transparent;
	color: #fff;
}

.nessa-post-cats a,
.nessa-post-tags a {
	color: #059669;
	font-weight: 600;
}

.nessa-post-cats a:hover,
.nessa-post-tags a:hover {
	color: #f97316;
}

@media (prefers-reduced-motion: reduce) {
	.nessa-js [data-reveal],
	.nessa-js [data-reveal].nessa-revealed {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.nessa-js .nessa-mobile-menu {
		transition: none;
	}
}
