/* zanarose.org design system: glassmorphism over the hero photo, light + dark themes.
   Themes: tokens on :root (light), overridden for dark by prefers-color-scheme (unless data-theme="light") and by
   data-theme="dark" (the nav toggle; stored in localStorage). Page CSS must use these tokens, never raw colours. */

:root {
  /* palette sampled from the hero photo */
  --sand: #E9C98B;
  --terracotta: #C8684A;
  --terracotta-strong: #A9502F;  /* buttons: AA with cream text */
  --ochre: #D9A441;
  --sky: #4F86C6;
  --palm: #4E6B3A;
  --ink: #1E1A17;
  --cream: #FBF6EE;

  /* theme: light */
  --bg: #F4ECE0;
  --text: #1E1A17;
  --text-muted: #4A413A;
  --heading: #1E1A17;
  --link: #8E3F22;
  --overlay: linear-gradient(180deg, rgba(251, 246, 238, 0.45) 0%, rgba(244, 236, 224, 0.68) 45%, rgba(244, 236, 224, 0.78) 100%);
  --blob-opacity: 0.6;
  --glass-bg: rgba(255, 255, 255, 0.52);
  --glass-bg-hover: rgba(255, 255, 255, 0.66);
  --glass-bg-dark: rgba(20, 15, 10, 0.42);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-border-hover: rgba(255, 255, 255, 0.95);
  --glass-blur: 18px;
  --nav-bg: rgba(251, 246, 238, 0.55);
  --nav-border: rgba(30, 26, 23, 0.08);
  --shadow-glass: 0 8px 32px rgba(30, 20, 10, 0.12);
  --tag-bg: rgba(78, 107, 58, 0.12);
  --tag-text: #3B5229;
  --field-bg: rgba(255, 255, 255, 0.7);
  --field-border: rgba(30, 26, 23, 0.22);
  --focus: #2F6AAE;

  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font-display: 'Caudex', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110E;
    --text: #F3EBDF;
    --text-muted: #CBBFAF;
    --heading: #FBF6EE;
    --link: #F0B48F;
    --overlay: linear-gradient(180deg, rgba(20, 15, 10, 0.4) 0%, rgba(20, 15, 10, 0.66) 45%, rgba(18, 14, 11, 0.78) 100%);
    --blob-opacity: 0.42;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-hover: rgba(255, 255, 255, 0.14);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-border-hover: rgba(255, 255, 255, 0.4);
    --nav-bg: rgba(20, 15, 10, 0.45);
    --nav-border: rgba(255, 255, 255, 0.12);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
    --tag-bg: rgba(233, 201, 139, 0.14);
    --tag-text: #E9C98B;
    --field-bg: rgba(255, 255, 255, 0.06);
    --field-border: rgba(255, 255, 255, 0.25);
    --focus: #8DB8EA;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15110E;
  --text: #F3EBDF;
  --text-muted: #CBBFAF;
  --heading: #FBF6EE;
  --link: #F0B48F;
  --overlay: linear-gradient(180deg, rgba(20, 15, 10, 0.4) 0%, rgba(20, 15, 10, 0.66) 45%, rgba(18, 14, 11, 0.78) 100%);
  --blob-opacity: 0.42;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-hover: rgba(255, 255, 255, 0.4);
  --nav-bg: rgba(20, 15, 10, 0.45);
  --nav-border: rgba(255, 255, 255, 0.12);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35);
  --tag-bg: rgba(233, 201, 139, 0.14);
  --tag-text: #E9C98B;
  --field-bg: rgba(255, 255, 255, 0.06);
  --field-border: rgba(255, 255, 255, 0.25);
  --focus: #8DB8EA;
  color-scheme: dark;
}

/* ── 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; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
main { flex: 1; position: relative; z-index: 1; }
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; color: var(--heading); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--cream); border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── backdrop: hero photo fixed behind every page + overlay + colour blobs (glass never sits on flat colour) ── */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.backdrop::before { content: ''; position: absolute; inset: -40px; background-image: var(--backdrop-img, none); background-position: center; background-size: cover; background-repeat: no-repeat; filter: blur(6px) saturate(115%); transform: scale(1.04); }
.backdrop::after { content: ''; position: absolute; inset: 0; background: var(--overlay); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-opacity); z-index: 1; }
.blob--1 { width: 46vw; height: 46vw; left: -12vw; top: 30vh; background: var(--terracotta); }
.blob--2 { width: 38vw; height: 38vw; right: -10vw; top: 8vh; background: var(--sky); }
.blob--3 { width: 42vw; height: 42vw; right: 12vw; bottom: -18vw; background: var(--ochre); }

/* photo themes (html.photo-theme: a colour story with its own photos, set inline by src/layout.js): the place shows
   through. The wash is tinted with the story's own --bg so the photo takes on its colours, and the blobs step back.
   Wash strengths keep bare text readable even over the darkest (light mode) or brightest (dark mode) part of a photo:
   48% of a light --bg over pure black still gives dark text >= 3.8:1, 64% of a dark --bg over pure white >= 4.5:1. */
html:root.photo-theme {
  --wash-a: 48%; --wash-b: 58%; --wash-c: 70%;
  --overlay: linear-gradient(180deg, color-mix(in srgb, var(--bg) var(--wash-a), transparent) 0%, color-mix(in srgb, var(--bg) var(--wash-b), transparent) 45%, color-mix(in srgb, var(--bg) var(--wash-c), transparent) 100%);
  --blob-opacity: .2;
}
@media (prefers-color-scheme: dark) { html:root.photo-theme:not([data-theme="light"]) { --wash-a: 64%; --wash-b: 72%; --wash-c: 82%; } }
html:root.photo-theme[data-theme="dark"] { --wash-a: 64%; --wash-b: 72%; --wash-c: 82%; }
.photo-theme .backdrop::before { filter: blur(9px) saturate(130%); animation: backdrop-drift 70s ease-in-out infinite alternate; }
@keyframes backdrop-drift { from { transform: scale(1.06); } to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); } }

/* ── glass ── */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}
/* always-dark glass, for white text over the busy photo (hero) in both themes */
.glass--dark { background: var(--glass-bg-dark); border-color: rgba(255, 255, 255, 0.28); color: var(--cream); }
.glass--dark h1, .glass--dark h2, .glass--dark h3 { color: var(--cream); }
.glass--interactive { transition: transform .3s ease, border-color .3s ease, background .3s ease; }
.glass--interactive:hover { transform: translateY(-4px); border-color: var(--glass-border-hover); background: var(--glass-bg-hover); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: color-mix(in srgb, var(--bg) 92%, transparent); }
  .glass--dark { background: rgba(30, 24, 20, 0.86); }
}

/* ── layout helpers for page CSS ── */
.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.panel { padding: clamp(22px, 4vw, 44px); }
.eyebrow { font: 600 .78rem/1.2 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .9em; }
.lede { font-size: 1.12rem; color: var(--text-muted); max-width: 62ch; }
.prose { max-width: 68ch; }
.prose p { text-align: left; }
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

/* page header used by every project page */
.page-hero { padding-top: clamp(36px, 6vw, 72px); }
.page-hero .panel { max-width: 900px; }

/* breadcrumb + back button above every inner page (rendered by layout.js) */
.crumbs { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; margin-top: clamp(16px, 3vw, 28px); }
.crumbs__back { flex: none; display: inline-flex; align-items: center; gap: .45em; min-height: 42px; padding: .5em 1.05em .5em .8em; border-radius: var(--radius-pill); font: 600 .9rem/1 var(--font-body); color: var(--text); text-decoration: none; background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-glass); transition: background .2s ease, transform .2s ease; }
.crumbs__back:hover { background: var(--glass-bg-hover); transform: translateX(-2px); }
.crumbs__back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.crumbs ol { display: flex; align-items: center; min-width: 0; margin: 0; padding: 0; list-style: none; font-size: .9rem; color: var(--text-muted); }
.crumbs li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.crumbs li + li::before { content: '\203A'; flex: none; padding: 0 .55em; opacity: .7; }
.crumbs li:last-child { overflow: hidden; }
.crumbs li:last-child span { overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 600; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
main > .crumbs + .page-hero { padding-top: clamp(18px, 3.5vw, 40px); }
@media (max-width: 520px) {
  .crumbs { gap: 10px; }
  .crumbs__back { padding-inline: .7em .9em; }
  .crumbs ol { font-size: .84rem; }
  .crumbs li.crumbs__mid { display: none; }  /* Home › Title on narrow phones */
}

/* media frames */
.frame { overflow: hidden; border-radius: var(--radius-sm); }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.media-card { padding: 10px; }
.media-card img, .media-card video { border-radius: var(--radius-sm); width: 100%; }
.media-card figcaption { padding: 10px 6px 2px; font-size: .9rem; color: var(--text-muted); }
figure { margin: 0; }

/* ── buttons, tags ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: .7em 1.5em; border-radius: var(--radius-pill); font: 600 .95rem/1 var(--font-body); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--terracotta-strong); color: var(--cream); }
.btn--primary:hover { background: #93431F; }
.btn--glass { background: var(--glass-bg); color: var(--text); border-color: var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.glass--dark .btn--glass { background: rgba(255, 255, 255, 0.14); color: var(--cream); border-color: rgba(255, 255, 255, 0.4); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tag { padding: .35em .85em; border-radius: var(--radius-pill); background: var(--tag-bg); color: var(--tag-text); font-size: .82rem; font-weight: 600; }

/* ── forms ── */
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text-muted); }
.field input, .field textarea { width: 100%; padding: .8em 1em; border-radius: var(--radius-sm); border: 1px solid var(--field-border); background: var(--field-bg); color: var(--text); font: inherit; }
.field textarea { min-height: 140px; resize: vertical; }

/* ── nav ── */
.nav { position: sticky; top: 0; z-index: 50; transition: box-shadow .3s ease; background: var(--nav-bg); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--nav-border); }
.is-scrolled .nav { --nav-h: 54px; box-shadow: var(--shadow-glass); }
.is-scrolled .nav__brand { font-size: 1.15rem; }
.is-scrolled .theme-toggle, .is-scrolled .nav__toggle { width: 36px; height: 36px; }
.is-scrolled .nav__links a { padding-block: .45em; }
.nav__brand, .theme-toggle, .nav__toggle { transition: font-size .3s var(--ease-out, ease), width .3s var(--ease-out, ease), height .3s var(--ease-out, ease); }
.nav__inner { transition: height .3s var(--ease-out, ease); width: max-content; min-width: min(100% - 2 * var(--gutter), var(--maxw)); max-width: calc(100% - 2 * var(--gutter)); margin-inline: auto; height: var(--nav-h); display: flex; align-items: center; gap: 20px; }
.nav__brand { font: 400 1.35rem/1 var(--font-display); color: var(--heading); text-decoration: none; letter-spacing: .02em; margin-right: auto; }
.nav__links { display: flex; flex: none; gap: 2px; white-space: nowrap; }
.nav__links a { display: inline-flex; align-items: center; gap: .45em; padding: .55em .8em; border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 500; transition: background .2s ease, color .2s ease; }
.nav__links a:hover, .nav__links a[aria-current="true"] { background: var(--glass-bg-hover); }
.nav__links a[aria-current="true"] .nav-ico { color: var(--link); }
.nav-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease-out, ease); }
.nav__links a:hover .nav-ico { transform: translateY(-1px) scale(1.08); }
/* desktop: spatial "dock" magnification. The hovered link zooms forward with an accent pop (tint, ring, glow, and a
   highlight that follows the cursor via --mx/--my from site.js); its neighbours swell a little so the row feels like
   a lens passing over it. Pointer devices only; reduced motion keeps the colour and drops the zoom. */
@media (hover: hover) and (pointer: fine) and (min-width: 861px) {
  .nav__links { perspective: 600px; }
  .nav__links a { position: relative; transform-origin: 50% 60%; will-change: transform;
    transition: transform .35s cubic-bezier(.2, .9, .3, 1.35), background .25s ease, color .2s ease, box-shadow .3s ease, opacity .25s ease; }
  /* the rest of the row recedes and parts around the magnified link so nothing crowds it */
  .nav__links:has(a:hover) a:not(:hover) { opacity: .72; }
  .nav__links a:has(~ a:hover) { transform: translateX(-12px) scale(.9); }
  .nav__links a:hover ~ a { transform: translateX(12px) scale(.9); }
  .nav__links a:has(+ a:hover) { transform: translateX(-14px) scale(.88); }
  .nav__links a:hover + a { transform: translateX(14px) scale(.88); }
  .nav__links a:hover, .nav__links a:focus-visible { z-index: 1; color: var(--link); transform: translateY(-2px) scale(1.2);
    background:
      radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--link) 26%, transparent), transparent 70%),
      color-mix(in srgb, var(--link) 12%, var(--glass-bg-hover));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--link) 45%, transparent),
      0 6px 18px -6px color-mix(in srgb, var(--link) 60%, transparent),
      0 0 22px -4px color-mix(in srgb, var(--link) 40%, transparent); }
  .nav__links a:hover .nav-ico { transform: translateY(-1px) scale(1.12) rotate(-6deg); }
  .nav__links a:hover > span { text-shadow: 0 0 14px color-mix(in srgb, var(--link) 45%, transparent); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 861px) and (prefers-reduced-motion: reduce) {
  .nav__links a, .nav__links a:hover, .nav__links a:hover ~ a, .nav__links a:has(~ a:hover) { transform: none; }
  .nav__links a:hover .nav-ico { transform: none; }
}
.nav-ext { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .6; }
@media (min-width: 861px) { .nav__brand { flex: none; white-space: nowrap; } }
/* Links never drop their words. The bar is --maxw wide and grows with its links up to the page edges; when they still
   don't fit, html.nav-compact (set by NAV_FIT in layout.js) swaps them for the menu button beside the name. */
@media (min-width: 861px) { .nav__inner { gap: 12px; } .nav__links a { padding-inline: .55em; } }
.nav-measure .nav, .nav-measure .nav * { transition: none !important; }
.theme-toggle, .nav__toggle { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); cursor: pointer; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: block; }
}
.nav__toggle { display: none; gap: 4px; align-content: center; }
.nav__toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease-out, ease), opacity .2s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
/* QR code (/qr): the one filled button in the header, so it's easy to find. A pill with its label; just the icon on
   phones (and up to 700px in Dev Mode, beside its tools) */
.nav-qr { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .5em; height: 42px; padding: 0 1.1em 0 .95em; border-radius: var(--radius-pill); background: var(--terracotta-strong); color: var(--cream); text-decoration: none; white-space: nowrap; font: 600 .93rem/1 var(--font-body); transition: background .2s ease, height .3s var(--ease-out, ease), width .3s var(--ease-out, ease); }
.nav-qr:hover { background: color-mix(in srgb, var(--terracotta-strong) 84%, black); }
.nav-qr .nav-ico { width: 20px; height: 20px; }
.is-scrolled .nav-qr { height: 36px; }
@media (max-width: 600px) {
  .nav-qr { width: 42px; padding: 0; }
  .is-scrolled .nav-qr { width: 36px; }
  .nav-qr__label { display: none; }
  .nav__inner { gap: 10px; }
}
@media (max-width: 360px) { .nav__inner { gap: 7px; } }
@media (max-width: 700px) { .dev-mode .nav__inner { gap: 10px; } }
@media (max-width: 360px) { .dev-mode .nav__inner { gap: 7px; } }
@media (max-width: 700px) {
  .dev-mode .nav-qr { width: 42px; padding: 0; }
  .dev-mode .nav-qr__label { display: none; }
}
/* menu: icon tiles, placed under the nav wherever it sits (site.js sets --drawer-top and --drawer-left) */
.drawer { position: fixed; z-index: 49; top: var(--drawer-top, calc(var(--nav-h) + 8px)); left: var(--gutter); right: var(--gutter); max-height: calc(100svh - var(--drawer-top, var(--nav-h)) - 16px); overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
  /* unfolds from the menu button (top left): clip-path circle grows, panel settles; the reverse on close */
  clip-path: circle(0px at 26px -20px); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left;
  transition: clip-path .55s cubic-bezier(.7, 0, .2, 1), opacity .3s ease, transform .55s var(--ease-out, ease); }
.drawer[hidden] { display: none; }
.drawer.is-open { clip-path: circle(150% at 26px -20px); opacity: 1; transform: none; }
.drawer.is-closing { transition-duration: .4s, .3s, .4s; transition-delay: .08s, .12s, .08s; }
.drawer a { display: flex; align-items: center; gap: .7em; min-height: 52px; padding: .8em 1em; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 1rem; font-weight: 500; background: var(--glass-bg); border: 1px solid var(--glass-border);
  opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .35s ease, transform .5s var(--ease-out, ease), background .2s ease, border-color .2s ease; transition-delay: calc(var(--i, 0) * 45ms + 120ms); }
.drawer.is-open a { opacity: 1; transform: none; }
.drawer.is-closing a { transition-delay: calc((5 - var(--i, 0)) * 25ms); }
.drawer a:hover, .drawer a[aria-current="true"] { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); }
.drawer a:hover .nav-ico { transform: rotate(-8deg) scale(1.1); }
.drawer .nav-ico { width: 22px; height: 22px; color: var(--link); }
/* dim the page behind the open menu; a tap on it closes the menu */
.drawer-scrim { position: fixed; inset: 0; z-index: 48; background: color-mix(in srgb, var(--ink) 28%, transparent); opacity: 0; pointer-events: none; transition: opacity .4s ease; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.menu-open .drawer-scrim { opacity: 1; pointer-events: auto; }
/* phones: each column is as wide as its longest word needs; one column when two can't fit */
@media (max-width: 480px) { .drawer { grid-template-columns: auto auto; } }
@media (max-width: 430px) { .drawer a { gap: .5em; padding: .75em .6em; font-size: .95rem; } }
@media (max-width: 359px) { .drawer { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-grid; }
}
.nav-compact .nav__links { display: none; }
.nav-compact .nav__toggle { display: inline-grid; }
@media (min-width: 861px) { .drawer { left: var(--drawer-left, var(--gutter)); right: auto; width: 420px; grid-template-columns: 1fr 1fr; } }

/* ── device preview bar (dev hosts only, see devBar() in layout.js) ── */
.devbar { position: relative; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px var(--gutter); background: var(--heading); color: var(--bg); font: 600 .8rem/1 var(--font-body); }
.devbar__label { letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.devbar__group { display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--bg) 16%, transparent); }
.devbar__btn { display: inline-flex; align-items: baseline; gap: .4em; min-height: 32px; align-items: center; padding: 0 .9em; border-radius: var(--radius-pill); color: var(--bg); text-decoration: none; }
.devbar__btn span { font-weight: 400; opacity: .8; font-size: .72rem; }
.devbar__btn:hover { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.devbar__btn[aria-current="page"] { background: var(--bg); color: var(--heading); }
.devbar__btn[aria-current="page"] span { opacity: 1; }
.in-devframe .devbar { display: none; }
@media (max-width: 420px) { .devbar__label { display: none; } .devbar__btn span { display: none; } }

/* ── welcome theme picker (public/js/theme-picker.js) ── */
.theme-switching, .theme-switching * { transition: background-color .6s ease, color .6s ease, border-color .6s ease !important; }
.picker-open body { overflow: hidden; }
.picker { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--ink) 45%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .4s ease; }
.picker.is-in { opacity: 1; }
.picker__card { position: relative; width: min(680px, 100%); max-height: calc(100svh - 32px); overflow-y: auto; padding: clamp(14px, 2.5vw, 20px); background: var(--bg); transform: translateY(16px) scale(.98); transition: transform .6s var(--ease-out, ease); }
.picker.is-in .picker__card { transform: none; }
.picker__card h2 { margin: 0; padding-right: 52px; font-size: 1.6rem; line-height: 44px; }
.picker__lede { margin: 0; color: var(--text-muted); font-size: .94rem; }
.picker__close { position: absolute; top: clamp(14px, 2.5vw, 20px); right: clamp(14px, 2.5vw, 20px); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); cursor: pointer; }
.picker__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.picker__options { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.picker__options li { margin: 0; }
/* the photo is the button; its name sits on an ink fade, readable over any photo in light and dark */
.picker__opt { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-sm); background: var(--ink); color: var(--cream); font: inherit; text-align: left; cursor: pointer;
  opacity: 0; transform: translateY(12px); transition: transform .5s var(--ease-out, ease), opacity .45s ease, box-shadow .2s ease; transition-delay: calc(var(--i) * 35ms + 120ms); }
.picker.is-in .picker__opt { opacity: 1; transform: none; }
.picker__opt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out, ease); }
.picker__opt:hover img { transform: scale(1.05); }
.picker__opt span { position: absolute; inset: auto 0 0; padding: 30px 12px 9px; background: linear-gradient(transparent, color-mix(in srgb, var(--ink) 78%, transparent) 55%, color-mix(in srgb, var(--ink) 88%, transparent)); font: 400 1.1rem/1.15 var(--font-display); }
.picker__opt[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 5px var(--link); transition-delay: 0s; }
.picker__opt[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); color: var(--ink); font: 700 .84rem/1 var(--font-body); }
.picker__opt:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
.picker__foot { display: flex; align-items: center; gap: 14px; min-height: 60px; margin-top: 12px; }
.picker__note { flex: 1; margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.4; }
.picker__note strong { color: var(--heading); }
.picker__reset { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--link); font: inherit; font-size: .94rem; font-weight: 600; cursor: pointer; }
.picker__reset:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .picker__options { gap: 8px; }
  .picker__opt { aspect-ratio: 1; }
  .picker__opt span { padding: 24px 8px 7px; font-size: .94rem; }
  .picker__foot { flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
  .picker__note { flex: 1 0 100%; min-height: 5.7em; }
}

/* ── dev mode: Settings link (always on localhost; on *.onrender.com after the footer toolbox toggle) ── */
.nav-dev { display: none !important; }
.dev-mode .footer__devwrap { display: none; }  /* the floating toolbar takes over */
.dev-mode .nav__links .nav-dev { display: inline-flex !important; }
.nav__links .nav-dev:hover .nav-ico { transform: rotate(45deg); }
/* Desktop / Tablet / Mobile preview toggle (header, Dev Mode only; links to /__devices) */
.devtoggle { display: none; gap: 2px; padding: 3px; border-radius: var(--radius-pill); border: 1px dashed var(--field-border); }
.dev-mode .devtoggle { display: inline-flex; }
.in-devframe .devtoggle { display: none; }
.devtoggle__btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--text); transition: background .2s ease, color .2s ease; }
.devtoggle__btn:hover { background: var(--glass-bg-hover); }
.devtoggle__btn[aria-current="page"] { background: var(--heading); color: var(--bg); }
.is-scrolled .devtoggle__btn { width: 30px; height: 30px; }
@media (max-width: 600px) { .dev-mode .devtoggle { display: none; } }
.dev-mode .drawer .nav-dev { display: flex !important; border-style: dashed; }
.footer__dev { display: inline-flex; align-items: center; gap: .4em; min-height: 40px; padding: 0 .9em; border-radius: var(--radius-pill); border: 1px dashed var(--field-border); background: none; color: var(--text); font: 600 .82rem/1 var(--font-body); cursor: pointer; }
.footer__dev .nav-ico { width: 18px; height: 18px; }
/* public domain: icon-only toggle + PIN popover */
.footer__devwrap { position: relative; display: inline-flex; }
.footer__dev--pin { width: 40px; padding: 0; justify-content: center; opacity: .6; }
.footer__dev--pin:hover, .footer__dev--pin:focus-visible, .footer__dev--pin[aria-pressed="true"] { opacity: 1; }
.footer__pin { position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; width: 220px; border-radius: var(--radius-sm); }
.footer__pin[hidden] { display: none; }
.footer__pin label { grid-column: 1 / -1; font: 600 .8rem/1 var(--font-body); color: var(--text-muted); }
.footer__pin input { min-width: 0; min-height: 40px; padding: 0 .7em; border-radius: var(--radius-sm); border: 1px solid var(--field-border); background: var(--field-bg); color: var(--text); font: 600 1rem/1 var(--font-body); letter-spacing: .3em; }
.footer__pin button { min-height: 40px; padding: 0 .9em; border: 0; border-radius: var(--radius-pill); background: var(--terracotta-strong); color: var(--cream); font: 600 .85rem/1 var(--font-body); cursor: pointer; }
.footer__pin-msg { grid-column: 1 / -1; margin: 0; font-size: .8rem; color: var(--text-muted); min-height: 1em; }
.footer__dev[aria-pressed="true"] { background: var(--heading); color: var(--bg); border-style: solid; border-color: var(--heading); }
@media (max-width: 640px) { .footer__dev span { display: none; } .footer__dev { width: 40px; padding: 0; justify-content: center; } }

/* ── footer: pinned glass pill on every page (socials); slimmer once the page scrolls ── */
:root { --footer-h: 60px; }
body { padding-bottom: calc(var(--footer-h) + 28px); }
.footer { position: fixed; z-index: 45; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(100% - 2 * var(--gutter), var(--maxw)); min-height: var(--footer-h); margin: 0; padding: 8px 10px 8px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .9rem; border-radius: var(--radius-pill); transition: min-height .3s var(--ease-out, ease), padding .3s var(--ease-out, ease), width .3s var(--ease-out, ease); }
.footer p { margin: 0; }
.footer .footer__copy { margin-right: auto; }
.footer__copy { white-space: nowrap; color: var(--text); }
.footer__social { display: flex; gap: 4px; }
.footer__social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); transition: background .2s ease; }
.footer__social a:hover { background: var(--glass-bg-hover); }
.footer__social svg { fill: currentColor; }
.is-scrolled .footer { --footer-h: 50px; padding-block: 5px; }
.is-scrolled .footer__social a { width: 34px; height: 34px; }
@media (max-width: 640px) {
  .footer { padding-left: 16px; gap: 6px; }
  .footer__copy span { display: none; }
  .footer__social a { width: 36px; height: 36px; }
}
@media print { .footer { position: static; transform: none; } body { padding-bottom: 0; } }

/* ── motion: subtle builds ──
   Every content block (glass panels/cards, section heads, breadcrumb, figures) rises 14px, un-blurs and fades in as it
   enters the viewport, staggered in small batches (site.js sets --d). .js-anim is set by an inline script in <head> and
   dropped after 2.5s if site.js never ran, so content is never stuck hidden. .reveal is the explicit opt-in for anything else. */
:root { --ease-out: cubic-bezier(.2, .7, .2, 1); --build-dur: .8s; }
.reveal,
.js-anim main :is(.glass, .section-head, .story-title, .crumbs, .media-card):where(:not(.reveal, .reveal *, .glass .glass, .work-grid *, .no-build, .no-build *)) {
  opacity: 0; transform: translateY(14px) scale(.985); filter: blur(6px);
  transition: opacity var(--build-dur) var(--ease-out) var(--d, 0s), transform var(--build-dur) var(--ease-out) var(--d, 0s), filter calc(var(--build-dur) * .8) var(--ease-out) var(--d, 0s);
}
.reveal.is-in,
.js-anim main :is(.glass, .section-head, .story-title, .crumbs, .media-card).is-in { opacity: 1; transform: none; filter: none; }
/* after the build finishes, drop the transition so hover lifts stay snappy */
.is-built { transition: transform .3s ease, border-color .3s ease, background .3s ease !important; }

/* progressive images (site.js): the tiny preview (--preview, src/previews.js) fills the picture's own box, blurred, and
   the real picture un-blurs out of it. Without a preview the picture stays hidden until it's ready, over a soft shimmer. */
main :is(img, video)[style*="--preview:"] { background: var(--preview) center / cover no-repeat; }
main img { transition: opacity .6s var(--ease-out), filter .6s var(--ease-out), transform .9s var(--ease-out); }
main img.img-loading { filter: blur(10px); transform: scale(1.02); }
main img.img-loading:not([style*="--preview:"]) { opacity: 0; }
:is(.frame, .media-card, .gallery__item, .cv-banner, .cv-head__photo, .about__photo, .sh-photo, .li-post__img, .li-project__img):has(> img.img-loading:not([style*="--preview:"]), > a > img.img-loading:not([style*="--preview:"])) {
  background: linear-gradient(100deg, transparent 30%, var(--glass-bg-hover) 50%, transparent 70%) 0 0 / 300% 100%, var(--glass-bg);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0, 0 0; } }

/* below-the-fold sections render lazily (faster first paint on long pages) */
main > section + section, .cv-section { content-visibility: auto; contain-intrinsic-size: auto 700px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal, .js-anim main :is(.glass, .section-head, .story-title, .crumbs, .media-card) { opacity: 1 !important; transform: none !important; filter: none !important; }
  main img.img-loading:not([style*="--preview:"]) { opacity: 1; filter: none; }
  main img.img-loading { transform: none; }
}
/* lighter blur on small screens (performance) */
@media (max-width: 767px) { :root { --glass-blur: 12px; } .blob { filter: blur(60px); } }

/* a link to a part of the site that's turned off (src/features.js clearLinks): plain words, and no empty buttons or list items */
a[data-off-link] { color: inherit; text-decoration: none; cursor: inherit; }
a.btn[data-off-link], li:has(> a[data-off-link]:only-child) { display: none; }
