
	/* ==========================================================
	   Page-level layout (mirrors stargazerMapDoc.html conventions)
	   ========================================================== */
	#header-placeholder {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 1000;
	}

	.portfolio-main {
		max-width: 1000px;
		margin: 0 auto;
		padding: 120px 20px 60px;
	}

	.portfolio-main h1 {
		color: #fff;
		text-align: center;
		margin-bottom: 0.25em;
		border-bottom: 1px solid #333;
		padding-bottom: 0.5em;
	}

	.portfolio-intro {
		text-align: center;
		color: #bbb;
		max-width: 650px;
		margin: 0 auto 3em;
	}

	/* ==========================================================
	   Project row: media on one side, text on the other,
	   alternating sides on every other project.
	   ========================================================== */
	.project {
		margin-bottom: 70px;
	}

	.project-row {
		display: flex;
		align-items: center;
		gap: 40px;
	}

	/* Flip the order for every 2nd project */
	.project:nth-of-type(even) .project-row {
		flex-direction: row-reverse;
	}

	.project-media {
		flex: 0 0 auto;
		max-width: 60%;
	}

	.project-info {
		flex: 1 1 auto;
		min-width: 0;
	}

	/* Media keeps a constant rendered height; its width follows the
	   image/video's own aspect ratio, so the text column beside it
	   grows narrower for widescreen shots and wider for portrait ones. */
	.project-media img,
	.project-media video {
		display: block;
		height: 320px;
		width: auto;
		max-width: 620px;
		border-radius: 8px;
		border: 2px solid #000;
		object-fit: cover;
	}

	.project-info h2 {
		color: #fff;
		font-weight: 600;
		margin-top: 0;
		border-left: 4px solid #ff4c4c;
		padding-left: 10px;
	}

	.project-info .project-tags {
		margin: 4px 0 14px;
	}

	.project-info .project-tags span {
		display: inline-block;
		background: #222;
		color: #ffcccc;
		border: 1px solid #333;
		font-size: 0.75em;
		padding: 3px 9px;
		border-radius: 999px;
		margin: 2px 4px 2px 0;
	}

	.project-info p {
		color: #ddd;
		line-height: 1.6;
	}

	/* ==========================================================
	   Toggleable detail / gallery region (native <details>)
	   ========================================================== */
	.project-toggle {
		margin-top: 16px;
		border: 1px solid #333;
		border-radius: 8px;
		background: #1c1c1c;
		overflow: hidden;
	}

	.project-toggle summary {
		list-style: none;
		cursor: pointer;
		padding: 12px 16px;
		font-weight: 600;
		color: #ff8080;
		display: flex;
		align-items: center;
		justify-content: space-between;
		user-select: none;
	}

	.project-toggle summary::-webkit-details-marker {
		display: none;
	}

	.project-toggle summary::after {
		content: "+";
		font-size: 1.3em;
		line-height: 1;
		color: #ff8080;
		transition: transform 0.25s ease;
	}

	.project-toggle[open] summary::after {
		transform: rotate(45deg);
	}

	.project-toggle summary:hover {
		background: #242424;
	}

	.project-toggle-content {
		padding: 4px 16px 20px;
		border-top: 1px solid #333;
	}

	.project-toggle-content p {
		color: #ccc;
		line-height: 1.6;
	}

	.project-toggle-content a {
		color: #ff8080;
		text-decoration: none;
	}

	.project-toggle-content a:hover {
		text-decoration: underline;
	}

	/* Media gallery inside the dropdown */
	.gallery {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 8px;
		margin: 14px 0;
	}

	.gallery img,
	.gallery video {
		width: 100%;
		height: 110px;
		object-fit: cover;
		border-radius: 6px;
		border: 1px solid #333;
		cursor: pointer;
		transition: transform 0.2s ease, border-color 0.2s ease;
	}

	.gallery img:hover,
	.gallery video:hover {
		transform: scale(1.04);
		border-color: #ff8080;
	}

	.project-links {
		margin-top: 10px;
	}

	.project-links a {
		display: inline-block;
		margin-right: 14px;
		font-size: 0.9em;
	}

	/* ==========================================================
	   Mobile: stack media above text, always in reading order
	   ========================================================== */
	@media (max-width: 1000px) and (min-width: 721px) {
		.project-media img,
		.project-media video {
			height: 240px;
			max-width: 480px;
		}
	}

	@media (max-width: 720px) {
		.project-row,
		.project:nth-of-type(even) .project-row {
			flex-direction: column;
		}

		.project-media,
		.project-info {
			flex: 1 1 100%;
			max-width: 100%;
		}

		.project-media img,
		.project-media video {
			height: auto;
			width: 100%;
			max-width: 100%;
			aspect-ratio: 4 / 3;
		}

		.gallery-item {
			height: 90px;
		}
	}

	/* Anchor targets: don't let the fixed navbar cover the heading on jump */
	.project {
		scroll-margin-top: 100px;
	}

	/* ==========================================================
	   Gallery items (mixed image / video / gif thumbnails)
	   ========================================================== */
	.gallery-item {
		position: relative;
		width: 100%;
		height: 110px;
		border-radius: 6px;
		border: 1px solid #333;
		overflow: hidden;
		cursor: pointer;
		transition: transform 0.2s ease, border-color 0.2s ease;
		background: #111;
	}

	.gallery-item:hover {
		transform: scale(1.04);
		border-color: #ff8080;
	}

	.gallery-item img,
	.gallery-item video {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
		pointer-events: none;
	}

	.gallery-item .play-badge {
		position: absolute;
		bottom: 6px;
		right: 6px;
		width: 22px;
		height: 22px;
		background: rgba(0, 0, 0, 0.7);
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		pointer-events: none;
	}

	.gallery-item .play-badge::after {
		content: "";
		border-style: solid;
		border-width: 5px 0 5px 8px;
		border-color: transparent transparent transparent #fff;
		margin-left: 2px;
	}

	/* ==========================================================
	   Side navigation — jump links to each project
	   ========================================================== */
	.side-nav {
		position: fixed;
		top: 130px;
		left: 24px;
		width: 190px;
		display: none;
		flex-direction: column;
		gap: 2px;
		z-index: 500;
	}

	.side-nav .side-nav-label {
		color: #777;
		font-size: 0.7em;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		margin-bottom: 6px;
		padding-left: 11px;
	}

	.side-nav a {
		color: #aaa;
		text-decoration: none;
		font-size: 0.85em;
		padding: 6px 10px;
		border-left: 3px solid #333;
		transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
	}

	.side-nav a:hover {
		color: #fff;
		border-left-color: #ff8080;
	}

	.side-nav a.active {
		color: #ff8080;
		border-left-color: #ff4c4c;
		background: rgba(255, 76, 76, 0.08);
	}

	/* Only show the side nav when there's actually room for it */
	@media (min-width: 1500px) {
		.side-nav {
			display: flex;
		}
	}

	/* ==========================================================
	   Lightbox
	   ========================================================== */
	.lightbox {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.94);
		z-index: 2000;
		align-items: center;
		justify-content: center;
	}

	.lightbox.open {
		display: flex;
	}

	.lightbox-content {
		max-width: 88vw;
		max-height: 85vh;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.lightbox-content img,
	.lightbox-content video {
		max-width: 88vw;
		max-height: 85vh;
		border-radius: 6px;
		object-fit: contain;
	}

	.lightbox-close,
	.lightbox-prev,
	.lightbox-next {
		position: fixed;
		background: rgba(0, 0, 0, 0.6);
		color: #fff;
		border: 1px solid #333;
		border-radius: 50%;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: background 0.2s ease, color 0.2s ease;
	}

	.lightbox-close:hover,
	.lightbox-prev:hover,
	.lightbox-next:hover {
		background: rgba(255, 76, 76, 0.85);
		color: #fff;
	}

	.lightbox-close {
		top: 20px;
		right: 20px;
		width: 42px;
		height: 42px;
		font-size: 1.6rem;
		line-height: 1;
	}

	.lightbox-prev,
	.lightbox-next {
		top: 50%;
		transform: translateY(-50%);
		width: 48px;
		height: 48px;
		font-size: 1.3rem;
	}

	.lightbox-prev {
		left: 20px;
	}

	.lightbox-next {
		right: 20px;
	}

	.lightbox-counter {
		position: fixed;
		bottom: 20px;
		left: 50%;
		transform: translateX(-50%);
		color: #aaa;
		font-size: 0.85em;
		background: rgba(0, 0, 0, 0.6);
		padding: 4px 12px;
		border-radius: 999px;
	}

	@media (max-width: 640px) {
		.lightbox-prev,
		.lightbox-next {
			width: 38px;
			height: 38px;
			font-size: 1.1rem;
		}
		.lightbox-prev { left: 8px; }
		.lightbox-next { right: 8px; }
		.lightbox-close { top: 10px; right: 10px; }
	}

    /* Expanded writeups span the row so captions and diagrams remain readable. */
    .project-media { flex: 0 1 56%; min-width: 0; }
    .project-media img { max-width: 100%; object-fit: contain; background: #151515; }
    .project-details-link { color: #ff8080; text-decoration: none; font-size: .9em; }
    .project-details-link:hover { text-decoration: underline; }
    .project-description { max-width: 780px; margin: 20px auto 0; }
    .gallery { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
    .gallery-frame { margin: 0; min-width: 0; }
    .gallery-item { padding: 0; height: 140px; }
    .gallery-frame figcaption { color: #aaa; font-size: .78em; line-height: 1.45; margin-top: 7px; }
    .gallery-item:focus-visible, summary:focus-visible, a:focus-visible,
    .lightbox button:focus-visible { outline: 2px solid #ff8080; outline-offset: 4px; }
    .gallery-count { margin-left: auto; padding-right: 16px; font-size: .75em; font-weight: normal; color: #aaa; }
    .side-nav { max-height: calc(100vh - 150px); overflow-y: auto; }
    .lightbox-caption { position: fixed; bottom: 52px; left: 10%; right: 10%; text-align: center; color: #ddd; font-size: .9em; }
    .lightbox-content img, .lightbox-content video { max-height: 75vh; }
    .lightbox button[hidden] { display: none; }
    @media (max-width: 720px) {
      .project-media { width: 100%; }
      .project-media img { aspect-ratio: auto; max-height: 340px; margin: auto; }
      .project-row { gap: 22px; }
      .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .gallery-item { height: 120px; }
      .gallery-count { display: none; }
    }
	
.portfolio-tabs { display:flex; flex-wrap:wrap; justify-content:center; gap:10px 24px; margin:20px 0 45px; }
.portfolio-tabs a, .breadcrumb a { color:#ff8080; text-decoration:none; }
.portfolio-tabs a:hover, .breadcrumb a:hover { text-decoration:underline; }
.portfolio-tabs a[aria-current="page"] { color:#fff; border-bottom:2px solid #ff8080; padding-bottom:5px; }
.breadcrumb { color:#aaa; font-size:.85em; margin:0 0 20px; }
.project-link-button { display:flex; justify-content:space-between; gap:15px; padding:12px 16px; border:1px solid #444; border-radius:8px; color:#ff8080; text-decoration:none; }
.project-link-button:hover { background:#242424; border-color:#ff8080; }
.project .project-row { flex-direction:row; }
.project:nth-of-type(even) .project-row { flex-direction:row-reverse; }
.project-media video { max-width:100%; height:auto; max-height:440px; object-fit:contain; background:#111; }
.project-media img { height:auto; max-height:360px; margin:auto; }
.gallery-item img { border:0; border-radius:0; object-fit:contain; background:#111; }
.gallery { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.gallery-item { height:160px; }
.lightbox-content video { max-width:88vw; }
@media(max-width:720px) {
 .project .project-row, .project:nth-of-type(even) .project-row { flex-direction:column; }
 .project-media video { width:100%; max-height:420px; }
 .gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .gallery-item { height:130px; }
}

.stage-year { margin:24px 0; }
.stage-year h3 { color:#eee; font-size:1.1em; margin:0 0 12px; }
.stage-year-gallery { display:flex; flex-wrap:nowrap; gap:14px; overflow-x:auto; padding:4px 2px 12px; scroll-snap-type:x proximity; }
.stage-year-gallery .gallery-frame { flex:1 0 140px; max-width:220px; scroll-snap-align:start; }
.stage-year-gallery .gallery-item { width:100%; }
.stage-year-gallery:focus-visible { outline:2px solid #ff8080; outline-offset:4px; }
@media(max-width:720px) { .stage-year-gallery .gallery-frame { flex:0 0 160px; } }
