/* ==========================================================================
   Human Patch Security — stylesheet
   The original Security Check layout, restyled with the humanpatch.co.za
   tokens, type and components so the two sites read as one brand.
   ========================================================================== */

@font-face {
	font-family: "JetBrains Mono";
	src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Sans";
	src: url("../fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Sans";
	src: url("../fonts/ibm-plex-sans-latin-wght-italic.woff2") format("woff2");
	font-weight: 100 700;
	font-style: italic;
	font-display: swap;
}

:root {
	color-scheme: dark;

	/* Logo ground and its lifts */
	--abyss: #041121;
	--deep: #071a2e;
	--panel: #0a2238;
	/* Fingerprint ridges */
	--ridge: #084158;
	--signal: #4fd2dd;
	--glow: #b8f3f6;
	/* Wordmark silver and body text */
	--silver: #e4e5e6;
	--text: #c1ccd8;
	--muted: #8b9cb1;

	/* Risk levels for assessment results */
	--risk-low: #5fe3a8;
	--risk-mid: #f4c25b;
	--risk-high: #ff8a80;

	--line: rgb(79 210 221 / 0.16);
	--line-strong: rgb(79 210 221 / 0.38);

	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--gutter: clamp(1rem, 4vw, 2.5rem);
	--header-h: 4.5rem;
	--radius: 6px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	background: var(--abyss);
	color: var(--text);
	font: 400 1.0625rem/1.65 var(--sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--signal); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--glow); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 {
	margin: 0;
	font-family: var(--mono);
	color: var(--silver);
	font-weight: 700;
	letter-spacing: -0.02em;
	text-wrap: balance;
}
button { font: inherit; color: inherit; }

:focus-visible {
	outline: 2px solid var(--signal);
	outline-offset: 3px;
	border-radius: 2px;
}
::selection { background: var(--signal); color: var(--abyss); }

/* Digital grid behind the page, fading out from the centre */
.bg-grid {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image:
		linear-gradient(var(--line) 1px, transparent 1px),
		linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 56px 56px;
	background-position: center top;
	-webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 0%, transparent 75%);
	mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 0%, transparent 75%);
	opacity: 0.45;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: 2.75rem;
	padding: 0.7em 1.25em;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font: 600 0.9375rem/1.2 var(--mono);
	letter-spacing: -0.01em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn svg { flex: none; width: 1.05em; height: 1.05em; }

.btn--signal { background: var(--signal); color: var(--abyss); }
.btn--signal:hover {
	background: var(--glow);
	color: var(--abyss);
	box-shadow: 0 0 28px rgb(79 210 221 / 0.35);
}

.btn--ghost {
	background: transparent;
	color: var(--silver);
	border-color: var(--line-strong);
}
.btn--ghost:hover {
	color: var(--glow);
	border-color: var(--signal);
	background: rgb(79 210 221 / 0.06);
}

.btn--sm { min-height: 2.5rem; padding: 0.55em 1em; font-size: 0.875rem; }
.btn--lg { min-height: 3.25rem; padding: 0.85em 1.6em; font-size: 1rem; }
.btn--block { width: 100%; }

/* Navigation -------------------------------------------------------------- */

.site-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 100;
	background: rgb(4 17 33 / 0.82);
	backdrop-filter: blur(14px) saturate(1.2);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
	border-bottom: 1px solid var(--line);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: var(--header-h);
	padding-left: max(var(--gutter), env(safe-area-inset-left));
	padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.brand { display: block; flex: none; line-height: 0; }
.brand img { height: 2.9rem; width: auto; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
	display: block;
	padding: 0.5rem 0.8rem;
	color: var(--text);
	font: 500 0.9rem var(--mono);
	text-decoration: none;
	border-radius: var(--radius);
}
.nav-link:hover { color: var(--silver); background: rgb(79 210 221 / 0.07); }
.nav-links .btn { margin-left: 0.75rem; }

.nav-toggle {
	display: none;
	width: 2.75rem; height: 2.75rem;
	padding: 0;
	background: transparent;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	color: var(--silver);
	cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 1.1rem; height: 2px;
	margin-inline: auto;
	background: currentColor;
	transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.nav-links {
		position: fixed;
		inset: var(--header-h) 0 auto 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0.75rem var(--gutter) 1.5rem;
		background: var(--abyss);
		border-bottom: 1px solid var(--line);
		visibility: hidden;
		opacity: 0;
		transform: translateY(-0.5rem);
		transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
	}
	.nav-links.is-open {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition-delay: 0s;
	}
	.nav-link { padding: 0.9rem 0.25rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
	.nav-links .btn { margin: 1.25rem 0 0; align-self: flex-start; }
}
@media (max-width: 520px) {
	:root { --header-h: 4rem; }
	.brand img { height: 2.1rem; }
}

/* Hero -------------------------------------------------------------------- */

#hero {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: calc(var(--header-h) + 3rem) var(--gutter) 6rem;
}

.hero-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
	padding: 0.35rem 0.9rem;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: rgb(79 210 221 / 0.06);
	font: 500 0.8125rem var(--mono);
	color: var(--signal);
}
.pill-dot {
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--signal);
	box-shadow: 0 0 8px var(--signal);
}
@media (prefers-reduced-motion: no-preference) {
	.pill-dot { animation: blink 2s infinite; }
}
@keyframes blink { 50% { opacity: 0.25; } }

.hero-h1 {
	margin-bottom: clamp(1rem, 3vw, 1.5rem);
	font-size: clamp(2.6rem, 1.2rem + 6vw, 5.5rem);
	line-height: 1.04;
	letter-spacing: -0.045em;
}
.hero-h1 em { font-style: normal; color: var(--signal); }

.hero-sub {
	max-width: 34rem;
	margin-bottom: clamp(2rem, 5vw, 2.75rem);
	font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
	color: var(--text);
}

.scroll-hint {
	position: absolute;
	bottom: 1.75rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	color: var(--muted);
	font: 400 0.75rem var(--mono);
	text-decoration: none;
}
.scroll-arrow {
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	color: var(--signal);
}
.scroll-arrow svg { width: 0.75rem; height: 0.75rem; }
@media (prefers-reduced-motion: no-preference) {
	.scroll-arrow { animation: bounce 2s infinite; }
}
@keyframes bounce { 50% { transform: translateY(5px); } }
@media (max-height: 640px) {
	.scroll-hint { display: none; }
}

/* Assessments ------------------------------------------------------------- */

#assessments {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: clamp(5rem, 10vw, 7rem) var(--gutter) clamp(4rem, 8vw, 6rem);
	background: linear-gradient(180deg, var(--abyss), var(--deep));
	border-top: 1px solid var(--line);
}

.sec-eyebrow {
	margin-bottom: 0.75rem;
	font: 500 0.875rem var(--mono);
	color: var(--signal);
	text-align: center;
}
.sec-h2 {
	margin-bottom: 0.75rem;
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
	line-height: 1.15;
	text-align: center;
}
.sec-sub {
	max-width: 32rem;
	margin: 0 auto clamp(2.5rem, 6vw, 3.5rem);
	text-align: center;
}

.cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
	width: 100%;
	max-width: 68rem;
}
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 1.9rem);
	background: rgb(7 26 46 / 0.9);
	border: 1px solid var(--line);
	border-radius: calc(var(--radius) * 1.5);
	transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover {
	border-color: var(--line-strong);
	box-shadow: 0 0 0 6px rgb(79 210 221 / 0.04), 0 30px 80px -30px rgb(0 0 0 / 0.8);
}
.card-tag {
	position: absolute;
	top: 1rem;
	right: 1rem;
	padding: 0.2rem 0.55rem;
	border: 1px solid var(--line);
	border-radius: 3px;
	font: 400 0.75rem/1.5 var(--mono);
	color: var(--muted);
}
.card-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 2.75rem;
	height: 2.75rem;
	margin-bottom: 1.25rem;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	color: var(--signal);
}
.card-icon svg { width: 1.3rem; height: 1.3rem; }
.card-title { margin-bottom: 0.5rem; font-size: 1.2rem; line-height: 1.3; }
.card-desc { margin-bottom: 1.25rem; font-size: 0.98rem; }

.card-list { flex: 1; margin-bottom: 1.75rem; border-top: 1px solid var(--line); }
.card-list li {
	position: relative;
	padding: 0.5rem 0 0.5rem 1.75rem;
	border-bottom: 1px solid var(--line);
	color: var(--silver);
	font-size: 0.95rem;
}
.card-list li::before {
	content: "";
	position: absolute;
	left: 0.1rem;
	top: 0.9rem;
	width: 0.85rem;
	height: 0.45rem;
	border-left: 2px solid var(--signal);
	border-bottom: 2px solid var(--signal);
	transform: rotate(-45deg);
}

@media (max-width: 860px) {
	.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 40rem; }
	.card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
	.cards { grid-template-columns: 1fr; max-width: 28rem; }
}

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

.site-footer {
	position: relative;
	z-index: 1;
	padding: clamp(2.5rem, 5vw, 3.5rem) var(--gutter) max(2rem, env(safe-area-inset-bottom));
	background: #030c18;
	border-top: 1px solid var(--line);
	text-align: center;
	font-size: 0.95rem;
}
.footer-logo { height: 2.75rem; width: auto; margin: 0 auto 1.5rem; }
.footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem clamp(1rem, 3vw, 2rem);
	margin-bottom: 1rem;
}
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--signal); text-decoration: underline; }
.footer-copy { font-size: 0.85rem; color: var(--muted); }

/* Assessment overlay ----------------------------------------------------- */

#assessment-overlay {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: none;
	padding: max(0.75rem, env(safe-area-inset-top)) var(--gutter) max(0.75rem, env(safe-area-inset-bottom));
	background: rgb(3 12 24 / 0.86);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	overflow-y: auto;
	overscroll-behavior: contain;
}
#assessment-overlay.open { display: flex; }

.assessment-box {
	position: relative;
	width: 100%;
	max-width: 36rem;
	margin: auto;
	padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
	background: var(--deep);
	border: 1px solid var(--line-strong);
	border-radius: calc(var(--radius) * 1.5);
	box-shadow: 0 0 0 6px rgb(79 210 221 / 0.04), 0 40px 100px -30px rgb(0 0 0 / 0.9);
}
.assessment-box:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
	#assessment-overlay.open .assessment-box { animation: box-in 0.28s var(--ease); }
}
@keyframes box-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

.a-close {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--muted);
	cursor: pointer;
	transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.a-close:hover { color: var(--silver); border-color: var(--line-strong); }
.a-close svg { width: 0.85rem; height: 0.85rem; }

.a-progress-wrap { margin: 0 2.75rem 1.75rem 0; }
.a-progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: 0.6rem;
	font-family: var(--mono);
}
.a-progress-label { font-size: 0.95rem; font-weight: 700; color: var(--silver); }
.a-progress-count { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.a-progress-track { height: 3px; background: rgb(255 255 255 / 0.06); border-radius: 3px; overflow: hidden; }
.a-progress-fill {
	width: 0;
	height: 100%;
	background: var(--signal);
	box-shadow: 0 0 10px rgb(79 210 221 / 0.5);
	transition: width 0.4s var(--ease);
}

.a-category { margin-bottom: 0.6rem; font: 500 0.875rem var(--mono); color: var(--signal); }
.a-question {
	min-height: 3.4em;
	margin-bottom: 1.75rem;
	font: 600 clamp(1.15rem, 1rem + 0.8vw, 1.4rem)/1.4 var(--mono);
	letter-spacing: -0.02em;
	color: var(--silver);
	transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.a-question.is-changing { opacity: 0; transform: translateY(6px); }

.a-answers { display: grid; gap: 0.6rem; }
.a-btn {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	width: 100%;
	min-height: 3.25rem;
	padding: 0.6rem 0.9rem;
	background: var(--abyss);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font: 500 1rem var(--sans);
	color: var(--silver);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.a-btn:hover { border-color: var(--signal); background: rgb(79 210 221 / 0.06); }
.a-btn-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 2rem;
	height: 2rem;
	border-radius: var(--radius);
	font: 700 0.95rem var(--mono);
}
.icon-yes { color: var(--signal); background: rgb(79 210 221 / 0.12); }
.icon-no { color: var(--risk-high); background: rgb(255 138 128 / 0.1); }
.icon-maybe { color: var(--risk-mid); background: rgb(244 194 91 / 0.1); }

#a-question-wrap[hidden],
.a-results[hidden] { display: none; }
.a-results:focus { outline: none; }

.result-header {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 3vw, 1.5rem);
	margin-bottom: 1rem;
	padding: clamp(1rem, 2.5vw, 1.25rem);
	background: var(--abyss);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.score-ring { position: relative; flex: none; width: 6rem; height: 6rem; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: rgb(255 255 255 / 0.07); stroke-width: 8; }
.score-ring-fill {
	fill: none;
	stroke: var(--signal);
	stroke-width: 8;
	stroke-linecap: round;
	stroke-dasharray: 326.73;
	transition: stroke-dashoffset 1s var(--ease);
}
.score-ring-text {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--mono);
	color: var(--silver);
}
.score-num { font-size: 1.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.score-max { margin-left: 0.15rem; font-size: 0.8rem; color: var(--muted); }

.result-header-text { flex: 1; min-width: 0; }
.risk-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-bottom: 0.4rem;
	font: 600 0.875rem var(--mono);
}
.risk-badge::before {
	content: "";
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 10px currentColor;
}
.result-title { margin-bottom: 0.3rem; font: 700 1.05rem/1.35 var(--mono); color: var(--silver); }
.result-desc { font-size: 0.95rem; }

.risk-low .risk-badge { color: var(--risk-low); }
.risk-low .score-ring-fill { stroke: var(--risk-low); }
.risk-medium .risk-badge { color: var(--risk-mid); }
.risk-medium .score-ring-fill { stroke: var(--risk-mid); }
.risk-high .risk-badge { color: var(--risk-high); }
.risk-high .score-ring-fill { stroke: var(--risk-high); }

.result-cta-note {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 1rem;
	padding: 1rem 1.15rem;
	background: rgb(79 210 221 / 0.05);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font-size: 0.95rem;
}
.result-cta-note svg { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; color: var(--signal); }
.result-cta-note strong { color: var(--silver); font-weight: 600; }

.result-actions { display: flex; gap: 0.6rem; }
.result-actions .btn--signal { flex: 1; }

@media (max-width: 560px) {
	.result-header { flex-direction: column; text-align: center; }
	.result-actions { flex-direction: column; }
}

/* Legal pages ------------------------------------------------------------ */

.legal-header .site-header__inner { max-width: 52rem; margin-inline: auto; }
.back-link { font: 500 0.9rem var(--mono); text-decoration: none; }

.legal {
	position: relative;
	z-index: 1;
	max-width: 52rem;
	margin: 0 auto;
	padding: calc(var(--header-h) + clamp(2.5rem, 6vw, 4rem)) var(--gutter) clamp(3.5rem, 8vw, 5rem);
}
.legal-eyebrow { margin-bottom: 0.75rem; font: 500 0.875rem var(--mono); color: var(--signal); }
.legal h1 {
	font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.4rem);
	line-height: 1.08;
	letter-spacing: -0.035em;
}
.legal-updated { margin: 0.75rem 0 2rem; font: 400 0.875rem var(--mono); color: var(--muted); }
.legal-summary {
	margin-bottom: 2rem;
	padding: 1.25rem 1.5rem;
	background: var(--deep);
	border: 1px solid var(--line-strong);
	border-left: 3px solid var(--signal);
	border-radius: var(--radius);
}
.legal-summary strong { color: var(--signal); font-weight: 600; }
.legal p, .legal li { font-size: 1.075rem; }
.legal p + p { margin-top: 1.1em; }
.legal h2 {
	margin: 2.5rem 0 0.9rem;
	font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem);
	line-height: 1.25;
}
.legal ul { margin: 0.9rem 0; }
.legal li { position: relative; padding-left: 1.5rem; }
.legal li + li { margin-top: 0.5rem; }
.legal li::before {
	content: ">";
	position: absolute;
	left: 0;
	font: 700 1em var(--mono);
	color: var(--signal);
}
.legal strong { color: var(--silver); font-weight: 600; }

/* Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
