/*
	Cosmos — design system for giulioromualdi.github.io
	Dark, glassy, motion-aware. Replaces the legacy Massively stylesheet.
	Hero and section imagery: NASA/ESA/CSA public-domain astronomy photography.
*/

/* ============================================================
   1. Tokens
   ============================================================ */

:root {
	--space-900: #04060d;
	--space-800: #070b16;
	--space-700: #0b1020;
	--space-600: #121a2e;

	--line: rgba(148, 178, 255, 0.14);
	--line-strong: rgba(148, 178, 255, 0.3);

	--text: #e8edf7;
	--text-soft: #a4b0c8;
	--text-dim: #7b879f;

	--cyan: #4fd8ff;
	--violet: #a78bfa;
	--amber: #ffb066;

	--accent: var(--cyan);
	--grad: linear-gradient(120deg, #4fd8ff 0%, #a78bfa 55%, #ffb066 100%);
	--grad-cool: linear-gradient(120deg, #4fd8ff 0%, #a78bfa 100%);

	--glass: rgba(255, 255, 255, 0.045);
	--glass-strong: rgba(255, 255, 255, 0.075);

	--radius-s: 10px;
	--radius: 16px;
	--radius-l: 24px;

	--shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9);
	--shadow-lift: 0 30px 70px -30px rgba(79, 216, 255, 0.45);

	--container: 1160px;
	--nav-h: 68px;

	--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   2. Reset & base
   ============================================================ */

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--nav-h) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--space-900);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.75;
	letter-spacing: 0.01em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* Deep-field starfield behind everything (NASA/ESA Hubble eXtreme Deep Field). */
body::before {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -2;
	background:
		radial-gradient(1200px 700px at 15% -10%, rgba(79, 216, 255, 0.14), transparent 60%),
		radial-gradient(1000px 700px at 90% 10%, rgba(167, 139, 250, 0.14), transparent 60%),
		radial-gradient(900px 600px at 50% 105%, rgba(255, 176, 102, 0.09), transparent 60%),
		url('../images/space/deep-field.jpg') center / cover no-repeat,
		var(--space-900);
	opacity: 0.9;
}

body::after {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(4, 6, 13, 0.55) 0%, rgba(4, 6, 13, 0.86) 45%, rgba(4, 6, 13, 0.96) 100%);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.02em;
	color: #fff;
	margin: 0 0 0.6em 0;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p {
	margin: 0 0 1.1em 0;
	color: var(--text-soft);
}

strong { color: #fff; font-weight: 600; }
em { color: var(--text); }

small { font-size: 0.8em; }

a {
	color: var(--cyan);
	text-decoration: none;
	transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

a:hover { color: #fff; }

hr {
	border: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
	margin: 2.5rem 0;
}

ul, ol { padding-left: 1.2rem; }
li { margin: 0 0 0.5rem 0; color: var(--text-soft); }

blockquote {
	margin: 1.5rem 0;
	padding: 0.2rem 0 0.2rem 1.4rem;
	border-left: 3px solid var(--cyan);
	color: var(--text-soft);
	font-style: italic;
}

code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 0.1em 0.4em;
	color: var(--cyan);
}

::selection {
	background: rgba(79, 216, 255, 0.28);
	color: #fff;
}

:focus-visible {
	outline: 2px solid var(--cyan);
	outline-offset: 3px;
	border-radius: 4px;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -100px;
	z-index: 200;
	background: var(--cyan);
	color: #04060d;
	padding: 0.6rem 1rem;
	border-radius: 8px;
	font-weight: 600;
	transition: top 0.2s var(--ease);
}

.skip-link:focus { top: 1rem; color: #04060d; }

/* ============================================================
   3. Layout primitives
   ============================================================ */

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 clamp(1.1rem, 4vw, 2rem);
}

.container--narrow { max-width: 860px; }

.section {
	position: relative;
	padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section--tight { padding-top: clamp(2rem, 4vw, 3rem); }

.section + .section { padding-top: 0; }

.section-head {
	max-width: 44rem;
	margin: 0 0 clamp(2rem, 4vw, 3rem) 0;
}

.section-head.is-centered {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.section-head h2 { margin-bottom: 0.5rem; }

.section-head p {
	font-size: 1.02rem;
	color: var(--text-soft);
	margin: 0;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	font-family: var(--font-display);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--cyan);
	margin-bottom: 0.9rem;
}

.eyebrow::before {
	content: '';
	width: 22px;
	height: 2px;
	border-radius: 2px;
	background: var(--grad-cool);
}

.section-head.is-centered .eyebrow::before { display: none; }

.gradient-text {
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ============================================================
   4. Navigation
   ============================================================ */

.nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	height: var(--nav-h);
	display: flex;
	align-items: center;
	transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
	border-bottom: 1px solid transparent;
}

.nav.is-stuck {
	background: rgba(6, 9, 18, 0.72);
	backdrop-filter: saturate(160%) blur(14px);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
	border-bottom-color: var(--line);
}

.nav__inner {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 clamp(1.1rem, 4vw, 2rem);
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.nav__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: -0.01em;
	color: #fff;
	margin-right: auto;
}

.nav__mark {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	background: var(--grad-cool);
	color: #04060d;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0;
	box-shadow: 0 6px 18px -6px rgba(79, 216, 255, 0.8);
}

.nav__menu {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nav__links {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav__links li { margin: 0; }

.nav__links a {
	display: block;
	padding: 0.45rem 0.85rem;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--text-soft);
	transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav__links a:hover,
.nav__links .is-active a {
	color: #fff;
	background: var(--glass-strong);
}

.nav__social {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0 0 0 0.5rem;
	border-left: 1px solid var(--line);
}

.nav__social li { margin: 0; }

.nav__social a {
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	color: var(--text-dim);
	transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav__social a:hover {
	color: #fff;
	background: var(--glass-strong);
	transform: translateY(-2px);
}

.nav__toggle {
	display: none;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 11px;
	background: var(--glass);
	color: var(--text);
	cursor: pointer;
	padding: 0;
	place-items: center;
}

.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
	content: '';
	display: block;
	width: 16px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav__toggle span::before { transform: translateY(-5px); }
.nav__toggle span::after { transform: translateY(3px); }

body.nav-open .nav__toggle span { background: transparent; }
body.nav-open .nav__toggle span::before { transform: rotate(45deg); }
body.nav-open .nav__toggle span::after { transform: translateY(-2px) rotate(-45deg); }

.nav__progress {
	position: absolute;
	left: 0;
	bottom: -1px;
	height: 2px;
	width: 0;
	background: var(--grad);
	transition: width 0.1s linear;
}

/* ============================================================
   5. Hero
   ============================================================ */

.hero {
	position: relative;
	min-height: min(100svh, 900px);
	display: flex;
	align-items: center;
	padding: calc(var(--nav-h) + 4rem) 0 4rem;
	overflow: hidden;
	isolation: isolate;
}

.hero__bg {
	position: absolute;
	inset: -8% 0 0 0;
	z-index: -2;
	background: url('../images/space/hero-carina.jpg') center 30% / cover no-repeat;
	will-change: transform;
	transform: translate3d(0, 0, 0);
}

.hero__scrim {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(180deg, rgba(4, 6, 13, 0.7) 0%, rgba(4, 6, 13, 0.3) 32%, rgba(4, 6, 13, 0.72) 80%, var(--space-900) 100%),
		linear-gradient(90deg, rgba(4, 6, 13, 0.92) 0%, rgba(4, 6, 13, 0.55) 42%, rgba(4, 6, 13, 0.12) 100%);
}

.hero__inner {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 clamp(1.1rem, 4vw, 2rem);
}

.hero__content { max-width: 46rem; }

.hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.4rem 0.95rem 0.4rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	background: rgba(8, 12, 22, 0.55);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	font-size: 0.8rem;
	color: var(--text-soft);
	margin-bottom: 1.6rem;
}

.hero__badge .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
	animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16); }
	50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0.05); }
}

.hero h1 {
	font-size: clamp(2.6rem, 7.5vw, 4.6rem);
	line-height: 1.03;
	margin-bottom: 0.35rem;
}

.hero__role {
	font-family: var(--font-display);
	font-size: clamp(1.05rem, 2.4vw, 1.5rem);
	font-weight: 500;
	color: var(--text);
	margin-bottom: 1.1rem;
}

.hero__role .sep { color: var(--text-dim); margin: 0 0.5rem; }

.hero__lede {
	font-size: clamp(1rem, 1.6vw, 1.15rem);
	color: var(--text-soft);
	max-width: 38rem;
	margin-bottom: 2rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	margin-bottom: 2.4rem;
}

.hero__meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1.4rem;
	list-style: none;
	margin: 0;
	padding: 1.5rem 0 0;
	border-top: 1px solid var(--line);
	max-width: 44rem;
}

.hero__meta li { margin: 0; }

.hero__meta b {
	display: block;
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	line-height: 1.25;
}

.hero__meta span {
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-dim);
}

.hero__credit {
	position: absolute;
	right: clamp(1rem, 4vw, 2rem);
	bottom: 1rem;
	font-size: 0.66rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(232, 237, 247, 0.42);
}

.hero__credit a { color: inherit; border-bottom: 1px dotted currentColor; }
.hero__credit a:hover { color: #fff; }

.scroll-cue {
	position: absolute;
	left: 50%;
	bottom: 1.4rem;
	transform: translateX(-50%);
	color: var(--text-dim);
	font-size: 1.1rem;
	animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
	0%, 100% { transform: translate(-50%, 0); }
	50% { transform: translate(-50%, 8px); }
}

/* Compact hero for interior pages */
.page-hero {
	position: relative;
	padding: calc(var(--nav-h) + clamp(3rem, 8vw, 5.5rem)) 0 clamp(2rem, 5vw, 3.5rem);
	overflow: hidden;
	isolation: isolate;
}

.page-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -2;
	background: url('../images/space/hero-carina.jpg') center 35% / cover no-repeat;
	opacity: 0.55;
}

.page-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(4, 6, 13, 0.86) 0%, rgba(4, 6, 13, 0.78) 40%, var(--space-900) 100%);
}

.page-hero h1 { margin-bottom: 0.4rem; }

.page-hero p.lede {
	font-size: 1.05rem;
	color: var(--text-soft);
	max-width: 46rem;
	margin: 0;
}

/* ============================================================
   6. Buttons, chips, tags
   ============================================================ */

.btn,
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.78rem 1.5rem;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: var(--glass);
	color: var(--text);
	font-family: var(--font-display);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover,
.button:hover {
	color: #fff;
	transform: translateY(-2px);
	border-color: var(--cyan);
	background: var(--glass-strong);
}

.btn--primary,
.button.special {
	background: var(--grad-cool);
	border-color: transparent;
	color: #04060d;
	box-shadow: 0 12px 32px -14px rgba(79, 216, 255, 0.9);
}

.btn--primary:hover,
.button.special:hover {
	color: #04060d;
	box-shadow: 0 18px 42px -14px rgba(167, 139, 250, 0.9);
	background: var(--grad-cool);
}

.btn--ghost { background: transparent; }

.button.small, .btn--small { padding: 0.55rem 1.05rem; font-size: 0.8rem; }
.button.big { padding: 0.95rem 1.9rem; font-size: 1rem; }
.button.fit { width: 100%; }

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	list-style: none;
	margin: 1.4rem 0;
	padding: 0;
}

.actions li { margin: 0; }
.actions.vertical { flex-direction: column; align-items: flex-start; }

.chips,
.pub-links,
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 1.2rem 0 0;
	padding: 0;
}

.chips li,
.pub-links li,
.tags li { margin: 0; }

.chips a,
.pub-links a {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 0.95rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--glass);
	color: var(--text-soft);
	font-size: 0.82rem;
	font-weight: 500;
	transition: all 0.2s var(--ease);
}

.chips a:hover,
.pub-links a:hover {
	color: #fff;
	border-color: var(--cyan);
	background: rgba(79, 216, 255, 0.12);
	transform: translateY(-2px);
}

.chips .icon::before,
.pub-links .icon::before { color: var(--cyan); }

.pub-links.big a { padding: 0.6rem 1.15rem; font-size: 0.88rem; }

.tags li {
	padding: 0.38rem 0.85rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--glass);
	font-size: 0.8rem;
	color: var(--text-soft);
	transition: all 0.2s var(--ease);
}

.tags li:hover {
	color: #fff;
	border-color: var(--line-strong);
	background: var(--glass-strong);
	transform: translateY(-2px);
}

/* Font Awesome helpers carried over from the old theme */
.icon {
	position: relative;
	text-decoration: none;
}

.icon > .label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.icon::before {
	font-family: FontAwesome;
	font-style: normal;
	font-weight: normal;
	text-transform: none !important;
	-webkit-font-smoothing: antialiased;
}

/* ============================================================
   7. Panels & cards
   ============================================================ */

.panel {
	position: relative;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: var(--shadow);
	padding: clamp(1.5rem, 3.5vw, 2.5rem);
}

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
	gap: 1.25rem;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0;
	background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(79, 216, 255, 0.16), transparent 65%);
	transition: opacity 0.35s var(--ease);
}

.card:hover {
	transform: translateY(-6px);
	border-color: var(--line-strong);
	box-shadow: var(--shadow-lift);
}

.card:hover::after { opacity: 1; }

.card__media {
	position: relative;
	height: 104px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, rgba(79, 216, 255, 0.22), rgba(167, 139, 250, 0.22));
	border-bottom: 1px solid var(--line);
}

.card__media.alt { background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(255, 176, 102, 0.18)); }

.card__media .icon::before {
	font-size: 2rem;
	color: #fff;
	opacity: 0.9;
}

.card__media .tag {
	position: absolute;
	top: 0.7rem;
	right: 0.7rem;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	background: rgba(4, 6, 13, 0.6);
	border: 1px solid var(--line);
	font-size: 0.63rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-soft);
}

.card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 1.35rem 1.4rem 1.2rem;
}

.card__body h3 { font-size: 1.06rem; margin-bottom: 0.5rem; }
.card__body h3 a { color: #fff; }
.card__body h3 a:hover { color: var(--cyan); }

.card__body p {
	font-size: 0.9rem;
	line-height: 1.65;
	color: var(--text-soft);
	flex: 1 1 auto;
	margin-bottom: 1.1rem;
}

.card__foot {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	font-size: 0.8rem;
	font-weight: 500;
	padding-top: 0.9rem;
	border-top: 1px solid var(--line);
}

.card__foot .meta {
	margin-left: auto;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	color: var(--text-dim);
}

/* Two-column feature layout */
.duo {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1.25rem;
}

.duo__col {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
	padding: 1.6rem;
	transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.duo__col:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.duo__col h3 {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 1.05rem;
	margin-bottom: 1.1rem;
}

.duo__col h3 .icon::before { color: var(--cyan); }

/* ============================================================
   8. About block
   ============================================================ */

.about {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.9fr);
	gap: clamp(2rem, 5vw, 3.5rem);
	align-items: center;
}

.about__body p { font-size: 1.02rem; }

.about__photo { position: relative; }

.about__photo img {
	width: 100%;
	border-radius: var(--radius-l);
	border: 1px solid var(--line-strong);
	box-shadow: var(--shadow);
}

.about__photo::before {
	content: '';
	position: absolute;
	inset: -14px;
	border-radius: calc(var(--radius-l) + 12px);
	background: var(--grad);
	opacity: 0.28;
	filter: blur(28px);
	z-index: -1;
}

/* ============================================================
   9. Stats
   ============================================================ */

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1px;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	overflow: hidden;
	background: var(--line);
}

.stats .stat {
	margin: 0;
	padding: 1.9rem 1.4rem;
	text-align: center;
	background: rgba(9, 13, 24, 0.72);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: background 0.3s var(--ease);
}

.stats .stat:hover { background: rgba(18, 26, 46, 0.86); }

.stat__num {
	display: block;
	font-family: var(--font-display);
	font-size: clamp(2rem, 4vw, 2.8rem);
	font-weight: 700;
	line-height: 1;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.stat__label {
	display: block;
	margin-top: 0.6rem;
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--text-dim);
}

/* ============================================================
   10. Impact / feature banner
   ============================================================ */

.impact {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: clamp(1.5rem, 4vw, 2.6rem);
	align-items: center;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	padding: clamp(1.6rem, 4vw, 2.6rem);
	background:
		radial-gradient(900px 400px at 0% 0%, rgba(79, 216, 255, 0.16), transparent 60%),
		radial-gradient(700px 400px at 100% 100%, rgba(255, 176, 102, 0.14), transparent 60%),
		rgba(9, 13, 24, 0.7);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: var(--shadow);
}

.impact h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.7rem; }

.impact__media {
	position: relative;
	display: block;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--line-strong);
	box-shadow: var(--shadow);
}

.impact__media img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.5s var(--ease);
}

.impact__media:hover img { transform: scale(1.06); }

.impact__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 62px;
	height: 62px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: rgba(4, 6, 13, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.4);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.impact__media:hover .impact__play {
	background: var(--cyan);
	transform: translate(-50%, -50%) scale(1.08);
}

.impact__play .icon::before {
	color: #fff;
	font-size: 1.35rem;
	margin-left: 4px;
}

.impact__media:hover .impact__play .icon::before { color: #04060d; }

/* ============================================================
   11. Timeline & news
   ============================================================ */

.timeline,
.news {
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
}

.timeline { max-width: 54rem; }

.timeline::before,
.news::before {
	content: '';
	position: absolute;
	left: 7px;
	top: 8px;
	bottom: 8px;
	width: 2px;
	background: linear-gradient(180deg, var(--cyan), var(--violet), transparent);
	opacity: 0.35;
}

.timeline__item,
.news li {
	position: relative;
	margin: 0;
	padding: 0 0 2rem 2.6rem;
}

.timeline__item:last-child,
.news li:last-child { padding-bottom: 0; }

.timeline__dot,
.news li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 7px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--grad-cool);
	box-shadow: 0 0 0 4px rgba(79, 216, 255, 0.12);
}

.timeline__year,
.news .when {
	display: inline-block;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cyan);
	margin-bottom: 0.35rem;
}

.timeline__item h3 { font-size: 1.12rem; margin-bottom: 0.25rem; }

.timeline__where {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 0.5rem;
}

.timeline__item p:last-child,
.news p {
	font-size: 0.94rem;
	line-height: 1.7;
	color: var(--text-soft);
	margin: 0;
}

.news { max-width: 50rem; }

/* ============================================================
   12. Publications
   ============================================================ */

.pub-list { list-style: none; margin: 0; padding: 0; }

.pub-item {
	display: grid;
	grid-template-columns: 5.4rem minmax(0, 1fr);
	gap: 1.4rem;
	align-items: start;
	margin: 0 0 1rem 0;
	padding: 1.4rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
	transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.pub-item:hover {
	transform: translateY(-3px);
	border-color: var(--line-strong);
	box-shadow: var(--shadow-lift);
}

.pub-item__year {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	padding: 0.7rem 0.5rem;
	border-radius: var(--radius-s);
	border: 1px solid var(--line);
	background: rgba(79, 216, 255, 0.08);
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	line-height: 1;
}

.pub-item__year small {
	font-family: var(--font-mono);
	font-size: 0.58rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	color: var(--cyan);
}

.pub-item__body h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.pub-item__body h3 a { color: #fff; }
.pub-item__body h3 a:hover { color: var(--cyan); }

.pub-item__authors {
	font-size: 0.86rem;
	color: var(--text-dim);
	margin-bottom: 0.7rem;
}

.pub-item__cited {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	color: var(--text-dim);
	margin: 0.7rem 0 0;
}

.me { color: #fff; font-weight: 600; }

.scholar-metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1rem;
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 0;
}

.scholar-metrics li {
	margin: 0;
	padding: 1.2rem 1rem;
	text-align: center;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--glass);
}

.scholar-metrics__num {
	display: block;
	font-family: var(--font-display);
	font-size: 1.9rem;
	font-weight: 700;
	line-height: 1;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.scholar-metrics__label {
	display: block;
	margin-top: 0.45rem;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-dim);
}

/* Paper pages */
.paper-meta { margin-bottom: 2rem; }

.paper-meta .venue {
	display: inline-block;
	padding: 0.35rem 0.9rem;
	border-radius: 999px;
	background: var(--grad-cool);
	color: #04060d;
	font-family: var(--font-display);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 1rem;
}

.paper-meta .authors {
	color: var(--text-soft);
	font-size: 0.98rem;
	margin-bottom: 1.2rem;
}

.paper-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-l);
	overflow: hidden;
	border: 1px solid var(--line-strong);
	box-shadow: var(--shadow);
	margin-bottom: 2.5rem;
}

.paper-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2.5rem;
	font-weight: 600;
}

.callout {
	border: 1px solid var(--line);
	border-left: 3px solid var(--cyan);
	border-radius: var(--radius-s);
	background: rgba(79, 216, 255, 0.06);
	padding: 1.15rem 1.35rem;
	margin: 1.8rem 0;
}

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

/* ============================================================
   13. Prose (markdown content pages)
   ============================================================ */

.prose { max-width: 58rem; }

.prose h2 {
	margin-top: 2.8rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--line);
}

.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; }
.prose ul { padding-left: 1.15rem; }
.prose ul li::marker { color: var(--cyan); }
.prose li > ul { margin-top: 0.5rem; }

.prose .image.main,
.image.main {
	margin: 2rem 0;
	border-radius: var(--radius-l);
	overflow: hidden;
	border: 1px solid var(--line);
}

.table-wrapper { overflow-x: auto; margin: 1.5rem 0; }

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

th, td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
}

th { color: #fff; font-family: var(--font-display); font-weight: 600; }
td { color: var(--text-soft); }

/* Identity card on the experience page */
.id-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 1.5rem;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	background: var(--glass);
	padding: clamp(1.3rem, 3vw, 1.9rem);
	margin-bottom: 2.5rem;
}

.id-card p { margin: 0; }
.id-card__lines { display: grid; gap: 0.3rem; font-size: 0.94rem; }

/* ============================================================
   14. Footer
   ============================================================ */

.site-footer {
	position: relative;
	margin-top: clamp(3rem, 8vw, 6rem);
	border-top: 1px solid var(--line);
	background: linear-gradient(180deg, rgba(4, 6, 13, 0.2), rgba(4, 6, 13, 0.85));
	padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(140px, 1fr));
	gap: 2rem;
	margin-bottom: 2.5rem;
}

.site-footer h2 {
	font-size: 1.5rem;
	margin-bottom: 0.6rem;
}

.site-footer h4 {
	font-size: 0.78rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-bottom: 0.9rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.site-footer ul a { color: var(--text-soft); }
.site-footer ul a:hover { color: #fff; }

.footer-social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 1.2rem 0 0;
	padding: 0;
}

.footer-social li { margin: 0; }

.footer-social a {
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--glass);
	color: var(--text-soft);
	transition: all 0.2s var(--ease);
}

.footer-social a:hover {
	color: #fff;
	border-color: var(--cyan);
	background: rgba(79, 216, 255, 0.12);
	transform: translateY(-3px);
}

.site-footer__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	padding-top: 1.4rem;
	border-top: 1px solid var(--line);
	font-size: 0.78rem;
	color: var(--text-dim);
}

.site-footer__bar p { margin: 0; color: inherit; }

.to-top {
	position: fixed;
	right: 1.2rem;
	bottom: 1.2rem;
	z-index: 90;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line-strong);
	border-radius: 14px;
	background: rgba(9, 13, 24, 0.8);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: var(--text);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: all 0.3s var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: #fff; border-color: var(--cyan); }

/* ============================================================
   15. Motion
   ============================================================ */

.reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible { opacity: 1; transform: none; }

.reveal:nth-child(2) { transition-delay: 0.07s; }
.reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal:nth-child(4) { transition-delay: 0.21s; }
.reveal:nth-child(5) { transition-delay: 0.28s; }
.reveal:nth-child(6) { transition-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
	.scroll-cue, .hero__badge .dot { animation: none; }
	.hero__bg { transform: none !important; }
	* { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   16. Responsive
   ============================================================ */

@media (max-width: 980px) {
	.about { grid-template-columns: 1fr; }
	.about__photo { max-width: 260px; }
	.impact { grid-template-columns: 1fr; }
	.impact__media { order: -1; }
}

@media (max-width: 860px) {
	:root { --nav-h: 62px; }

	.site-footer__grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

	.nav__toggle { display: grid; }

	.nav__menu {
		position: fixed;
		inset: var(--nav-h) 0 auto 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0.25rem;
		padding: 1rem clamp(1.1rem, 4vw, 2rem) 1.4rem;
		background: rgba(6, 9, 18, 0.96);
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
		border-bottom: 1px solid var(--line);
		transform: translateY(-8px);
		opacity: 0;
		visibility: hidden;
		transition: all 0.25s var(--ease);
	}

	body.nav-open .nav__menu { opacity: 1; visibility: visible; transform: none; }

	.nav__links { flex-direction: column; align-items: stretch; }
	.nav__links a { padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 0.95rem; }

	.nav__social {
		border-left: 0;
		border-top: 1px solid var(--line);
		padding: 0.8rem 0 0;
		margin-top: 0.4rem;
		justify-content: flex-start;
		flex-wrap: wrap;
	}

	.hero { min-height: auto; padding-top: calc(var(--nav-h) + 3.5rem); }
	.hero__credit { position: static; display: block; margin-top: 2rem; text-align: left; }
	.scroll-cue { display: none; }

	.id-card { grid-template-columns: 1fr; }
	.pub-item { grid-template-columns: 1fr; gap: 1rem; }
	.pub-item__year { flex-direction: row; gap: 0.5rem; width: fit-content; padding: 0.45rem 0.85rem; }
}

@media (max-width: 560px) {
	.hero__meta { gap: 1.2rem 1.8rem; }
	.hero__meta b { font-size: 1.25rem; }
	.hero__actions .btn { width: 100%; }
}
