/* ──────────────────────────────────────────────────────────────────────────
   luisdenninger.com — the site stylesheet

   Section order and componentry follow the reference exactly:
     nav (transparent over the banner → solid on scroll)
     #home      full-height banner, dark overlay, rotating keyword
     #about     photo left / text right, dark CTA button + round social icons
     #research  grey band, centred heading, thumbnail + paper info rows
     #portfolio white band, slash-separated filter, 3-col hover-overlay grid
     #blogs     grey band, three shadowed cards, Read More + date
     footer     centred copyright

   Section order and componentry follow the reference layout. Inter + DM Mono,
   with a real dark theme and a gaussian-splat scene behind the whole page.
   Reference metrics kept: 1140px container, 30px gutters, 100px section
   padding, 32px/600 uppercase headings, 16px/1.65 body.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* light — the reference palette: white, #f2f2f2 bands, #222 ink on #484848 body */
  --bg:         #ffffff;
  --bg-alt:     #f2f2f2;
  --fg:         #484848;
  --head:       #222222;
  --rule:       #e3e3e3;
  --soft:       #f7f7f7;
  --meta:       #748182;
  --link:       #0c6dbd;
  --link-head:  #004777;
  --btn-bg:     #222222;
  --btn-fg:     #ffffff;
  --card:       #ffffff;
  --shadow:     0 0 30px -4px rgba(0,0,0,.10);
  --shadow-img: 0 0 85px 0 rgba(0,0,0,.14);
  --navbar-bg:  #ffffff;
  --overlay:    rgba(255,255,255,.92);

  /* the banner is dark in both themes, so its own tokens never flip */
  --banner-ink:     #ffffff;
  --banner-sub:     #eeeeee;
  /* swap for url("/media/banner.jpg") once there is a real photograph */
  --banner-img:
     radial-gradient(1200px 600px at 18% 18%, #2d4a52 0%, transparent 60%),
     radial-gradient(900px 500px at 82% 72%, #3a3f52 0%, transparent 62%),
     linear-gradient(160deg, #1b2228 0%, #2a3238 48%, #171c21 100%);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1140px;
  /* The publication rows run wider: a method figure needs the room, and the row is the
     densest thing on the site. */
  --container-wide: 1320px;
  --gutter: 30px;

  /* over-scene mode: frosted panel tint, and the scrim that guarantees contrast */
  --band-alpha: .07;
  --scrim-alpha: .28;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #15171a;
    --bg-alt:     #1b1e22;
    --fg:         #b9c0c7;
    --head:       #f0f2f4;
    --rule:       #2b3036;
    --soft:       #22262b;
    --meta:       #8a939b;
    --link:       #6fb4ef;
    --link-head:  #9fc9ea;
    --btn-bg:     #f0f2f4;
    --btn-fg:     #15171a;
    --card:       #1f2328;
    --shadow:     0 0 30px -4px rgba(0,0,0,.55);
    --shadow-img: 0 0 85px 0 rgba(0,0,0,.55);
    --navbar-bg:  #15171a;
    --overlay:    rgba(21,23,26,.93);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:         #15171a;
  --bg-alt:     #1b1e22;
  --fg:         #b9c0c7;
  --head:       #f0f2f4;
  --rule:       #2b3036;
  --soft:       #22262b;
  --meta:       #8a939b;
  --link:       #6fb4ef;
  --link-head:  #9fc9ea;
  --btn-bg:     #f0f2f4;
  --btn-fg:     #15171a;
  --card:       #1f2328;
  --shadow:     0 0 30px -4px rgba(0,0,0,.55);
  --shadow-img: 0 0 85px 0 rgba(0,0,0,.55);
  --navbar-bg:  #15171a;
  --overlay:    rgba(21,23,26,.93);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* No rubber-band past the ends: at the bottom it pulled the tinted panel up off the
   page and showed the bare scene underneath. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overscroll-behavior-y: none; }
body { overscroll-behavior-y: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--head); margin: 0; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--link); text-decoration: none; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

/* ── grid scaffolding (stands in for the reference's bootstrap) ─────────── */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-left: max(15px, env(safe-area-inset-left, 0px));
  padding-right: max(15px, env(safe-area-inset-right, 0px));
}

.container-wide { max-width: var(--container-wide); }

.pt-100 { padding-top: 100px; }
.pb-100 { padding-bottom: 100px; }
.pb-70  { padding-bottom: 70px; }
.pb-50  { padding-bottom: 50px; }
.pt-50  { padding-top: 50px; }
.pt-40  { padding-top: 40px; }
.bg-gray { background-color: var(--bg-alt); }
.text-center { text-align: center; }

.heading { margin-bottom: 50px; }
.heading h2 {
  font-size: 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.main-btn {
  display: inline-block;
  background-color: var(--btn-bg);
  border: 2px solid var(--btn-bg);
  color: var(--btn-fg);
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.main-btn:hover { background-color: transparent; color: var(--head); }

/* ── navbar ────────────────────────────────────────────────────────────── */

/* Fixed from the start, so it stays put while the page scrolls under it; scrolling
   past the banner only turns it from transparent to the solid bar (.fixed-top). */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  padding-top: 30px;
  padding-bottom: 20px;
  transition: all .4s ease;
}

.navbar .container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar .logo {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--banner-ink);
  margin-right: auto;
}

.nav-menu { display: flex; align-items: center; }

.nav-menu li { padding-inline: 13px; }
.nav-menu li:first-child { padding-left: 0; }
.nav-menu li:last-child { padding-right: 0; }

.nav-menu a {
  position: relative;
  display: inline-block;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--banner-ink);
}
.nav-menu a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  transform: scaleX(0);
  transition: transform .3s ease;
}
.nav-menu a:hover::before,
.nav-menu a.active::before { transform: scaleX(1); }

.nav-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,.5);
  color: var(--banner-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 9px;
  cursor: pointer;
  border-radius: 2px;
}
.nav-toggle { display: none; font-size: 16px; line-height: 1; padding: 5px 10px; }

/* The menu button: three bars that turn into a cross while the menu is open. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, top .25s ease, background-color .15s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* scrolled state: solid bar, inked text */
.navbar.fixed-top {
  background-color: var(--navbar-bg);
  box-shadow: 0 1px 0 var(--rule);
  padding-top: 14px;
  padding-bottom: 14px;
}
.navbar.fixed-top .logo,
.navbar.fixed-top .nav-menu a { color: var(--head); }
.navbar.fixed-top .nav-toggle { color: var(--head); border-color: var(--rule); }

/* ── banner ────────────────────────────────────────────────────────────── */

.banner {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background-image: var(--banner-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #000;
  opacity: .5;
  z-index: 2;
}

.banner-caption {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  z-index: 11;
  color: var(--banner-ink);
}

.banner-caption h1 {
  color: var(--banner-ink);
  font-size: clamp(42px, 8.2vw, 88px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin-bottom: 18px;
  text-wrap: balance;
}

.banner-caption p {
  margin: 0;
  font-size: clamp(17px, 2.1vw, 24px);
  line-height: 1.45;
  color: var(--banner-sub);
}

/* rotating keyword */
.words {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: top;
  text-align: left;
}
.words b {
  display: inline-block;
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  font-weight: 700;
  color: var(--banner-ink);
  opacity: 0;
}
.words b.is-visible { position: relative; opacity: 1; }


/* ── about ─────────────────────────────────────────────────────────────── */

.about .row {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 60px;
  align-items: center;
}

/* the portrait sits on the right of the text; stacked layouts put it back on top */
.about-img { position: relative; width: 85%; margin-inline: auto; order: 2; }
.about-img::before {
  content: "";
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 100%;
  height: 100%;
  background-color: var(--bg-alt);
  z-index: 0;
}
.about-img .shot {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-img);
}

.about-heading { margin-bottom: 20px; }
.about-heading h2 { font-size: 32px; font-weight: 600; text-transform: uppercase; }
.about-heading span { display: block; font-size: 19px; color: var(--head); margin-top: 4px; }

.about-content p { line-height: 28px; margin: 0 0 16px; }
.about-content p:last-of-type { margin-bottom: 0; }

.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 26px;
}

.social-icons { display: flex; gap: 10px; }
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--btn-bg);
  border: 2px solid var(--btn-bg);
  color: var(--btn-fg);
  transition: background-color .2s ease, color .2s ease;
}
.social-icons a:hover { background-color: transparent; color: var(--head); }
.social-icons svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ── research / publication rows ───────────────────────────────────────────
   A small figure from the paper on the left, the citation to its right, across
   the wide measure. A method diagram must never be cropped, so the figure box
   has a fixed height and the image is contained inside it, on white — these
   figures are drawn for paper pages and nearly always have a white background,
   which would otherwise glare against the dark theme. */

.paper {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
.paper:last-child { border-bottom: 1px solid var(--rule); }

/* A paper with no figure yet simply uses the whole width. */
.paper--nofig { grid-template-columns: minmax(0, 1fr); }

.paper-fig {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  padding: 8px;
  transition: box-shadow .25s ease;
}
.paper-fig img {
  width: 100%;
  height: 100%;
  max-height: 148px;
  object-fit: contain;
  display: block;
}
.paper:hover .paper-fig { box-shadow: 0 6px 26px rgba(0,0,0,.18); }

.paper-info { font-size: 16px; min-width: 0; }
.paper-info .title {
  display: block;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--link-head);
  margin-bottom: 6px;
  text-wrap: balance;
}
.paper-info a.title:hover { text-decoration: underline; }
.paper-info .authors { margin: 0 0 3px; line-height: 1.6; }
.paper-info .authors .me, .paper-info .authors strong { font-weight: 700; color: var(--head); }
.paper-info .venue { margin: 0 0 8px; font-family: var(--mono); font-size: 14px; color: var(--meta); }
.paper-info .pub-links { margin: 0; font-family: var(--mono); font-size: 14px; }
.paper-info .pub-links a { color: var(--link); }
.paper-info .pub-links a:hover { text-decoration: underline; }
.paper-info .pub-links .sep { color: var(--rule); padding-inline: 3px; }

.papers { list-style: none; margin: 0; padding: 0; }

/* ── portfolio / MISC ──────────────────────────────────────────────────── */

.portfolio-filter { margin-bottom: 40px; }
.portfolio-filter ul { display: inline-flex; flex-wrap: wrap; justify-content: center; }
.portfolio-filter li {
  position: relative;
  margin-right: 20px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--head);
  cursor: pointer;
}
.portfolio-filter li::before { content: "/"; position: absolute; right: -15px; color: var(--meta); }
.portfolio-filter li:last-child { margin-right: 0; }
.portfolio-filter li:last-child::before { visibility: hidden; }
.portfolio-filter li.sel-item { font-weight: 400; text-decoration: underline; text-underline-offset: 4px; }

.portfolio-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.item-content { position: relative; overflow: hidden; }
.item-content .shot { width: 100%; aspect-ratio: 3 / 2; }
.item-content::before {
  content: "";
  position: absolute;
  inset: 10px;
  background-color: var(--overlay);
  opacity: 0;
  transform: scale(.8);
  transition: .5s all ease;
}
.item-content:hover::before,
.item-content:focus-within::before { opacity: 1; transform: scale(1); }

.item-overlay {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  text-align: center;
  padding-inline: 10%;
}
.item-overlay h6,
.item-overlay p {
  opacity: 0;
  transform: translateY(-10px);
  transition: .5s all ease;
}
.item-overlay h6 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.item-overlay p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fg); }
.item-content:hover .item-overlay h6,
.item-content:hover .item-overlay p,
.item-content:focus-within .item-overlay h6,
.item-content:focus-within .item-overlay p { opacity: 1; transform: translateY(0); }

/* ── blog ──────────────────────────────────────────────────────────────── */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.blog-item { box-shadow: var(--shadow); background: var(--card); display: flex; flex-direction: column; }
.blog-img { position: relative; overflow: hidden; }
.blog-img .shot { width: 100%; aspect-ratio: 3 / 2; transition: transform .5s; }
.blog-item:hover .blog-img .shot { transform: scale(1.15); }

.blog-content { padding: 30px 15px 15px; display: flex; flex-direction: column; flex: 1; }
.blog-content h3 { font-size: 20px; font-weight: 600; line-height: 1.35; margin-bottom: 15px; }
.blog-content h3 a { color: var(--head); }
.blog-content h3 a:hover { color: var(--link); }
.blog-content > p {
  margin: 0 0 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--soft);
  flex: 1;
}

.blog-meta { padding-top: 15px; display: flex; align-items: baseline; }
.blog-meta span { font-size: 13px; color: var(--meta); }
.blog-meta .more a { color: var(--head); font-weight: 600; border-bottom: 1px solid var(--meta); }
.blog-meta .more a:hover { color: var(--link); border-bottom-color: var(--link); }
.blog-meta .date { margin-left: auto; font-family: var(--mono); }

/* ── footer ────────────────────────────────────────────────────────────── */

footer .copy { font-size: 14px; color: var(--meta); font-family: var(--mono); margin: 0; }

/* ── placeholder art & prototype chrome ────────────────────────────────── */

.shot {
  background-color: var(--bg-alt);
  background-repeat: no-repeat;
  background-size: cover;
}
.shot-a { background-image:
  linear-gradient(145deg, #8f9aa3 0%, #5d666e 55%, #434a51 100%),
  none; }
.shot-b { background-image:
  radial-gradient(circle at 32% 30%, #a9b4bb 0 26%, transparent 27%),
  linear-gradient(160deg, #6f7a84 0%, #4a5158 100%); }
.shot-c { background-image:
  repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 8px, transparent 8px 16px),
  linear-gradient(120deg, #5c6b73 0%, #39424a 100%); }
.shot-d { background-image:
  linear-gradient(200deg, #9aa7a2 0%, #566159 60%, #3b433d 100%); }
.shot-e { background-image:
  radial-gradient(ellipse at 70% 75%, #b3b0a6 0 30%, transparent 31%),
  linear-gradient(135deg, #7b7468 0%, #45413a 100%); }
.shot-f { background-image:
  repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 12px),
  linear-gradient(150deg, #4f5a6b 0%, #2f3744 100%); }

/* ── gaussian-splat background layer ───────────────────────────────────── */

/* One fixed canvas behind the whole document. pointer-events are off so it
   never interferes with scrolling, selection or links. */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  display: block;
}

/* The scrim sits between the canvas and the content: without it, text over a
   bright patch of the scene is unreadable, and no amount of panel tint fixes
   that reliably across an orbiting camera. */
#bg-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  background:
    linear-gradient(
      to bottom,
      rgba(8,10,12, calc(var(--scrim-alpha) * 0.70)) 0%,
      rgba(8,10,12, calc(var(--scrim-alpha) * 0.45)) 38vh,
      rgba(8,10,12, var(--scrim-alpha)) 110vh
    );
}
body.scene #bg-scrim { opacity: 1; }

/* Content rides above both layers. */
.page, footer, main, section { position: relative; z-index: 1; }
/* The header sits above the content panel: on the same layer, the panel (later in the
   page) was drawn over the fixed header and its backdrop blur blurred the header too. */
.navbar { z-index: 30; }

/* ── over-scene palette ────────────────────────────────────────────────────
   Applied from the first paint whenever a scene is configured (the server puts
   `scene` on <body>), so the overlay never waits for the splats: the panel and
   palette are up at once over the canvas's dark base, and the city fades in
   behind them when it arrives. If WebGL2 is missing or the model fails to load,
   site.js removes the class and the page falls back to the opaque light/dark
   design. */

body.scene {
  background: rgb(11,14,17); /* the canvas's own clear colour, before it has drawn */
  --fg:        rgba(255,255,255,.80);
  --head:      #ffffff;
  --rule:      rgba(255,255,255,.18);
  --soft:      rgba(255,255,255,.14);
  --meta:      rgba(255,255,255,.58);
  --link:      #8fe0d4;
  --link-head: #ffffff;
  --btn-bg:    #ffffff;
  --btn-fg:    #14171a;
  --card:      rgba(255,255,255,.06);
  --overlay:   rgba(10,13,16,.88);
  --shadow:     0 10px 40px -10px rgba(0,0,0,.55);
  --shadow-img: 0 20px 60px -15px rgba(0,0,0,.6);
  --navbar-bg: rgba(12,15,18,.72);
  color-scheme: dark;
}

/* Bands become frosted glass rather than fills, so the scene reads the whole
   way down while the blur keeps the type legible. The alternating rhythm of
   the reference survives as two tint strengths. */
/* Everything below the hero sits on one continuous panel. A dark tint does the
   contrast work, so the blur can stay light enough for the scene to still read as a
   place rather than a smear. It is one element on purpose: tinting each section on
   its own leaves a visible seam wherever two blur boxes meet. */
body.scene .page {
  background-color: rgba(10,13,16, calc(var(--band-alpha) * 4.5));
  backdrop-filter: blur(5px) saturate(115%);
  -webkit-backdrop-filter: blur(5px) saturate(115%);
}
body.scene .page main > section,
body.scene .page .bg-gray,
body.scene .page footer {
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* no hairlines between sections: the panel below the hero reads as one surface */
body.scene main > section,
body.scene footer { border-top: 0; }

/* the banner is the one clear window: the scrim alone covers it */
.banner { background-color: transparent; backdrop-filter: none; }
body.scene .banner { background-image: none; }
body.scene .banner::after { opacity: 0; }
/* With a light scrim, contrast for the hero comes from a shadow hugging the type
   instead of dimming the whole window. */
body.scene .banner-caption h1,
body.scene .banner-caption p,
body.scene .banner-inner h1,
body.scene .banner-inner .crumb,
body.scene .banner-inner .meta {
  text-shadow: 0 1px 2px rgba(0,0,0,.45), 0 2px 28px rgba(0,0,0,.55);
}

/* component fixes that a token swap alone doesn't reach */
body.scene .about-img::before { background-color: rgba(255,255,255,.10); }
body.scene .blog-item {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.scene .blog-content { background: transparent; }
body.scene .navbar.fixed-top {
  background-color: var(--navbar-bg);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 1px 0 rgba(255,255,255,.10);
}
body.scene .navbar.fixed-top .logo,
body.scene .navbar.fixed-top .nav-menu a { color: #fff; }
body.scene .navbar.fixed-top .nav-toggle,
body.scene .paper:hover .paper-fig { box-shadow: 0 10px 44px rgba(0,0,0,.5); }
body.scene .portfolio-filter li::before { color: rgba(255,255,255,.4); }
body.scene .shot { background-color: rgba(255,255,255,.08); }

/* ── responsive (mirrors the reference's breakpoints) ───────────────────── */

@media (max-width: 991px) {
  .about .row { grid-template-columns: 1fr; gap: 0; }
  .about-img { order: 0; }
  .about-img::before { display: none; }
  .about-img .shot { aspect-ratio: 16 / 10; }
  .about-content { margin-top: 50px; }
  .portfolio-items { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }

  /* The menu: a frosted panel under the header, one large row per page, the current
     page marked with a dot. Header and panel share one glass surface while open. */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    color: #fff;
  }
  .navbar.menu-open,
  .navbar.menu-open.fixed-top {
    background-color: rgba(10,13,16,.92);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    box-shadow: none;
  }
  .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 4px max(20px, env(safe-area-inset-left, 0px)) 18px;
    background-color: rgba(10,13,16,.92);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 24px 40px -24px rgba(0,0,0,.8);
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
  }
  .nav-menu.open {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .nav-menu li,
  .nav-menu li:first-child,
  .nav-menu li:last-child { padding: 0; }
  .nav-menu li + li { border-top: 1px solid rgba(255,255,255,.07); }
  .nav-menu li { opacity: 0; transform: translateY(-4px); transition: opacity .25s ease, transform .25s ease; }
  .nav-menu.open li { opacity: 1; transform: none; }
  .nav-menu.open li:nth-child(2) { transition-delay: .03s; }
  .nav-menu.open li:nth-child(3) { transition-delay: .06s; }
  .nav-menu.open li:nth-child(4) { transition-delay: .09s; }
  .nav-menu.open li:nth-child(5) { transition-delay: .12s; }
  .nav-menu a,
  .navbar.fixed-top .nav-menu a,
  body.scene .navbar.fixed-top .nav-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 2px;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(255,255,255,.7);
  }
  .nav-menu a::before { display: none; }
  .nav-menu a.active,
  .navbar.fixed-top .nav-menu a.active,
  body.scene .navbar.fixed-top .nav-menu a.active { color: #fff; }
  .nav-menu a.active::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8fe0d4;
  }
}

@media (max-width: 700px) {
  .pt-100 { padding-top: 70px; }
  .pb-100 { padding-bottom: 70px; }
  .pb-70  { padding-bottom: 50px; }
  .heading { margin-bottom: 36px; }
  .heading h2, .about-heading h2 { font-size: 26px; }
  .portfolio-items { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ── inner-page banner ─────────────────────────────────────────────────────
   Every page but the home page opens with a short band instead of the full
   viewport hero, so the content starts above the fold. */

.banner-inner {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 46px;
  overflow: hidden;
  background-image: var(--banner-img);
  background-size: cover;
  background-position: center;
}
.banner-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #000;
  opacity: .5;
  z-index: 2;
}
body.scene .banner-inner { background-image: none; }
body.scene .banner-inner::after { opacity: 0; }

.banner-inner .container { position: relative; z-index: 11; }
.banner-inner h1 {
  margin: 0;
  color: var(--banner-ink);
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.12;
  text-wrap: balance;
}
.banner-inner .crumb {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.banner-inner .crumb a { color: inherit; }
.banner-inner .crumb a:hover { color: #fff; }
.banner-inner .meta {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255,255,255,.78);
}

/* ── article prose ─────────────────────────────────────────────────────────
   The migrated posts are long-form with full-width photographs, so the
   measure is constrained while images are allowed to breathe. */

.prose { max-width: 72ch; }
.prose > * { margin-block: 0 1.1em; }
.prose > *:last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin-block: 1.8em .5em;
  line-height: 1.3;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.prose h2 { font-size: 24px; font-weight: 600; }
.prose h3 { font-size: 19px; font-weight: 600; }
.prose h4 { font-size: 16px; font-weight: 600; }
.prose p { line-height: 1.75; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; line-height: 1.7; }
.prose img {
  width: 100%;
  max-width: 820px;
  height: auto;
  border-radius: 3px;
  margin-block: 1.6em;
  box-shadow: var(--shadow);
}
.prose blockquote {
  margin-inline: 0;
  padding: .2em 0 .2em 1.1em;
  border-left: 3px solid var(--rule);
  color: var(--meta);
}
.prose code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--soft);
  border-radius: 2px;
  padding: .1em .35em;
}
.prose pre {
  overflow-x: auto;
  background: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 14px 16px;
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; }

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.article-tags li {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--meta);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 2px 8px;
}

/* ── list pages (/blog, /projects) ─────────────────────────────────────── */

.entry-list { list-style: none; margin: 0; padding: 0; }
/* Same geometry as a publication row (.paper), so all list pages line up. */
.entry {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry-thumb { overflow: hidden; border-radius: 3px; }
.entry-thumb img, .entry-thumb .shot {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform .5s;
}
.entry:hover .entry-thumb img { transform: scale(1.06); }
.entry-title {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--head);
  margin-bottom: 4px;
}
.entry-title:hover { color: var(--link); }
.entry time, .entry .entry-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--meta);
}
.entry-summary { margin: 8px 0 0; line-height: 1.65; }
.entry .ext { font-family: var(--mono); font-size: 12px; color: var(--meta); }

.empty { color: var(--meta); font-family: var(--mono); font-size: 14px; }

/* ── publications ──────────────────────────────────────────────────────── */

.pub-group { margin-bottom: 46px; }
.pub-group > h2 {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--meta);
}
.pub-links { margin: 0; font-family: var(--mono); font-size: 13px; }
.pub-links a { color: var(--link); }
.pub-links a:hover { text-decoration: underline; }
.pub-links .sep { color: var(--rule); padding-inline: 2px; }
.pub-note { margin-top: 10px; font-size: 13px; color: var(--meta); }

.pub-meta {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 18px;
  margin: 0 0 18px;
  font-size: 15px;
}
.pub-meta dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--meta);
  padding-top: 3px;
}
.pub-meta dd { margin: 0; line-height: 1.6; }
.pub-meta dd strong { color: var(--head); }

/* ── a content band on an inner page ───────────────────────────────────── */

.band { padding-block: 70px 90px; }
.band > .container > h2 {
  margin: 0 0 24px;
  font-size: 26px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .01em;
}

/* a real <img> inside the components that had placeholder art in the prototype. The
   3/2 is the same ratio the .shot placeholders carry: without it the image keeps its
   own shape, and one wide cover turns its card into a letterbox strip while the cards
   beside it stay square. */
.item-content img, .blog-img img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform .5s;
}
.blog-img a { display: block; }
.blog-item:hover .blog-img img { transform: scale(1.15); }
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.portrait, .about-img .shot { overflow: hidden; }
.about-img img { width: 100%; height: auto; display: block; }

@media (max-width: 760px) {
  /* Stacked: the figure spans the column, like a project's image, not a small inset. */
  .paper { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 24px; }
  .paper-fig img { max-height: 200px; }
}

@media (max-width: 700px) {
  .entry { grid-template-columns: 1fr; gap: 14px; padding-block: 24px; }
  .pub-meta { grid-template-columns: 1fr; gap: 2px 0; }
  .pub-meta dd { margin-bottom: 10px; }
  .band { padding-block: 48px 60px; }
  .banner-inner { min-height: 28vh; padding-bottom: 26px; }
  /* /about: no leading photo on phones; the text starts right under the title. */
  .prose.page-about > p:first-child:has(> img:only-child) { display: none; }
}

/* /about: a leading photo sits to the right of the text on wide screens. */
@media (min-width: 992px) {
  /* the full content width, not the 72ch reading column: the photo takes the right edge */
  .prose.page-about { max-width: none; }
  .prose.page-about > p:first-child:has(> img:only-child) {
    float: right;
    width: 38%;
    margin: 6px 0 24px 56px;
  }
  .prose.page-about > p:first-child > img { width: 100%; display: block; }
  .prose.page-about::after { content: ""; display: block; clear: both; }
}

/* ── scene detail slider (home hero, built by site.js) ─────────────────────
   No box: a bare track and the splat count, with a soft shadow so both stay
   readable over bright parts of the scene. */

.scene-detail {
  position: fixed;
  right: max(28px, env(safe-area-inset-right, 0px));
  bottom: max(26px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  width: 200px;
  color: #fff;
  font-family: var(--mono);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s;
  visibility: hidden;
}
.scene-detail.is-shown { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.scene-detail.is-shown.is-faded {
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
  pointer-events: none;
  /* out fast, so it is gone before the content reaches it; back in at the calm 0.6 s */
  transition: opacity .2s ease-out, transform .2s ease-out, visibility 0s linear .2s;
}

.sd-range {
  --fill: 0%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
}
.sd-range:focus-visible { outline: 2px solid #8fe0d4; outline-offset: 4px; border-radius: 4px; }
.sd-range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, #fff var(--fill), rgba(255,255,255,.35) var(--fill));
}
.sd-range::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); }
.sd-range::-moz-range-progress { height: 3px; border-radius: 2px; background: #fff; }
.sd-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  transition: transform .15s;
}
.sd-range::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.sd-range:active::-webkit-slider-thumb { transform: scale(1.25); }

/* one mark per loading step, under the track */
.sd-ticks { display: flex; justify-content: space-between; padding: 0 5px; margin-top: 1px; }
.sd-ticks i { width: 1px; height: 4px; background: rgba(255,255,255,.45); }

.sd-count {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: rgba(255,255,255,.8);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.scene-detail.is-busy .sd-count { color: #8fe0d4; }

/* the loading line, in the same corner until the slider takes over */
.scene-loading {
  position: fixed;
  right: max(28px, env(safe-area-inset-right, 0px));
  bottom: max(26px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  width: 200px;
  font-family: var(--mono);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.scene-loading.is-shown { opacity: .75; }
.sl-bar {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
}
.sl-bar i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s ease; }
.sl-text {
  display: block;
  margin-top: 7px;
  text-align: right;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.8);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

@media (max-width: 700px) {
  .scene-detail, .scene-loading { width: 160px; right: 15px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-detail, .scene-detail.is-shown.is-faded { transform: none; }
}

/* ── touch screens: project tiles ─────────────────────────────────────────
   The tiles reveal title and summary on hover, which a touch screen does not have:
   there the tile showed only its picture, and the first tap went straight to the
   repository. On devices without hover the caption sits under the picture instead. */
@media (hover: none) {
  .item-content::before { display: none; }
  .item-overlay {
    position: static;
    transform: none;
    text-align: left;
    padding: 14px 2px 4px;
  }
  .item-overlay h6,
  .item-overlay p { opacity: 1; transform: none; }
  .item-overlay h6 { font-size: 15px; letter-spacing: .5px; color: var(--head); }
}
