:root {
	--brand-primary: #3f5bf6;
	--brand-primary-dark: #2f46c7;
	--brand-accent: #12b886;
	--brand-ink: #152033;
	--brand-muted: #667085;
	--brand-surface: #f5f7fb;
	--brand-border: #e6e9f0;
	--brand-soft: #eef2ff;
}

html { scroll-behavior: smooth; }

:focus-visible {
	outline: 3px solid #0b57d0;
	outline-offset: 3px;
}

body {
	color: var(--brand-ink);
	background: #fff;
	font-family: system-ui, sans-serif;
}

code {
	padding: 3px 7px;
	border-radius: 5px;
	background: #eef2f6;
}

.navbar {
	backdrop-filter: blur(12px);
	background: rgba(255,255,255,.9) !important;
}

.navbar-brand-mark {
	width: 2rem;
	height: 2rem;
	display: inline-grid;
	place-items: center;
	border-radius: .65rem;
	background: var(--brand-primary);
	color: #fff;
	font-weight: 800;
}

.btn-brand {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--brand-primary);
	--bs-btn-border-color: var(--brand-primary);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--brand-primary-dark);
	--bs-btn-hover-border-color: var(--brand-primary-dark);
}

.section-pad { padding: 5.5rem 0; }

.section-kicker {
	color: var(--brand-primary);
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	font-size: .78rem;
}

.section-lead {
	color: var(--brand-muted);
	max-width: 48rem;
}

/* HERO */
.hero {
	padding: 7.5rem 0 4.5rem;
	background:
	radial-gradient(circle at 82% 22%, rgba(63, 91, 246, .16), transparent 28rem),
	linear-gradient(180deg, #fff 0%, var(--brand-surface) 100%);
	overflow: hidden;
	margin-top: 56px; /* Offset for fixed navbar */
}

.hero h1 {
	max-width: 10ch;
	letter-spacing: -.05em;
}

.hero-copy {
	max-width: 42rem;
	color: var(--brand-muted);
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	border: 1px solid var(--brand-border);
	border-radius: 999px;
	padding: .42rem .8rem;
	background: rgba(255,255,255,.9);
	font-size: .85rem;
	font-weight: 700;
}

.hero-visual {
	position: relative;
	min-height: 520px;
}

.hero-main-image {
	width: 78%;
	height: 460px;
	object-fit: cover;
	border-radius: 1.6rem;
	display: block;
	margin-left: auto;
	box-shadow: 0 2rem 4rem rgba(30, 41, 59, .14);
}

.hero-secondary-image {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 42%;
	height: 220px;
	object-fit: cover;
	border-radius: 1.3rem;
	border: .45rem solid #fff;
	box-shadow: 0 1.25rem 3rem rgba(30, 41, 59, .14);
}

.hero-stat-card {
	position: absolute;
	right: 0;
	bottom: 1.5rem;
	width: 42%;
	border: 1px solid var(--brand-border);
	border-radius: 1.25rem;
	background: rgba(255,255,255,.95);
	box-shadow: 0 1rem 2.5rem rgba(30, 41, 59, .10);
}

.metric + .metric { border-left: 1px solid var(--brand-border); }

/* SERVICES */
.services-shell {
	border: 1px solid var(--brand-border);
	border-radius: 1.75rem;
	overflow: hidden;
	background: #fff;
}

.service-card {
	height: 100%;
	padding: 2rem;
	border-right: 1px solid var(--brand-border);
	border-bottom: 1px solid var(--brand-border);
}

.service-icon {
	width: 3rem;
	height: 3rem;
	display: inline-grid;
	place-items: center;
	border-radius: .9rem;
	background: var(--brand-soft);
	color: var(--brand-primary);
	font-weight: 800;
}

.services-image {
	width: 100%;
	height: 100%;
	min-height: 420px;
	object-fit: cover;
}

/* EXAMS */
.exam-row {
	border: 1px solid var(--brand-border);
	border-radius: 1.5rem;
	overflow: hidden;
	background: #fff;
}

.exam-row + .exam-row { margin-top: 1.5rem; }

.exam-image {
	width: 100%;
	height: 100%;
	min-height: 330px;
	object-fit: cover;
}

.exam-content {
	padding: 2rem;
}

.exam-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
}

.exam-pill {
	display: inline-flex;
	align-items: center;
	padding: .38rem .7rem;
	border-radius: 999px;
	background: var(--brand-surface);
	color: var(--brand-muted);
	font-size: .82rem;
	font-weight: 700;
}

/* FEATURED PAGES */
.feature-grid {
	display: grid;
	grid-template-columns: 1.35fr 1fr 1fr;
	grid-template-rows: 260px 260px;
	gap: 1rem;
}

.feature-card {
	position: relative;
	overflow: hidden;
	border-radius: 1.4rem;
	min-height: 100%;
	color: #fff;
	text-decoration: none;
	isolation: isolate;
}

.feature-card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: -2;
	transition: transform .35s ease;
}

.feature-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.85) 100%);
	z-index: -1;
}

.feature-card:hover img { transform: scale(1.035); }

.feature-card:focus-visible img { transform: scale(1.035); }

.feature-card-lg { grid-row: 1 / span 2; }

.feature-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 1.5rem;
}

.feature-card-lg .feature-content { padding: 2rem; }

/* CTA */
.cta-panel {
	border-radius: 1.6rem;
	background: var(--brand-ink);
	color: #fff;
}

footer { border-top: 1px solid var(--brand-border); }

/* Resource discovery */
.resource-breadcrumb {
	margin-bottom: 2rem;
	max-width: 100%;
	overflow: hidden;
}

.resource-breadcrumb .breadcrumb {
	flex-wrap: nowrap;
	overflow: hidden;
}

.resource-breadcrumb .breadcrumb-item {
	min-width: 0;
	white-space: nowrap;
}

.resource-breadcrumb .breadcrumb-item.active {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.resource-hero,
.resource-list-header {
	max-width: 58rem;
	margin-bottom: 3rem;
}

.resource-search {
	max-width: 52rem;
	margin-bottom: 4rem;
	padding: 1.5rem;
	border: 1px solid var(--brand-border);
	border-radius: 1.25rem;
	background: var(--brand-surface);
}

.resource-section {
	padding-top: 2rem;
	margin-top: 2rem;
}

.category-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

.category-card {
	display: flex;
	flex-direction: column;
	gap: .55rem;
	min-height: 10rem;
	padding: 1.35rem;
	border: 1px solid var(--brand-border);
	border-radius: 1.15rem;
	background: #fff;
	color: var(--brand-ink);
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.category-card:hover,
.category-card:focus-visible {
	border-color: var(--brand-primary);
	box-shadow: 0 .8rem 2rem rgba(30, 41, 59, .10);
	transform: translateY(-2px);
}

.category-card strong {
	font-size: 1.05rem;
}

.category-card > span:not(.category-card-count) {
	color: var(--brand-muted);
	font-size: .9rem;
}

.category-card-count {
	color: var(--brand-primary-dark);
	font-size: .78rem;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.category-grid-compact .category-card {
	min-height: 7.5rem;
}

.resource-card {
	overflow: hidden;
	border: 1px solid var(--brand-border);
	border-radius: 1.25rem;
	background: #fff;
	box-shadow: 0 .4rem 1.25rem rgba(30, 41, 59, .06);
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.resource-card:hover {
	border-color: rgba(63, 91, 246, .5);
	box-shadow: 0 1rem 2.5rem rgba(30, 41, 59, .11);
	transform: translateY(-2px);
}

.resource-card-visual {
	display: grid;
	place-items: center;
	height: 190px;
	padding: 1rem;
	overflow: hidden;
	background: var(--brand-surface);
}

.resource-card-visual svg,
.resource-card-visual img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.resource-card-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 1.35rem;
}

.resource-card-category {
	position: relative;
	z-index: 1;
	margin-bottom: .7rem;
	color: var(--brand-primary-dark);
	font-size: .76rem;
	font-weight: 800;
	letter-spacing: .04em;
	text-decoration: none;
	text-transform: uppercase;
}

.resource-card h3 {
	font-size: 1.15rem;
	line-height: 1.35;
}

.resource-card h3 a {
	color: var(--brand-ink);
	text-decoration: none;
}

.resource-card h3 a:hover {
	color: var(--brand-primary-dark);
	text-decoration: underline;
	text-underline-offset: .18em;
}

.resource-card p {
	color: var(--brand-muted);
	font-size: .94rem;
}

.resource-card time {
	margin-top: auto;
	color: var(--brand-muted);
	font-size: .82rem;
}

.empty-state {
	padding: 2rem;
	border: 1px dashed var(--brand-border);
	border-radius: 1.25rem;
	background: var(--brand-surface);
}

.resource-byline {
	line-height: 1.7;
}

.markdown-body {
	font-size: 1.1rem;
	line-height: 1.8;
}

.article-toc {
	margin-bottom: 2.5rem;
	padding: 1.25rem 1.5rem;
	border-left: 4px solid var(--brand-primary);
	border-radius: 0 1rem 1rem 0;
	background: var(--brand-surface);
}

.article-toc ol {
	display: grid;
	gap: .45rem;
	margin: .75rem 0 0;
	padding-left: 1.25rem;
}

.article-toc a {
	text-underline-offset: .18em;
}

.resource-faq details {
	border-top: 1px solid var(--brand-border);
}

.resource-faq details:last-child {
	border-bottom: 1px solid var(--brand-border);
}

.resource-faq summary {
	min-height: 3rem;
	padding: 1rem .25rem;
	cursor: pointer;
	font-weight: 750;
}

.faq-answer {
	padding: 0 .25rem 1rem;
	color: var(--brand-muted);
}

.faq-answer p:last-child {
	margin-bottom: 0;
}

.related-resources {
	padding-top: 4rem;
}

.related-resources .resource-card-visual {
	height: 150px;
}

.continue-learning-panel {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	margin-top: 4rem;
	padding: 2rem;
	border: 1px solid var(--brand-border);
	border-radius: 1.4rem;
	background: var(--brand-surface);
}

.page-link,
.resource-article-footer .badge {
	min-height: 2rem;
	display: inline-flex;
	align-items: center;
}

/* Extra Page Wrappers */
.page-wrapper {
	margin-top: 80px;
	padding-top: 2rem;
	padding-bottom: 2rem;
	min-height: 60vh;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
	background: #fff;
	border: 1px solid var(--brand-border);
	border-radius: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-danger {
    background-color: #d9534f;
	color: white;
	border: none;
}

.btn-danger:hover {
    background-color: #c9302c;
	color: white;
}

.auth-link {
    margin-top: 1rem;
}

/* Profile */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
	background: #fff;
	border: 1px solid var(--brand-border);
	border-radius: 1.25rem;
}

.profile-details {
    margin-bottom: 2rem;
}

.danger-zone {
    border-top: 1px solid #ccc;
    padding-top: 2rem;
    margin-top: 2rem;
}

.danger-zone h3 {
    color: #d9534f;
}

/* Navigation Utilities */
.inline-form {
    display: inline;
}

.btn-link {
    background: none;
    border: none;
    color: var(--brand-ink);
    cursor: pointer;
    font: inherit;
    padding: .5rem 1rem;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: none;
	color: var(--brand-primary);
}

/* Featured Image on Pages */
.featured-image-container {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 0 auto;
	width: 100%;
}

.featured-image-container svg,
.featured-image-container img {
	max-width: 100%;
	max-height: 400px;
	height: auto;
	width: auto;
	object-fit: contain;
}

/* SVG Rendering */
.svg-container svg, .section-gallery svg {
    width: 100%;
    height: auto;
    max-height: 550px;
    display: block;
    margin: 0 auto;
}

/* Card image constraints */
.card-img-top svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Markdown Tables */
.markdown-body table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid var(--brand-border);
}

.markdown-body thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--brand-border);
    background-color: var(--brand-soft);
    font-weight: 600;
}

.markdown-body tbody + tbody {
    border-top: 2px solid var(--brand-border);
}

.markdown-body table tr:nth-child(2n) {
    background-color: rgba(0, 0, 0, 0.02);
}

@media (max-width: 991.98px) {
	.hero-visual { min-height: 470px; }
	.hero-main-image { width: 82%; height: 400px; }
	.hero-secondary-image { width: 45%; height: 190px; }
	.hero-stat-card { width: 46%; }

	.services-image { min-height: 320px; }

	.feature-grid {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 320px 240px 240px;
	}

	.feature-card-lg {
	grid-column: 1 / span 2;
	grid-row: auto;
	}

	.category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
	.section-pad { padding: 4rem 0; }
	.hero { padding-top: 6.5rem; }

	.hero-visual { min-height: auto; }
	.hero-main-image,
	.hero-secondary-image,
	.hero-stat-card {
	position: static;
	width: 100%;
	}

	.hero-main-image { height: 330px; margin: 0; }
	.hero-secondary-image { height: 210px; margin-top: 1rem; border: 0; }
	.hero-stat-card { margin-top: 1rem; }

	.feature-grid {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: none;
	}

	.feature-card,
	.feature-card-lg { min-height: 280px; grid-column: auto; grid-row: auto; }

	.category-grid { grid-template-columns: 1fr; }
	.continue-learning-panel { align-items: flex-start; flex-direction: column; }
	.resource-breadcrumb { margin-bottom: 1.5rem; overflow-x: auto; }
	.resource-breadcrumb .breadcrumb-item:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
