/* Howard Hui — site stylesheet (2026 redesign, no framework) */

:root {
	--ink: #1b2230;
	--muted: #586274;
	--line: #e2e6ec;
	--soft: #f4f6f9;
	--navy: #0d1a30;
	--navy-2: #16294a;
	--accent: #ff6c0c;          /* Caltech orange, for small accents only */
	--accent-ink: #b9440a;      /* darker orange that reads well as text */
	--link: #1f55c4;
	--maxw: 1120px;
	--prose: 760px;
	--radius: 10px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.68;
	color: var(--ink);
	background: #fff;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.8rem; margin: 0 0 1rem; }
h3 { font-size: 1.22rem; margin: 2.2rem 0 .5rem; }
p { margin: 0 0 1.05rem; }
sup, sub { line-height: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--prose); }
.center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow {
	display: block;
	margin: 0 0 .6rem;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent);
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 6px; }

/* ---------- Header and navigation ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(13, 26, 48, .95);
	-webkit-backdrop-filter: saturate(1.4) blur(8px);
	backdrop-filter: saturate(1.4) blur(8px);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.site-header .bar {
	max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
	height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand { color: #fff; font-weight: 700; font-size: 1.12rem; letter-spacing: .01em; }
.brand:hover { text-decoration: none; color: #fff; }
.nav { display: flex; gap: 2px; }
.nav a {
	color: #cfd8e6; font-size: .95rem; font-weight: 500;
	padding: 8px 12px; border-radius: 6px;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
.nav-toggle {
	display: none; width: 44px; height: 44px; margin-right: -10px;
	background: none; border: 0; cursor: pointer; padding: 11px 10px;
}
.nav-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; margin: 5px 0; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
	.nav-toggle { display: block; }
	.nav {
		display: none; position: absolute; top: 64px; left: 0; right: 0;
		flex-direction: column; gap: 0; padding: 8px 16px 18px;
		background: var(--navy); box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
	}
	.nav.open { display: flex; }
	.nav a { padding: 12px 10px; font-size: 1.02rem; }
	.nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 6px 6px 0; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6rem; }
.btn {
	display: inline-block; padding: 10px 20px; border-radius: 999px;
	font-weight: 600; font-size: .95rem; line-height: 1.4;
	background: var(--accent); color: #fff;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: rgba(255, 255, 255, .06); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .65); }
.btn.ghost:hover { background: rgba(255, 255, 255, .14); filter: none; }
.btn.outline { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.outline:hover { box-shadow: inset 0 0 0 1.5px var(--navy); filter: none; }

/* ---------- Home hero ---------- */
.hero {
	position: relative; color: #fff;
	background: var(--navy) url(../../images/banner.jpg) center 35% / cover no-repeat;
	min-height: min(72vh, 640px); display: flex; align-items: center;
}
.hero::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(100deg, rgba(8, 15, 30, .82) 0%, rgba(8, 15, 30, .55) 45%, rgba(8, 15, 30, .15) 100%);
}
.hero .inner { position: relative; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 96px 24px 80px; }
.hero h1 { color: #fff; font-size: clamp(2.7rem, 6.5vw, 4.4rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 .3rem; }
.hero .role { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: #e8eef7; margin: 0 0 1.1rem; font-weight: 500; }
.hero .lede { max-width: 600px; font-size: 1.12rem; color: #d2dbe9; margin: 0; }

/* ---------- Subpage header ---------- */
.page-head {
	position: relative; color: #fff;
	background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%);
	background-size: cover; background-position: center;
}
.page-head.photo::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(100deg, rgba(8, 15, 30, .86) 0%, rgba(8, 15, 30, .6) 55%, rgba(8, 15, 30, .3) 100%);
}
.page-head .inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 76px 24px 56px; }
.page-head h1 { color: #fff; font-size: clamp(2.1rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 .6rem; }
.page-head p { max-width: 700px; color: #d7e0ec; font-size: 1.12rem; margin: 0; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section.tight { padding: 56px 0; }
.section.alt { background: var(--soft); }
.section-head { margin-bottom: 2rem; }
.section-head h2 { margin-bottom: .4rem; }
.section-head p { color: var(--muted); max-width: var(--prose); margin: 0; }

/* About block on the home page */
.about { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 56px; align-items: start; }
.about .portrait img { border-radius: 14px; box-shadow: 0 12px 32px rgba(13, 26, 48, .16); }
.about .portrait figcaption { font-size: .86rem; color: var(--muted); margin-top: .6rem; }
.about h2 { margin-top: 0; }
@media (max-width: 860px) {
	.about { grid-template-columns: 1fr; gap: 32px; }
	.about .portrait { max-width: 380px; }
}

/* Research cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.card {
	background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
	display: flex; flex-direction: column;
	transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 14px 30px rgba(13, 26, 48, .12); transform: translateY(-2px); }
.card > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 .5rem; }
.card p { color: var(--muted); font-size: .97rem; }
.card .more { margin-top: auto; font-weight: 600; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

/* Highlights list */
.news { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.news li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news .when { color: var(--accent-ink); font-weight: 700; font-size: .9rem; padding-top: .12rem; white-space: nowrap; }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Long-form pages (Science, Technology) ---------- */
.article { max-width: 900px; margin: 0 auto; }
.article > h2 { margin-top: 4rem; padding-top: 2.6rem; border-top: 1px solid var(--line); }
.article > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.paper { display: block; margin: -.15rem 0 1.1rem; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.paper::before { content: "Paper"; display: inline-block; margin-right: .55rem; padding: 1px 8px; border-radius: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: #fff1e8; vertical-align: 1px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 3rem; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--navy); background: #fff; }
.toc a:hover { border-color: var(--navy); text-decoration: none; }

figure { margin: 1.8rem 0; }
figcaption { font-size: .9rem; line-height: 1.5; color: var(--muted); margin-top: .65rem; }
figure img { border-radius: 6px; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: center; }
.figs > img, .figs > a > img { width: 100%; }
.figs + figcaption { margin-top: .8rem; }
.fig-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.float-right, .float-left { width: 44%; margin-top: .35rem; margin-bottom: 1rem; }
.float-right { float: right; margin-left: 2rem; }
.float-left { float: left; margin-right: 2rem; }
.clear { clear: both; }
@media (max-width: 720px) {
	.figs { grid-template-columns: 1fr; }
	.float-right, .float-left { float: none; width: 100%; margin: 1.4rem 0; }
}

/* ---------- Outreach page ---------- */
.event + .event { margin-top: 64px; padding-top: 56px; border-top: 1px solid var(--line); }
.event .text { max-width: var(--prose); }
.event h3 { margin-top: 0; font-size: 1.5rem; }
.event .meta { color: var(--accent-ink); font-weight: 600; font-size: .92rem; margin-bottom: .5rem; }
.event .photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 1.6rem; }
.event .photos figure { margin: 0; }
.event .photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.event .photos.single { grid-template-columns: 1fr; max-width: 920px; }
.event .photos.single img { aspect-ratio: auto; }
@media (max-width: 680px) { .event .photos { grid-template-columns: 1fr; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; transition: filter .2s; }
.gallery a:hover img { filter: brightness(1.08); }
.gallery figcaption { font-size: .88rem; }
a.zoom { display: block; cursor: zoom-in; }

.press { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.press li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.press .title { font-weight: 600; font-size: 1.05rem; }
.press .src { display: block; font-size: .88rem; color: var(--accent-ink); font-weight: 600; margin-bottom: .15rem; }
.press p { margin: .3rem 0 0; color: var(--muted); font-size: .95rem; }

.timeline { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; }
.timeline li { break-inside: avoid; padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.timeline .yr { color: var(--muted); font-size: .9rem; white-space: nowrap; }
@media (max-width: 720px) { .timeline { columns: 1; } }

/* ---------- Outdoor page ---------- */
.trip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; align-items: start; }
.trip + .trip { margin-top: 56px; padding-top: 48px; border-top: 1px solid var(--line); }
.trip h2 { font-size: 1.5rem; margin-top: 0; }
.trip .photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trip .photos figure { margin: 0; }
.trip .photos .wide { grid-column: 1 / -1; }
.trip .photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
@media (max-width: 820px) { .trip { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- Contact page ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 56px; align-items: start; }
.contact dl { margin: 0; }
.contact dt { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 1.4rem; }
.contact dt:first-child { margin-top: 0; }
.contact dd { margin: .2rem 0 0; font-size: 1.05rem; }
.contact figure { margin: 0; }
.contact figure img { border-radius: 12px; box-shadow: 0 12px 32px rgba(13, 26, 48, .14); }
.calendar { margin-top: 1.4rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.calendar iframe { display: block; width: 100%; height: 640px; border: 0; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } .contact figure { max-width: 420px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #aeb9cc; font-size: .92rem; line-height: 1.6; padding: 48px 0 40px; }
.site-footer .cols { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 32px; }
.site-footer strong { color: #fff; font-size: 1rem; }
.site-footer a { color: #dfe6f1; }
.site-footer .links a { display: block; }
.site-footer .fine { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; color: #8592a8; }
.site-footer .fine a { color: #aeb9cc; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- Lightbox ---------- */
dialog.lightbox {
	border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible;
}
dialog.lightbox::backdrop { background: rgba(5, 10, 20, .96); }
dialog.lightbox img { max-width: 94vw; max-height: 82vh; width: auto; height: auto; border-radius: 6px; margin: 0 auto; }
dialog.lightbox p { color: #dfe6f1; text-align: center; font-size: .95rem; margin: .8rem auto 0; max-width: 760px; }
dialog.lightbox .lb-close {
	position: fixed; top: 14px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 44px; cursor: pointer;
}
dialog.lightbox .lb-close:hover { background: rgba(255, 255, 255, .24); }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.card, .nav-toggle span { transition: none; }
}
@media print {
	.site-header, .site-footer, .nav-toggle, .actions { display: none; }
	.hero, .page-head { background: none !important; color: var(--ink); }
	.hero h1, .page-head h1, .hero .role, .hero .lede, .page-head p { color: var(--ink); }
}

/* Outdoor: one tall photo beside two stacked photos */
.trip .photos .tall { grid-row: span 2; }
.trip .photos .tall a, .trip .photos .tall img { height: 100%; }
.trip .photos .tall img { aspect-ratio: auto; object-fit: cover; object-position: center 30%; }

/* Link card to a video on YouTube */
.video-card {
	display: flex; align-items: center; gap: 20px; max-width: 920px; margin-top: 1.6rem;
	padding: 20px 24px; border-radius: 12px; color: #fff;
	background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%);
	transition: box-shadow .2s, transform .2s;
}
.video-card:hover { text-decoration: none; box-shadow: 0 12px 28px rgba(13, 26, 48, .25); transform: translateY(-1px); }
.video-card .play { flex: none; position: relative; width: 64px; height: 44px; border-radius: 12px; background: #ff0000; }
.video-card .play::after {
	content: ""; position: absolute; left: 26px; top: 13px;
	border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.video-card .label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.video-card strong { display: block; font-size: 1.15rem; color: #fff; margin: .1rem 0; }
.video-card .sub { display: block; font-size: .92rem; color: #c9d3e3; }

/* Two photos side by side at equal height, widths set by each image's aspect ratio (--ar) */
.event .photos.pair { display: flex; gap: 18px; align-items: flex-start; }
.event .photos.pair figure { flex: var(--ar, 1) 1 0; min-width: 0; }
.event .photos.pair img { aspect-ratio: auto; }
@media (max-width: 680px) { .event .photos.pair { flex-direction: column; } }
