/* =========================================================
   Martin P. Rey — academic site
   Modern, light, leadership-focused. No build step required.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
	--navy:        #16263f;   /* deep navy — primary brand / headings */
	--navy-soft:   #24405f;
	--ink:         #1d2535;   /* body text (charcoal-navy) */
	--muted:       #5a6679;   /* secondary text */
	--line:        #e4e8ef;   /* hairlines / borders */
	--bg:          #ffffff;
	--bg-alt:      #f6f8fb;   /* soft section background */
	--bg-deep:     #0f1b2d;   /* dark band */
	--accent:      #c8801f;   /* warm gold, drawn from the simulation figures */
	--accent-soft: #f3e3c8;
	--accent-ink:  #9c6310;
	--radius:      14px;
	--radius-sm:   10px;
	--shadow:      0 1px 2px rgba(16,27,45,.04), 0 8px 28px rgba(16,27,45,.07);
	--shadow-lg:   0 18px 50px rgba(16,27,45,.14);
	--maxw:        1240px;
	--font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-serif:  "Newsreader", Georgia, "Times New Roman", serif;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.18; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin: .25rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--tight { padding: 48px 0; }
.center { text-align: center; }
.lead { font-size: 1.22rem; line-height: 1.6; color: var(--muted); }
.eyebrow {
	display: inline-block;
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent-ink);
	margin-bottom: .9rem;
}
.section-head { max-width: 760px; margin: 0 0 2.5rem; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; margin-bottom: 0; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; gap: .5em;
	font-weight: 600; font-size: .98rem;
	padding: .72em 1.4em;
	border-radius: 999px;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-soft); color: #fff; box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* ---------- Header / nav ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255,255,255,.86);
	backdrop-filter: saturate(150%) blur(10px);
	-webkit-backdrop-filter: saturate(150%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font-family: var(--font-serif); font-size: 1.18rem; font-weight: 600; color: var(--navy); letter-spacing: .01em; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
	display: inline-block; padding: .45rem .7rem; border-radius: 8px;
	font-size: .94rem; font-weight: 500; color: var(--ink);
}
.nav-links a:hover { background: var(--bg-alt); color: var(--navy); }
.nav-links a.active { color: var(--accent-ink); }
.nav-cta { margin-left: .4rem; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; color: var(--navy); cursor: pointer; padding: .3rem; }

/* ---------- Hero ---------- */
.hero { padding: 76px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .85fr; gap: 56px; align-items: center; }
.hero h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(2.1rem, 4.4vw, 3.2rem); letter-spacing: -.01em; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { margin-top: 1.1rem; max-width: 38ch; }
.hero-portrait { position: relative; }
.hero-portrait img {
	width: 100%; border-radius: 18px; box-shadow: var(--shadow-lg);
	aspect-ratio: 4/5; object-fit: cover; object-position: center 22%;
}
.hero-portrait::before {
	content: ""; position: absolute; inset: auto -18px -18px auto;
	width: 62%; height: 62%; border-radius: 18px;
	background: linear-gradient(135deg, var(--accent-soft), #fff0);
	z-index: -1;
}
.social-row { display: flex; gap: .55rem; margin-top: 1.5rem; flex-wrap: wrap; }
.social-row a {
	display: inline-flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; border-radius: 50%;
	border: 1.5px solid var(--line); color: var(--navy); font-size: 1.05rem;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent-ink); background: #fff; transform: translateY(-1px); }
.social-row a img.ico-svg, .footer-social a img.ico-svg { width: 17px; height: 17px; display: block; }

/* ---------- Figure band (science visual) ---------- */
.figure {
	margin: 0; border-radius: var(--radius); overflow: hidden;
	box-shadow: var(--shadow); background: var(--bg-deep);
}
.figure img { width: 100%; display: block; }
.figure figcaption {
	font-size: .85rem; color: var(--muted); padding: .7rem 1rem;
	background: #fff; border-top: 1px solid var(--line);
}
.figure figcaption .cred { color: #97a1b3; }
.figure--hero { position: relative; }
.figure--hero img { max-height: 460px; object-fit: cover; }

/* image credit chip overlaid on dark images */
.credit-chip {
	position: absolute; right: 10px; bottom: 10px;
	font-size: .72rem; color: rgba(255,255,255,.82);
	background: rgba(0,0,0,.42); padding: .2rem .55rem; border-radius: 6px;
	backdrop-filter: blur(2px);
}

/* ---------- Metrics strip ---------- */
.metrics {
	display: grid; grid-template-columns: repeat(5, 1fr);
	gap: 1px; background: var(--line);
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.metric { background: #fff; padding: 1.5rem 1rem; text-align: center; }
.metric .num { font-family: var(--font-serif); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; color: var(--accent-ink); line-height: 1.1; }
.metric .lbl { font-size: .82rem; color: var(--muted); margin-top: .35rem; letter-spacing: .01em; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	padding: 1.6rem; box-shadow: var(--shadow);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
	display: flex; flex-direction: column;
}
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d6deea; }
.card .kicker { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: .6rem; }
.card h3 { font-size: 1.18rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .98rem; margin-bottom: .9rem; }
.card .card-more { margin-top: auto; font-weight: 600; font-size: .92rem; color: var(--navy); }
.card .card-more::after { content: " \2192"; color: var(--accent); }
.card--feature { border-top: 3px solid var(--accent); }
.card-icon { font-size: 1.3rem; color: var(--accent); margin-bottom: .8rem; }

/* media card with thumbnail */
.card-media { padding: 0; overflow: hidden; }
.card-media .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-deep); }
.card-media .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-media:hover .thumb img { transform: scale(1.04); }
.card-media .body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }

/* ---------- Research / prose blocks ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.6rem; margin-top: 0; }
.prose p, .prose li { color: var(--ink); }
.topic {
	display: grid; grid-template-columns: 1fr; gap: 1.2rem;
	padding: 2.2rem 0; border-top: 1px solid var(--line);
}
.topic:first-of-type { border-top: 0; }
.topic .tnum { font-family: var(--font-serif); color: var(--accent); font-size: 1.05rem; font-weight: 600; }
.topic h3 { font-size: 1.35rem; margin-bottom: .3rem; }
.topic-figure { margin: 0; }
.topic-figure img { border-radius: var(--radius-sm); width: 100%; box-shadow: var(--shadow); }
.topic-figure figcaption { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
@media (min-width: 800px) {
	.topic.has-fig { grid-template-columns: 1.4fr 1fr; gap: 2.4rem; align-items: start; }
	.topic.has-fig.flip .topic-figure { order: -1; }
}

/* ---------- Publication list ---------- */
.pub { padding: 1.4rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; }
.pub:first-of-type { border-top: 0; }
.pub .year { font-family: var(--font-serif); font-weight: 600; color: var(--accent-ink); font-size: 1.05rem; white-space: nowrap; }
.pub h3 { font-size: 1.12rem; margin-bottom: .25rem; }
.pub .authors { font-size: .92rem; color: var(--muted); margin-bottom: .4rem; }
.pub .authors .self { color: var(--ink); font-weight: 600; }
.pub .sig { color: var(--ink); margin-bottom: .5rem; }
.pub .venue { font-size: .88rem; color: var(--muted); font-style: italic; }
.pub .links { margin-top: .5rem; display: flex; gap: .8rem; flex-wrap: wrap; font-size: .9rem; font-weight: 600; }

/* ---------- Team ---------- */
.person { text-align: center; }
.person .avatar {
	width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
	margin: 0 auto .9rem; box-shadow: var(--shadow); background: var(--bg-alt);
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-serif); font-size: 2rem; color: var(--accent-ink);
}
.person img.avatar { display: block; }
.person h3 { font-size: 1.08rem; margin-bottom: .15rem; }
.person .role { font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); }
.person p { font-size: .92rem; color: var(--muted); margin: .5rem 0 0; }

/* ---------- Callout / join box ---------- */
.callout {
	background: var(--bg-deep); color: #e8edf5; border-radius: var(--radius);
	padding: 2.6rem; position: relative; overflow: hidden;
}
.callout h2, .callout h3 { color: #fff; }
.callout p { color: #c2cdde; }
.callout .eyebrow { color: var(--accent); }
.callout a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.callout a:hover { color: var(--accent); }
.callout .btn { text-decoration: none; }
.callout .btn-accent { color: #fff; }
.callout .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.callout .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.callout::after {
	content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
	border-radius: 50%; background: radial-gradient(circle, rgba(200,128,31,.35), transparent 70%);
}
.callout > * { position: relative; z-index: 1; }

/* ---------- Pills / tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: .3rem 0 1rem; list-style: none; padding: 0; }
.tags li { font-size: .8rem; font-weight: 600; color: var(--navy); background: var(--bg-alt); border: 1px solid var(--line); padding: .25rem .7rem; border-radius: 999px; margin: 0; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { padding: 60px 0 8px; }
.page-hero h1 { font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero .lead { margin-top: .6rem; max-width: 62ch; }

/* ---------- Definition / info rows ---------- */
.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.5rem; }
.tally .num { font-family: var(--font-serif); font-size: 1.8rem; color: var(--accent-ink); font-weight: 600; }
.tally .lbl { font-size: .9rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-deep); color: #aeb9cc; padding: 56px 0 32px; margin-top: 0; }
.site-footer a { color: #d7deea; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; font-weight: 700; }
.site-footer .brand { color: #fff; display: block; margin-bottom: .6rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: .35rem 0; font-size: .95rem; }
.footer-social { display: flex; gap: .5rem; margin-top: 1rem; }
.footer-social a {
	width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid rgba(255,255,255,.18); color: #d7deea;
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }
.footer-bottom { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #8a96aa; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.footer-bottom .credits { max-width: 70ch; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.note { font-size: .92rem; color: var(--muted); background: var(--bg-alt); border-left: 3px solid var(--accent); padding: .9rem 1.1rem; border-radius: 0 8px 8px 0; }

/* recruitment band */
.recruit { max-width: 820px; margin: 0 auto; text-align: center; font-size: 1.12rem; line-height: 1.55; color: var(--ink); }
.recruit a { font-weight: 600; }

/* project impact statement */
.impact { font-style: italic; color: var(--ink); border-left: 3px solid var(--accent); padding-left: .85rem; margin: .1rem 0 1rem; font-size: .96rem; }

/* research "current projects" line */
.proj { font-size: .95rem; color: var(--muted); margin: .2rem 0 .7rem; }
.proj strong { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.hero-grid { grid-template-columns: 1fr; gap: 36px; }
	.hero-portrait { max-width: 360px; }
	.grid-3 { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
	body { font-size: 16px; }
	.section { padding: 52px 0; }
	.nav-links {
		position: fixed; inset: 66px 0 auto 0;
		flex-direction: column; align-items: stretch; gap: 0;
		background: #fff; border-bottom: 1px solid var(--line);
		padding: .5rem 16px 1rem; box-shadow: var(--shadow);
		display: none;
	}
	.nav-links.open { display: flex; }
	.nav-links a { padding: .8rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
	.nav-links .nav-cta { margin: .7rem 0 0; }
	.nav-links .nav-cta .btn { width: 100%; justify-content: center; }
	.nav-toggle { display: inline-block; }
	.grid-3, .grid-2 { grid-template-columns: 1fr; }
	.pub { grid-template-columns: 1fr; gap: .3rem; }
	.callout { padding: 1.8rem; }
}
@media (max-width: 480px) {
	.metrics { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
}
