/* ==========================================================================
   Colours, fonts and page layout
   Colour variables (change the brand colours here), fonts, headings, containers and section spacing. Loaded on every page.
   ========================================================================== */

:root {
	--c-primary: #7c3aed;
	--c-primary-2: #a78bfa;
	--c-accent: #f59e0b;
	--c-glow: #22d3ee;
	--bg: #07041a;
	--bg-2: #0d0828;
	--bg-3: #140c38;
	--surface: rgba(255, 255, 255, .045);
	--surface-2: rgba(255, 255, 255, .08);
	--border: rgba(255, 255, 255, .1);
	--border-strong: rgba(255, 255, 255, .18);
	--text: #eeebfb;
	--muted: #aaa5c8;
	--success: #34d399;
	--danger: #f87171;
	--grad: linear-gradient(120deg, var(--c-primary-2) 0%, var(--c-glow) 50%, var(--c-accent) 100%);
	--grad-btn: linear-gradient(120deg, var(--c-primary) 0%, #9333ea 45%, #c026d3 100%);
	--radius: 20px;
	--radius-sm: 12px;
	--radius-lg: 28px;
	--shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
	--shadow-glow: 0 0 0 1px rgba(167, 139, 250, .25), 0 20px 60px -15px rgba(124, 58, 237, .55);
	--font-display: "Sora", "Inter", system-ui, sans-serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--header-h: 84px;
	--ease: cubic-bezier(.22, 1, .36, 1);
	--gutter: clamp(16px, 4vw, 32px);
	color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
	-webkit-text-size-adjust: 100%;
}
body {
	margin: 0;
	background: var(--bg);
	background-image:
		radial-gradient(1200px 600px at 85% -10%, rgba(124, 58, 237, .18), transparent 60%),
		radial-gradient(900px 500px at -10% 30%, rgba(34, 211, 238, .07), transparent 60%);
	background-attachment: fixed;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	overflow-x: clip; /* same look, but keeps position: sticky working */
}
img, video, svg, iframe { max-width: 100%; }
img, video { height: auto; display: block; }
a { color: var(--c-primary-2); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--c-primary); color: #fff; }
:focus-visible {
	outline: 2px solid var(--c-glow);
	outline-offset: 3px;
	border-radius: 6px;
}
.site-main:focus { outline: none; }
.std-icon { flex-shrink: 0; }
.std-icon.flip { transform: scaleX(-1); }
.container {
	width: 100%;
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.container--narrow { max-width: 860px; }
.container--form { max-width: 820px; }
.section { padding-block: clamp(44px, 5vw, 72px); position: relative; }
.section--tight { padding-block: clamp(36px, 4.5vw, 60px); }
/* Back-to-back sections share one gap instead of stacking two full paddings. */
.section + .section { padding-top: clamp(8px, 1.5vw, 20px); }
.section + .section--tight { padding-top: 0; }
.card-grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
/* Projects: flex so a short last row is centred instead of leaving a gap. */
.card-grid--projects { display: flex; flex-wrap: wrap; justify-content: center; }
.card-grid--projects > .project-card { flex: 0 1 calc((100% - 2 * clamp(16px, 2vw, 24px)) / 3); min-width: 0; }
.card-grid--posts { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.btn-row, .section-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.section-actions { justify-content: center; margin-top: 36px; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	line-height: 1.15;
	letter-spacing: -.02em;
	margin: 0 0 .5em;
	color: #fff;
	font-weight: 700;
}
p { margin: 0 0 1em; }
.text-gradient {
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	background-size: 200% auto;
}
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-display);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--c-glow);
	margin-bottom: 16px;
}
.eyebrow::before {
	content: "";
	width: 28px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, transparent, var(--c-glow));
}
.section-head { max-width: 760px; margin-bottom: clamp(30px, 4vw, 48px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::after {
	content: "";
	width: 28px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--c-glow), transparent);
}
.section-title { font-size: clamp(1.9rem, 4.2vw, 3.1rem); font-weight: 800; }
.section-lead { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.15rem); margin: 0; }
.lead-text { font-size: 1.12rem; color: var(--muted); }
.section--article .post-meta { justify-content: center; margin-bottom: 28px; }
/* Cards */
.card-grid--posts { grid-template-columns: repeat(3, 1fr); }
.section--article { padding-top: 0; }

@media (max-width: 1024px) {
	.card-grid--posts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
	.card-grid--posts { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
	.card-grid--4 { grid-template-columns: repeat(2, 1fr); }
	.card-grid--3 { grid-template-columns: repeat(2, 1fr); }
	.card-grid--projects > .project-card { flex-basis: calc((100% - clamp(16px, 2vw, 24px)) / 2); }
}

@media (max-width: 680px) {
	.card-grid--projects > .project-card { flex-basis: 100%; }
	.card-grid--2, .card-grid--3, .card-grid--4, .card-grid--projects { grid-template-columns: 1fr; }
}
