/* The portfolio's one stylesheet. Plain CSS, no build step. Breakpoints:
   sm 40rem (640px), md 48rem (768px), lg 64rem (1024px). */

/* ── Fonts: IBM Plex (OFL), latin and latin-ext only ── */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(fonts/plex-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(fonts/plex-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/plex-mono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/plex-mono-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/plex-mono-500-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Arial sized to Plex's metrics, so the swap does not move the text. */
@font-face {
  font-family: "IBM Plex Sans Fallback";
  src: local(Arial);
  ascent-override: 101.32%;
  descent-override: 27.18%;
  line-gap-override: 0%;
  size-adjust: 101.17%;
}
@font-face {
  font-family: "IBM Plex Mono Fallback";
  src: local(Arial);
  ascent-override: 76.16%;
  descent-override: 20.43%;
  line-gap-override: 0%;
  size-adjust: 134.59%;
}

/* ── Tokens ── */
:root {
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Modular type scale: one ratio drives the headings and the body copy.
     The steps above the body are fluid, with a smaller floor on phones. */
  --ratio: 1.5;
  --s0: 1.15rem;
  --s1-max: calc(var(--s0) * var(--ratio));
  --s2-max: calc(var(--s1-max) * var(--ratio));
  --s3-max: calc(var(--s2-max) * var(--ratio));
  --s1: clamp(1.4rem, 1.2rem + 0.82vw, var(--s1-max));
  --s2: clamp(1.75rem, 1.235rem + 2.11vw, var(--s2-max));
  --s3: clamp(2.25rem, 1.25rem + 4.1vw, var(--s3-max));
  --s-1: calc(var(--s0) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-half: clamp(1.25rem, 1.1525rem + 0.4vw, calc(var(--s0) * sqrt(var(--ratio))));
  --s-brand: 1.75rem;

  --background: oklch(98.5% 0 0);
  --foreground: oklch(14.5% 0 0);
  --muted: oklch(93% 0 0);
  --muted-foreground: oklch(52% 0 0);
  --border: oklch(86% 0 0);
  --ring: oklch(14.5% 0 0);
  --placeholder: color-mix(in oklch, var(--muted) 50%, transparent);

  color-scheme: light dark;
}

/* Dark theme follows the OS setting, live: no script. */
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(14.5% 0 0);
    --foreground: oklch(98.5% 0 0);
    --muted: oklch(20.5% 0 0);
    --muted-foreground: oklch(71% 0 0);
    --border: oklch(24% 0 0);
    --ring: oklch(98.5% 0 0);
  }
}

/* ── Base ── */
*, ::before, ::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--border);
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  font-family: var(--font-sans);
  line-height: 1.5;
  background-color: var(--background);
  tab-size: 4;
}
body {
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
  background: var(--background);
  color: var(--foreground);
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: 400;
  letter-spacing: -0.02em;
}
a { color: inherit; text-decoration: inherit; }
ul, ol { list-style: none; }
img, svg, video, picture { display: block; max-width: 100%; }
img, video { height: auto; }
button {
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
  letter-spacing: inherit;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon { flex-shrink: 0; }
.icon-12 { width: 0.75rem; height: 0.75rem; }
.icon-14 { width: 0.875rem; height: 0.875rem; }
.icon-16 { width: 1rem; height: 1rem; }
.icon-20 { width: 1.25rem; height: 1.25rem; }
.icon-24 { width: 1.5rem; height: 1.5rem; }

/* ── Page frame ── */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
main {
  flex: 1;
  min-width: 0;
  container-type: inline-size;
}
.container {
  max-width: 1400px;
  margin-inline: auto;
  padding: 1.5rem 1rem;
}
@media (min-width: 40rem) { .container { padding-inline: 1.5rem; } }

.skip-link {
  position: absolute;
  left: -10000px;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--background);
  color: var(--foreground);
  outline: 2px solid var(--ring);
}

/* ── Header ── */
.site-header {
  position: relative;
  z-index: 50;
  width: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.site-header-bar {
  max-width: 1400px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1rem 0.75rem;
}
@media (min-width: 40rem) { .site-header-bar { padding-inline: 1.5rem; } }
@media (min-width: 48rem) { .site-header-bar { padding-top: 2.5rem; padding-bottom: 1.25rem; } }

.brand {
  font-size: var(--s-brand);
  letter-spacing: -0.025em;
}
.brand:hover { opacity: 0.7; }

.nav-desktop { display: none; align-items: center; gap: 2.25rem; }
.nav-sep { width: 1px; height: 0.875rem; background: var(--border); }
@media (min-width: 48rem) { .nav-desktop { display: flex; } }
.nav-desktop a {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.nav-desktop a:hover,
.nav-desktop a[aria-current] { color: var(--foreground); }
.nav-desktop a[aria-current] { font-weight: 600; }
/* The bold label's width is reserved, so the active link does not nudge
   the rest of the menu. */
.nav-desktop a::after {
  content: attr(data-label);
  visibility: hidden;
  height: 0;
  overflow: hidden;
  font-weight: 600;
}

.nav-toggle {
  display: flex;
  margin: -0.5rem;
  padding: 0.5rem;
}
.nav-toggle:hover { opacity: 0.7; }
@media (min-width: 48rem) { .nav-toggle { display: none; } }
.nav-toggle .icon-close { display: none; }
.site-header:has(.nav-mobile:popover-open) .nav-toggle .icon-open { display: none; }
.site-header:has(.nav-mobile:popover-open) .nav-toggle .icon-close { display: block; }

/* The mobile menu is a popover: Escape and a tap outside close it. It drops
   down from the header (app.js sets its top). */
.nav-mobile {
  position: absolute;
  inset: auto 0 auto 0;
  top: 4.5rem;
  width: 100%;
  margin: 0;
  border: 0;
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--background);
  color: var(--foreground);
}
.nav-mobile:popover-open { display: flex; }
@media (min-width: 40rem) { .nav-mobile { padding-inline: 1.5rem; } }
@media (min-width: 48rem) { .nav-mobile:popover-open { display: none; } }
.nav-mobile a {
  padding-block: 0.5rem;
  letter-spacing: 0.025em;
  color: var(--muted-foreground);
}
.nav-mobile a:hover,
.nav-mobile a[aria-current] { color: var(--foreground); }
.nav-mobile a[aria-current] { font-weight: 600; }

/* ── Footer ── */
.site-footer {
  max-width: 56rem;
  margin-inline: auto;
  padding: 3rem 1rem calc(3rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}
@media (min-width: 40rem) { .site-footer { padding-inline: 1.5rem; } }

/* ── Photos ── */
/* A box holding a photo's proportions; the photo fills it. */
.media-box {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--placeholder);
}
.media-box.square { aspect-ratio: 1; }
img.fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
img.fill.contain { object-fit: contain; }
/* The blur placeholder is each photo's background (set inline). */
img[style*="background-image"] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.photo-button { cursor: pointer; }
.photo-button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.video-badge {
  pointer-events: none;
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: #000;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── The post grid (home page and filters) ── */
.grid-list { display: flex; flex-direction: column; gap: 2rem; }
.grid-cols { display: none; }
.grid-cols ul { display: flex; flex-direction: column; gap: 2.25rem; min-width: 0; }
@media (min-width: 48rem) {
  .grid-list { display: none; }
  .grid-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
}
@media (min-width: 64rem) {
  .grid-cols-2 { display: none; }
  .grid-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
}
/* Pages loaded with "Visa fler" follow on below. */
.grid-page + .grid-page { margin-top: 2.25rem; }

.card { display: block; }
.card .media-box { margin-bottom: 0.75rem; }
.card img { transition: opacity 150ms; }
.card:hover img { opacity: 0.92; }
.card:focus-visible { outline: none; }
.card:focus-visible .media-box { outline: 2px solid var(--ring); outline-offset: 2px; }
.card-title {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.card-meta {
  margin-top: 0.375rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}
.card-type {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: 0;
}
.card-meta time { flex-shrink: 0; }

.grid-more { margin-top: 3rem; display: flex; justify-content: center; }
.grid-more a {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.grid-more a:hover { color: var(--foreground); border-color: var(--foreground); }
.grid-more a[aria-busy="true"] { opacity: 0.5; pointer-events: none; }

/* ── Download, at the end of a post ── */
.post-download {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  transition: color 150ms, border-color 150ms;
}
.download-button:hover,
.download-button:has(+ :popover-open) { color: var(--foreground); border-color: var(--foreground); }
.download-button .download-detail { text-transform: none; letter-spacing: 0.025em; }
.download-license { font-size: 0.75rem; line-height: 1rem; color: var(--muted-foreground); }
.blog-download { padding-inline: 1rem; }

/* ── Post headers ── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.title {
  font-size: var(--s3);
  line-height: 1.25;
  letter-spacing: -0.025em;
}
/* Every post's header is centred: date, title, then the excerpt (albums)
   or the tags (blog posts). */
.album-page { padding-top: 2rem; }
.album-header { margin-bottom: 3rem; }
.album-excerpt {
  margin: 1rem auto 0;
  max-width: 48rem;
  line-height: 1.8;
  color: var(--muted-foreground);
}
.album-body { max-width: 48rem; margin: 0 auto 3rem; }

.post-header {
  max-width: 56rem;
  margin-inline: auto;
  text-align: center;
}
.post-header .title { margin-top: 1rem; }
.tags {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

/* ── Masonry grid (albums, galleries) ── */
.image-grid { columns: 1; column-gap: 1rem; }
.image-grid-item { margin-bottom: 1rem; break-inside: avoid; }
@media (min-width: 40rem) {
  .image-grid { columns: 2; column-gap: 1.5rem; }
  .image-grid-item { margin-bottom: 1.5rem; }
}
@media (min-width: 64rem) { .image-grid { columns: 3; } }

/* ── A select's page ── */
.select-page {
  max-width: 1200px;
  margin-inline: auto;
  padding: 2rem 1rem;
}
@media (min-width: 40rem) { .select-page { padding-inline: 1.5rem; } }
.post-media {
  max-width: 64rem;
  margin: 3rem auto 0;
}
.photo-box {
  position: relative;
  display: block;
  margin-inline: auto;
  overflow: hidden;
  background: var(--placeholder);
}
.post-video {
  width: 100%;
  max-height: 80vh;
  background: #000;
}

/* ── Video player (app.js) ── */
.player { position: relative; }
.player.photo-box .post-video {
  position: absolute;
  inset: 0;
  height: 100%;
  max-height: none;
  object-fit: contain;
}
.player.is-enhanced video { cursor: pointer; }
.player-inline { margin-inline: auto; }
.player-big,
.player-bar { opacity: 0; transition: opacity 200ms; }
.player.is-paused .player-big,
.player.is-paused .player-bar,
.player.is-active .player-bar,
.player:focus-within .player-bar { opacity: 1; }
.player:not(.is-paused) .player-big { pointer-events: none; }
/* Flat, in the page's own colours (light or dark): no blur, no gradients. */
.player-big {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  padding-left: 0.25rem; /* the triangle looks centred */
  border-radius: 9999px;
  background: var(--background);
  color: var(--foreground);
  transition: opacity 200ms;
}
.player-big svg { fill: currentColor; }
.player-big:hover { background: var(--foreground); color: var(--background); }
.player-bar {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem;
  background: var(--background);
  color: var(--foreground);
}
.player-btn { display: flex; padding: 0.25rem; }
.player-btn:hover { opacity: 0.6; }
.player-btn:focus-visible,
.player-big:focus-visible,
.player-seek:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.player-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
/* The seek line: 2 px, filled up to --progress; a square knob on hover. */
.player-seek {
  --progress: 0%;
  flex: 1;
  min-width: 3rem;
  height: 1rem;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.player-seek::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--foreground) var(--progress), var(--border) var(--progress));
}
.player-seek::-moz-range-track {
  height: 2px;
  background: linear-gradient(to right, var(--foreground) var(--progress), var(--border) var(--progress));
}
.player-seek::-webkit-slider-thumb {
  appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-radius: 0;
  background: var(--foreground);
  opacity: 0;
  transition: opacity 150ms;
}
.player-seek::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 0;
  background: var(--foreground);
  opacity: 0;
}
.player-seek:hover::-webkit-slider-thumb,
.player-seek:focus-visible::-webkit-slider-thumb { opacity: 1; }
.player-seek:hover::-moz-range-thumb,
.player-seek:focus-visible::-moz-range-thumb { opacity: 1; }
.player:fullscreen { width: 100% !important; aspect-ratio: auto !important; background: #000; }
.player:fullscreen .post-video { max-height: none; }
@media (max-width: 39.99rem) {
  .player-bar { gap: 0.5rem; padding-inline: 0.5rem; }
  .player-big { width: 3.75rem; height: 3.75rem; }
}
.photo-caption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}
.select-excerpt {
  max-width: 48rem;
  margin: 2.5rem auto 0;
  text-align: center;
  line-height: 1.8;
}
.post-pager { max-width: 64rem; margin-inline: auto; }

/* ── A blog post ── */
.blog-page { padding-block: 1.5rem; }
.blog-page .post-header { padding-inline: 1rem; }
@media (min-width: 40rem) { .blog-page .post-header { padding-inline: 1.5rem; } }
.blog-cover { padding-inline: 1rem; }
.zoom-in {
  display: block;
  width: 100%;
  cursor: zoom-in;
}
.blog-body {
  max-width: 48rem;
  margin: 3rem auto 0;
  padding-inline: 1rem;
}
@media (min-width: 40rem) { .blog-body { padding-inline: 1.5rem; } }
.blog-gallery {
  max-width: 1400px;
  margin: 4rem auto 0;
  padding-inline: 1rem;
}
@media (min-width: 40rem) { .blog-gallery { padding-inline: 1.5rem; } }
.body-photo { width: 100%; height: auto; }

.blog-pager { max-width: 48rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 40rem) { .blog-pager { padding-inline: 1.5rem; } }

/* ── Side pager (desktop): newer/older at the screen's edges ── */
.side-pager { display: none; }
@media (min-width: 64rem) {
  .side-pager { display: block; }
  .side-pager-link {
    position: fixed;
    top: 50%;
    z-index: 40;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem;
    color: var(--muted-foreground);
    background: color-mix(in oklch, var(--background) 80%, transparent);
    transition: color 150ms;
  }
  .side-pager-link.newer { left: calc(env(safe-area-inset-left) + 0.75rem); }
  .side-pager-link.older { right: calc(env(safe-area-inset-right) + 0.75rem); }
  .side-pager-link:hover,
  .side-pager-link:focus-visible { color: var(--foreground); }
  .side-pager-title {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.75rem;
    line-height: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: max-width 200ms ease-out;
  }
  .side-pager-link:hover .side-pager-title,
  .side-pager-link:focus-visible .side-pager-title { max-width: 18rem; }
}

/* ── Pager ── */
.pager { margin-top: 4rem; display: flex; gap: 2rem; }
/* From lg the arrows at the screen's edges do this (the side pager); the
   links stay in the page for ← and →. */
@media (min-width: 64rem) { .pager { display: none; } }
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.pager-link.newer { align-items: flex-start; text-align: left; }
.pager-link.older { margin-left: auto; align-items: flex-end; text-align: right; }
.pager-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.pager-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.pager-link:hover .pager-title { opacity: 0.7; }

/* ── About ── */
.about {
  max-width: 1400px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}
@media (min-width: 40rem) { .about { padding-inline: 1.5rem; } }
@media (min-width: 48rem) { .about { padding-block: 6rem; } }
.about-inner { text-align: center; display: flex; flex-direction: column; gap: 2.5rem; }
.about-lead {
  font-size: 1.25rem;
  line-height: 1.625;
  color: color-mix(in oklch, var(--foreground) 85%, transparent);
}
@media (min-width: 48rem) { .about-lead { font-size: 1.5rem; } }
.about-text {
  max-width: 65ch;
  line-height: 1.625;
  color: var(--muted-foreground);
}
.social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding-top: 0.5rem;
}
.social a,
.social button {
  color: var(--muted-foreground);
  transition: color 150ms;
}
.social a:hover,
.social button:hover { color: var(--foreground); }

/* ── RSS dialog ── */
.feed-dialog {
  margin: auto;
  width: 100%;
  max-width: 28rem;
  padding: 1rem;
  background: transparent;
  color: var(--foreground);
  border: 0;
}
.feed-dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.feed-dialog-panel {
  background: var(--background);
  padding: 1.5rem;
  text-align: left;
}
@media (min-width: 40rem) { .feed-dialog-panel { padding: 2rem; } }
.feed-dialog h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: normal;
}
.feed-dialog p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}
.feed-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--muted);
}
.feed-label { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.feed-actions { display: flex; align-items: center; gap: 1rem; }
.feed-actions button,
.feed-actions a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}
.feed-actions a { text-decoration: underline; text-underline-offset: 4px; }
.feed-actions button:hover,
.feed-actions a:hover { opacity: 0.7; }
.feed-copy .when-copied,
.feed-copy.copied .when-idle { display: none; }
.feed-copy.copied .when-copied { display: inline; }
.feed-copy.copied svg.when-copied { display: block; }
.feed-close { margin-top: 1.5rem; display: flex; justify-content: flex-end; }
.feed-close button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.feed-close button:hover { background: var(--muted); color: var(--foreground); }

/* ── Empty and error pages ── */
.empty-state { padding-block: 6rem; text-align: center; }
.empty-state p {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-style: italic;
  color: var(--muted-foreground);
}
.message-page {
  max-width: 56rem;
  min-height: calc(100vh - 8rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 6rem 1rem;
}
.message-code {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.message-text { text-align: center; color: var(--muted-foreground); }
.text-link {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-link:hover { opacity: 0.8; }

/* ── Prose (post bodies) ── */
.prose {
  font-size: var(--s0);
  line-height: 1.8;
  letter-spacing: -0.005em;
  color: var(--foreground);
  --flow-space: var(--s0);
}
/* Every gap is owned by --flow-space, applied above each element. */
.prose > * + * { margin-block-start: var(--flow-space); }
.prose > :is(h1, h2) { --flow-space: var(--s3); }
.prose > :is(h3, h4) { --flow-space: var(--s2); }
.prose > :is(h5, h6) { --flow-space: var(--s1); }
.prose > :is(h2, h3, h4) + * { --flow-space: var(--s-1); }
.prose > h5 + * { --flow-space: var(--s-2); }
.prose > h6 + * { --flow-space: var(--s-3); }
.prose :where(h1, h2, h3, h4, h5, h6) { line-height: 1.3; }
.prose :where(h1, h2) { font-size: var(--s2); }
.prose :where(h3) { font-size: var(--s1); }
.prose :where(h4) { font-size: var(--s-half); }
.prose :where(h5, h6) { font-size: var(--s0); }
.prose :where(h6) { font-weight: 500; }
.prose :where(a) {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose :where(strong) { font-weight: 600; }
.prose :where(ul) { list-style: disc; padding-inline-start: 1.625em; }
.prose :where(ol) { list-style: decimal; padding-inline-start: 1.625em; }
.prose :where(li) { padding-inline-start: 0.375em; }
.prose :where(li + li) { margin-top: 0.5em; }
.prose :where(li)::marker { color: var(--muted-foreground); }
.prose :where(blockquote) {
  border-inline-start: 0.25rem solid var(--border);
  padding-inline-start: 1em;
  font-style: italic;
}
.prose :where(hr) { border-top-width: 1px; }
.prose :where(code) { font-family: var(--font-mono); font-size: 0.875em; }
.prose :where(pre) {
  overflow-x: auto;
  padding: 0.75em 1em;
  background: var(--muted);
  font-size: 0.875em;
  line-height: 1.7;
}
.prose :where(table) { width: 100%; border-collapse: collapse; font-size: 0.875em; }
.prose :where(th, td) { padding: 0.5em; border-bottom: 1px solid var(--border); text-align: left; }
.prose :where(figure) { margin-block: 2em; }
.prose :where(figcaption) {
  margin-top: 0.85em;
  font-size: 0.875em;
  line-height: 1.4;
  color: var(--muted-foreground);
}
.prose :where(video) { width: 100%; }

/* ── Lightbox (app.js) ── */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--background);
  color: var(--foreground);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}
.lightbox::backdrop { background: var(--background); }
.lb-slide {
  position: absolute;
  overflow: hidden;
  background: var(--placeholder);
  touch-action: none;
}
.lb-slide img,
.lb-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-slide img { transform-origin: 0 0; will-change: transform; }
.lb-slide.zoomable { cursor: zoom-in; }
.lb-slide.zoomed { cursor: grab; }
.lb-slide video { background: #000; }
.lb-button {
  position: absolute;
  z-index: 2;
  display: flex;
  padding: 12px;
  color: var(--foreground);
}
.lb-button:disabled { color: var(--muted-foreground); }
.lb-toolbar {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  display: flex;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 8px) 8px 8px;
}
.lb-toolbar .lb-button { position: static; }
.lb-prev,
.lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: calc(env(safe-area-inset-left) + 8px); }
.lb-next { right: calc(env(safe-area-inset-right) + 8px); }
/* Phones: no arrows (swipe), the controls centred at the bottom. */
@media (max-width: 767px) {
  .lb-prev, .lb-next { display: none; }
  .lb-toolbar {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 0 calc(env(safe-area-inset-bottom) + 1rem);
  }
}
.lb-caption {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 0.5rem;
  text-align: center;
  color: var(--muted-foreground);
}
.lb-caption-line {
  display: flex;
  max-width: 100%;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
/* The info and download buttons, in a row under the caption. */
.lb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 1.5rem;
}
.lb-caption-line + .lb-actions { margin-top: 0.25rem; }
.lb-caption-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-caption-button {
  margin: -0.375rem 0;
  padding: 0.375rem;
  flex-shrink: 0;
  transition: color 150ms;
}
.lb-caption-button:hover,
.lb-caption-button[aria-expanded="true"],
.lb-caption-button:has(+ :popover-open) { color: var(--foreground); }

/* ── Popovers: the download menus and the camera settings (app.js) ──
   Above their button, below when there is no room; placed from app.js
   where anchor positioning is missing. */
.pop,
.dl-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: calc(100vw - 1rem);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 8px 24px oklch(0% 0 0 / 0.12);
}
@supports (position-area: block-start) {
  .pop,
  .dl-menu {
    position-area: block-start;
    position-try-fallbacks: flip-block;
    margin: 0.5rem;
  }
  /* In the lightbox the buttons sit under the caption: open above it. */
  .lightbox:has(.lb-caption-line) :is(.pop, .dl-menu) { margin-bottom: 2.25rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .pop,
  .dl-menu {
    opacity: 0;
    translate: 0 0.25rem;
    transition: opacity, translate, display, overlay;
    transition-duration: 0.15s;
    transition-behavior: allow-discrete;
  }
  .pop:popover-open,
  .dl-menu:popover-open {
    opacity: 1;
    translate: 0 0;
    transition-duration: 0.1s;
    @starting-style { opacity: 0; translate: 0 0.25rem; }
  }
}
.lb-exif {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.125rem;
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.lb-exif p:first-child { color: var(--foreground); }
.dl-menu { min-width: 16rem; padding: 0.25rem; }
.dl-menu ul { margin: 0; padding: 0; list-style: none; }
.dl-menu li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.dl-menu li a:hover,
.dl-menu li a:focus-visible { background: var(--muted); outline: none; }
.dl-detail,
.download-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.dl-license {
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem 0.375rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted-foreground);
}
.dl-license:empty { display: none; }
.dl-license a,
.download-license a,
.footer-license a {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
.dl-license a:hover,
.download-license a:hover,
.footer-license a:hover { color: var(--foreground); text-decoration-color: currentColor; }
html:has(.lightbox[open]) { overflow: hidden; }
