/* ==========================================================================
   lichthof — bright, modern theme with frosted sticky nav & soft daylight
   ==========================================================================
   The masthead is driven by a single custom property --p (0 = page top,
   1 = fully collapsed), scrubbed continuously by js/lichthof.js while
   scrolling. Every interpolated size below is a calc() mix of an
   "expanded" and a "collapsed" value weighted by --p, so logo, bar height
   and nav position all glide in lockstep with the scroll position.
   ========================================================================== */

/* Fonts (self-hosted, no external requests).
   Poppins, not Jost: Jost's lowercase has a subtle forward lean baked
   into its upright letterforms, which reads as faux-italic. */
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/poppins-400-italic.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/poppins-500.woff2') format('woff2');
}
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/poppins-600.woff2') format('woff2');
}

/* Design tokens */
:root {
	--font-sans: 'Poppins', 'Century Gothic', Verdana, Arial, Helvetica, sans-serif;
	--ink: #383d43;
	--ink-strong: #1d2126;
	--ink-muted: #6b7178;
	--accent: #0D58F0;
	--olive: #8f9d1e;            /* picked from the logo mark */
	--hairline: rgba(24, 28, 33, 0.08);

	/* Masthead geometry (expanded / collapsed) */
	--logo-exp: 56px;
	--logo-col: 30px;
	--mh-pad-top: 16px;
	--mh-gap: 6px;
	--navh-exp: 56px;
	--mh-col: 60px;
	--mh-exp: calc(var(--mh-pad-top) + var(--logo-exp) + var(--mh-gap) + var(--navh-exp));
	/* logo.png is a 780x81 banner whose "ass" mark only fills the left
	   ~30% — the .brand wrapper crops it to 3x its display height. */
	--brand-ar: 3.0;
}

/* Base */
html {
	/* Solid canvas color only — html's background propagates to the whole
	   canvas (incl. overscroll rubber-band areas at BOTH ends and anything
	   beyond the body box), so it must be a plain color equal to BOTH edge
	   colors of the body gradient; that's why the gradient below is
	   strictly vertical and returns to this same warm tone at its end.
	   The gradient itself lives on body, never here: sized to the html
	   box it leaves white canvas showing below on pages where the two
	   don't match. */
	background: #fffdf7;
	height: 100%;
	scroll-padding-top: calc(var(--mh-col) + 16px);
	overflow-x: clip;
}
body {
	margin: 0;
	padding: calc(var(--mh-exp) + 24px) 0 0;
	min-height: 100%;
	box-sizing: border-box;
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.65;
	color: var(--ink);
	/* Ambient daylight: warm light at the top falling into a cool neutral
	   and easing back to warm — keeps the page bright without flat white.
	   Seam-proof by construction, don't change lightly: it must be exactly
	   vertical (180deg — any tilt makes the edge rows non-uniform) and
	   both end stops must equal the html canvas color, so the strip
	   revealed by overscroll rubber-banding matches at either end in every
	   browser. Compositor tricks (fixed off-screen cap layers) proved
	   unreliable for this. */
	background: linear-gradient(180deg, #fffdf7 0%, #f6f7f7 30%, #eef1f4 62%, #fffdf7 100%);
	overflow-x: clip;
}
/* Scroll lock while the mobile nav panel is open (class + inline `top`
   set by lichthof.js). position:fixed rather than overflow:hidden —
   iOS Safari ignores the latter for touch scrolling; the body is pinned
   at the current scroll offset and restored on close. */
body.nav-locked {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
}
h1, h2, h3, h4, h5, h6, p, figure {
	margin: 0;
	padding: 0;
}
img {
	border: 0;
	max-width: 100%;
}
a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}
b, strong {
	font-weight: 600;
}

.container {
	max-width: 1040px;
	margin-inline: auto;
	padding-inline: 24px;
	box-sizing: border-box;
}

/* ==========================================================================
   Masthead: fixed frosted-glass bar.
   (position: fixed rather than sticky — the bar's flow height shrinks
   while scrolling, and a fixed bar + constant body padding avoids the
   scroll feedback loop a shrinking sticky element would cause.)
   ========================================================================== */
#masthead {
	--p: 0;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	height: calc(var(--mh-exp) * (1 - var(--p)) + var(--mh-col) * var(--p));
}
/* The bar's glass lives on .masthead-glass, a dedicated sibling layer
   UNDER the nav content — not on #masthead itself. An element with
   backdrop-filter becomes a backdrop root, which silently disables the
   backdrop-filter of all its descendants; with the blur on #masthead the
   frosted dropdowns and mobile panel would render as flat translucent
   white. A real element with positive z-index layering is used (not a
   ::before with z-index -1) because pseudo-element/negative-z-index
   backdrop-filter is unreliable in some browsers. */
.masthead-glass {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: rgba(253, 253, 251, 0.72);
	background: rgb(253 253 251 / calc(0.55 + 0.25 * var(--p)));
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
	border-bottom: 1px solid var(--hairline);
	/* light edge: the glass catches light along its top */
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.7),
		0 12px 30px -14px rgb(28 32 38 / calc(0.20 * var(--p)));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.masthead-glass {
		background: rgba(253, 253, 251, 0.96);
	}
}
.masthead-inner {
	position: relative;
	z-index: 1;
	height: 100%;
}

/* Brand: crops the wide banner image to the actual mark (the logo PNG
   has a transparent background, so it sits directly on the glass) */
.brand {
	position: absolute;
	left: 24px;
	top: calc(var(--mh-pad-top) * (1 - var(--p)) + (var(--mh-col) - var(--logo-col)) / 2 * var(--p));
	height: calc(var(--logo-exp) * (1 - var(--p)) + var(--logo-col) * var(--p));
	width: calc((var(--logo-exp) * (1 - var(--p)) + var(--logo-col) * var(--p)) * var(--brand-ar));
	overflow: hidden;
	display: block;
}
.brand img {
	display: block;
	height: 100%;
	width: auto;
	max-width: none;
}

/* Primary nav row: pinned to the bar's bottom edge, items centered on
   the content column (the galleries below are centered too — a
   left-aligned nav reads as off-center against them). While collapsing,
   the growing left padding reserves the logo's landing spot, so the
   centered group drifts slightly right of true center (~56px at full
   collapse) — accepted trade-off: keeping it dead-center would overlap
   the logo on narrower desktop viewports. */
#nav-main {
	position: absolute;
	left: 24px;
	right: 24px;
	bottom: 0;
	height: calc(var(--navh-exp) * (1 - var(--p)) + var(--mh-col) * var(--p));
	display: flex;
	align-items: center;
	justify-content: center;
	padding-left: calc(var(--p) * (var(--logo-col) * var(--brand-ar) + 22px));
	box-sizing: border-box;
	/* This box's left padding reserves the logo's landing spot, but at
	   full collapse the box itself still spans that spot (bottom:0 +
	   full bar height puts it directly over .brand) and, being later in
	   the DOM, was eating clicks meant for the collapsed logo even
	   through the empty padding. Make the container a click-through
	   shell and only re-enable hit-testing on the actual nav content. */
	pointer-events: none;
}
.nav-list {
	list-style: none;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	margin: 0;
	padding: 0;
	gap: clamp(12px, 2vw, 22px);
	min-width: 0;
	pointer-events: auto;
}
.nav-list > .nav-item {
	position: relative;
	white-space: nowrap;
}
.nav-list > .nav-item > a {
	font-weight: 500;
	font-size: clamp(13px, 1.4vw, 14.5px);
	letter-spacing: 0.01em;
	color: #4a4f55;
	padding: 6px 0;
	text-decoration: none;
}
.nav-list > .nav-item > a:hover {
	color: var(--ink-strong);
	text-decoration: underline;
	text-decoration-color: rgba(24, 28, 33, 0.3);
	text-decoration-thickness: 2px;
	text-underline-offset: 7px;
}
.nav-list > .nav-item.nav-item--current > a {
	color: var(--ink-strong);
	text-decoration: underline;
	text-decoration-color: var(--olive);
	text-decoration-thickness: 2px;
	text-underline-offset: 7px;
}

/* Dropdowns: same glass, soft elevation.
   Two hard-won constraints keep the frost working:
   1. NOT animated — transitioning opacity/transform on a backdrop-
      filtered element puts it in its own backdrop root (opacity<1) and
      browsers then don't apply the blur. If a fade is ever wanted,
      animate the backdrop-filter/background alpha, never opacity.
   2. On desktop, lichthof.js PORTALS each panel out of #masthead to
      <body> (.nav-sublist--portal) and positions it under its nav item —
      backdrop-filter on descendants of the fixed glass header proved
      unreliable in real browsers even without an ancestor filter. The
      CSS :hover rule below stays as the no-JS fallback (inline panel,
      translucent but functional). */
.nav-sublist {
	list-style: none;
	margin: 0;
	padding: 10px 0;
	position: absolute;
	top: 100%;
	left: -14px;
	min-width: 280px;
	background: rgba(255, 255, 255, 0.72);
	-webkit-backdrop-filter: blur(24px) saturate(150%);
	backdrop-filter: blur(24px) saturate(150%);
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 10px;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.8),
		0 2px 6px rgba(28, 32, 38, 0.05),
		0 18px 44px -14px rgba(28, 32, 38, 0.22);
	display: none;
	z-index: 20;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.nav-sublist {
		background: rgba(255, 255, 255, 0.97);
	}
}
.nav-list > .nav-item:hover > .nav-sublist,
.nav-list > .nav-item:focus-within > .nav-sublist {
	display: block;
}
.nav-sublist--portal {
	position: fixed;
	top: 0;
	left: 0;
	display: none;
	z-index: 200;
}
.nav-sublist--portal.nav-sublist--open {
	display: block;
}
.nav-sublist li {
	padding: 5px 16px;
}
.nav-sublist li > a {
	font-weight: 400;
	font-size: 14.5px;
	color: #4a4f55;
	white-space: normal;
	text-decoration: none;
}
.nav-sublist li > a:hover {
	color: var(--ink-strong);
}
.nav-sublist li.nav-item--current > a {
	color: var(--ink-strong);
	text-decoration: underline;
	text-decoration-color: var(--olive);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

/* Hamburger (hidden on desktop) */
.nav-toggle {
	display: none;
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 10px;
	box-sizing: border-box;
	background: none;
	border: 0;
	cursor: pointer;
}
.nav-toggle__bar {
	display: block;
	height: 2px;
	margin: 5px 0;
	background: var(--ink-strong);
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Content
   ========================================================================== */
#page-content {
	padding-top: 24px;
	padding-bottom: 48px;
	min-height: 40vh;
}
.content-row__inner {
	width: 100%;
}
.content-col {
	width: 100%;
	box-sizing: border-box;
}

/* Gallery: objects on a bright desk — soft layered elevation, gentle lift
   and a warm grazing-light sweep on hover */
.content-gallery {
	margin: 0 auto;
}
.gallery-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px;
	padding: 8px 0 14px;
}
.gallery-grid a {
	display: block;
	position: relative;
	border-radius: 6px;
	overflow: hidden;
	box-shadow:
		0 1px 2px rgba(28, 32, 38, 0.07),
		0 5px 14px -4px rgba(28, 32, 38, 0.12);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-grid a::after {
	/* late-afternoon sun grazing the facade */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, rgba(255, 209, 133, 0.28), rgba(255, 209, 133, 0) 55%);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}
.gallery-grid a:hover {
	transform: translateY(-3px);
	box-shadow:
		0 2px 4px rgba(28, 32, 38, 0.07),
		0 14px 28px -8px rgba(28, 32, 38, 0.2);
}
.gallery-grid a:hover::after {
	opacity: 1;
}
.gallery-grid img {
	width: 150px;
	height: 150px;
	object-fit: cover;
	display: block;
	background-position: center center;
}

/* Lightbox zoom/pan: click the enlarged image to zoom in, drag to pan,
   click again to zoom back out (see js/lightbox-zoom.js). The vendor
   skin mats every image in a white 4px frame (lb-outerContainer
   background + lb-container padding) — drop that so the photo fills
   the lightbox with no border. */
.lb-outerContainer {
	background-color: transparent;
}
.lb-container {
	padding: 0;
	overflow: hidden;
}
.lightbox .lb-image {
	cursor: zoom-in;
	touch-action: none;
	transition: transform 0.25s ease;
}
.lightbox .lb-image.lb-zoomed {
	cursor: grab;
}
.lightbox .lb-image.lb-zoomed.lb-panning {
	cursor: grabbing;
	transition: none;
}

/* Prev/next used to be invisible full-width click zones layered over the
   image (and used broken vendor icons), which swallowed every click meant
   for zoom. Replace with round buttons pinned to the screen edges — fixed
   (not absolute) so they sit outside the image, using #lightbox's own
   transform (see lightbox.min.css) as their containing block, which spans
   the full viewport width and is vertically centered the same way
   #lightbox is. */
#lightbox .lb-nav {
	pointer-events: none;
}
#lightbox .lb-nav a.lb-prev,
#lightbox .lb-nav a.lb-next {
	pointer-events: auto;
	position: fixed;
	top: 50%;
	width: 60px;
	height: 60px;
	transform: translateY(-50%);
	float: none;
	border-radius: 50%;
	background: rgba(20, 22, 26, 0.5);
	filter: none;
	opacity: 0.6;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}
#lightbox .lb-nav a.lb-prev {
	left: 20px;
}
#lightbox .lb-nav a.lb-next {
	right: 20px;
	left: auto;
}
#lightbox .lb-nav a.lb-prev:hover,
#lightbox .lb-nav a.lb-next:hover {
	opacity: 1;
	background-color: rgba(20, 22, 26, 0.75);
}
#lightbox .lb-nav a.lb-prev::before,
#lightbox .lb-nav a.lb-next::before {
	content: "";
	width: 14px;
	height: 14px;
	border: solid #fff;
	border-width: 0 3px 3px 0;
}
#lightbox .lb-nav a.lb-prev::before {
	transform: rotate(135deg);
	margin-left: 6px;
}
#lightbox .lb-nav a.lb-next::before {
	transform: rotate(-45deg);
	margin-right: 6px;
}

/* Dividers: a hairline of light instead of a solid rule */
.content-divider hr,
.content-richtext hr {
	height: 1px;
	width: 100%;
	border: 0;
	margin: 22px auto;
	background: linear-gradient(90deg, rgba(28, 32, 38, 0) 0%, rgba(28, 32, 38, 0.22) 50%, rgba(28, 32, 38, 0) 100%);
}

/* Rich text.
   NOTE (content contract): paragraphs must keep margin 0 — the Markdown
   content encodes deliberate blank-row gaps as explicit &nbsp; lines and
   assumes zero paragraph margins. Do not add p margins here. */
.content-richtext {
	font-size: 16px;
	color: var(--ink);
	line-height: 1.65;
	word-wrap: break-word;
}
.content-richtext h1, .content-richtext h2, .content-richtext h3,
.content-richtext h4, .content-richtext h5, .content-richtext h6 {
	font-weight: 600;
	color: var(--ink-strong);
	line-height: 1.35;
}
.content-richtext h1 { font-size: 26px; }
.content-richtext h2 { font-size: 22px; }
.content-richtext h3 { font-size: 19px; }
.content-richtext a {
	color: var(--accent);
}
.content-richtext img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}
.text-center {
	text-align: center;
}

/* Footer */
#site-footer {
	margin: 0 auto;
	padding-top: 24px;
	padding-bottom: 36px;
	text-align: center;
	font-size: 13px;
	color: var(--ink-muted);
}
#site-footer a {
	color: var(--ink-muted);
	text-decoration: underline;
}

/* ==========================================================================
   Mobile (hamburger panel)
   ========================================================================== */
@media (max-width: 880px) {
	:root {
		--logo-exp: 44px;
		--logo-col: 28px;
		--mh-pad-top: 12px;
		--mh-gap: 4px;
		--navh-exp: 0px;   /* nav lives in the toggle panel, not the bar */
		--mh-col: 56px;
		--mh-exp: calc(var(--mh-pad-top) * 2 + var(--logo-exp));
	}
	.nav-toggle {
		display: block;
	}
	#nav-main {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		bottom: auto;
		height: auto;
		padding: 0;
		display: none;
	}
	#masthead.nav-open #nav-main {
		display: block;
		/* Desktop keeps this click-through (pointer-events: none, see above)
		   so the collapsed logo stays clickable through the padding. The
		   mobile panel is the scroll container itself (overflow-y below),
		   and iOS Safari refuses to recognize touch-scroll gestures on an
		   element with pointer-events: none — even though its pointer-events:
		   auto children still work in Chrome. Re-enable hit-testing here. */
		pointer-events: auto;
		background: rgba(253, 253, 251, 0.88);
		-webkit-backdrop-filter: blur(18px) saturate(140%);
		backdrop-filter: blur(18px) saturate(140%);
		border-bottom: 1px solid var(--hairline);
		box-shadow: 0 20px 40px -18px rgba(28, 32, 38, 0.25);
		max-height: calc(100vh - var(--mh-col));
		max-height: calc(100dvh - var(--mh-col));
		overflow-y: auto;
		/* No-op on iOS 13+, where momentum scrolling is on by default for
		   any overflow box; kept only as a defensive fallback for pre-13
		   Safari, which required this to opt in. */
		-webkit-overflow-scrolling: touch;
		/* don't let the panel's own scroll chain to the page behind it */
		overscroll-behavior: contain;
	}
	@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
		#masthead.nav-open #nav-main {
			background: rgba(253, 253, 251, 0.98);
		}
	}
	#masthead.nav-open .nav-toggle__bar:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}
	#masthead.nav-open .nav-toggle__bar:nth-child(2) {
		opacity: 0;
	}
	#masthead.nav-open .nav-toggle__bar:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}
	.nav-list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 10px 0;
	}
	.nav-list > .nav-item {
		white-space: normal;
	}
	.nav-list > .nav-item > a {
		display: block;
		padding: 11px 24px;
		font-size: 16px;
	}
	.nav-list > .nav-item > a:hover,
	.nav-list > .nav-item.nav-item--current > a {
		text-underline-offset: 5px;
	}
	.nav-sublist {
		position: static;
		display: block;
		background: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		min-width: 0;
		padding: 0 0 6px;
	}
	.nav-sublist li {
		padding: 7px 24px 7px 40px;
	}
	.nav-sublist li > a {
		font-size: 15px;
	}
}

/* Reduced motion: keep the scroll-scrubbed sizing (user-driven), drop
   the decorative transitions */
@media (prefers-reduced-motion: reduce) {
	.gallery-grid a,
	.gallery-grid a::after,
	.nav-toggle__bar {
		transition: none;
	}
	.gallery-grid a:hover {
		transform: none;
	}
}
