/* ==========================================================================
   Stefan Pirker — Photography & Film
   ========================================================================== */

:root {
  --ink: #0e0e0d;
  --ink-2: #171715;
  --paper: #f1ede6;
  --muted: #9a958c;
  --line: rgba(241, 237, 230, 0.14);
  --accent: #ff4a2b;          /* REC red */

  --font-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 3vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.18, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html[data-intro] { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, p, blockquote, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

.sr, .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* WordPress admin bar */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.nav li { list-style: none; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 300; background: var(--paper); color: var(--ink); padding: 8px 12px; }
.skip:focus { top: 8px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.95em 1.4em;
  background: var(--paper); color: var(--ink);
  border-radius: 999px;
  font-weight: 500; font-size: 0.95rem; line-height: 1;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.btn:hover { background: var(--accent); color: #fff; }
.btn .arrow { transition: transform 0.35s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px rgba(241, 237, 230, 0.4); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-small { padding: 0.7em 1.1em; font-size: 0.85rem; }
.btn-big { font-size: clamp(1rem, 2vw, 1.4rem); padding: 1em 1.5em; }

/* ── REC badge (shared by intro + hero) ──────────────── */
.rec { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* ==========================================================================
   Opening sequence
   Four shutters close the frame, the name types up through letter masks,
   then the shutters pull away from the centre like a viewfinder opening.
   States on <html data-intro>: pending → loading → reveal → (removed)
   ========================================================================== */

.intro { display: none; }

html[data-intro] .intro {
  display: block;
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
  /* failsafe: if JS never runs the reveal, get out of the way */
  animation: intro-failsafe 0s 7s forwards;
}
@keyframes intro-failsafe { to { visibility: hidden; } }

.shutter {
  position: absolute;
  background: var(--ink);
  transition: transform 1.15s var(--ease-io);
  will-change: transform;
}
.shutter[data-side="top"]    { inset: -1px -1px 50% -1px; }
.shutter[data-side="bottom"] { inset: 50% -1px -1px -1px; }
.shutter[data-side="left"]   { inset: -1px 50% -1px -1px; }
.shutter[data-side="right"]  { inset: -1px -1px -1px 50%; }

html[data-intro="reveal"] .shutter[data-side="top"]    { transform: translateY(-101%); transition-delay: 0.1s; }
html[data-intro="reveal"] .shutter[data-side="bottom"] { transform: translateY(101%);  transition-delay: 0.1s; }
html[data-intro="reveal"] .shutter[data-side="left"]   { transform: translateX(-101%); }
html[data-intro="reveal"] .shutter[data-side="right"]  { transform: translateX(101%); }

.intro-center {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 1rem;
  text-align: center;
}
.intro-mark {
  font-size: clamp(2.6rem, 9vw, 8rem);
  font-weight: 600; letter-spacing: -0.045em; line-height: 0.95;
}
.intro-sub {
  display: flex; align-items: center; gap: 0.8em;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.6s 0.5s, transform 0.8s 0.5s var(--ease-out);
}
.intro-sub .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.intro-meta {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  opacity: 0; transition: opacity 0.6s 0.3s;
}
.intro-count b { color: var(--paper); font-weight: 500; }

html[data-intro="loading"] .intro-sub { opacity: 1; transform: none; }
html[data-intro="loading"] .intro-meta { opacity: 1; }
html[data-intro="reveal"] .intro-sub,
html[data-intro="reveal"] .intro-meta { opacity: 0; transform: none; transition: opacity 0.3s; }

/* split letters (intro mark + hero wordmark) */
.mask { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.char { display: inline-block; transform: translateY(105%); }
.intro .char { transition: transform 0.9s var(--ease-out); transition-delay: calc(var(--i) * 45ms); }
html[data-intro="loading"] .intro .char { transform: none; }
html[data-intro="reveal"] .intro .char {
  transform: translateY(-105%);
  transition: transform 0.6s var(--ease-io);
  transition-delay: calc(var(--i) * 20ms);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  padding: 18px var(--gutter);
  transition: background 0.4s, backdrop-filter 0.4s, transform 0.5s var(--ease-out);
}
.site-header.is-solid { background: rgba(14, 14, 13, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.site-header.is-hidden { transform: translateY(-100%); }
.logo { font-weight: 600; letter-spacing: -0.02em; font-size: 1.05rem; margin-right: auto; }
.nav { display: flex; gap: 1.8rem; font-size: 0.9rem; }
.nav a { position: relative; opacity: 0.8; transition: opacity 0.2s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease-out); }
.nav a:hover { opacity: 1; }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.lang { display: flex; gap: 2px; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(241,237,230,0.25); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; }
.lang button, .lang a { padding: 0.45em 0.7em; border-radius: 999px; color: rgba(241,237,230,0.6); transition: background 0.3s, color 0.3s; }
.lang .is-active { background: var(--paper); color: var(--ink); }
.lang :not(.is-active):hover { color: var(--paper); }

.menu-toggle { display: none; width: 40px; height: 40px; position: relative; }
.menu-toggle i { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--paper); transition: transform 0.4s var(--ease-out); }
.menu-toggle i:first-of-type { top: 16px; }
.menu-toggle i:last-of-type { top: 23px; }
.menu-toggle[aria-expanded="true"] i:first-of-type { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] i:last-of-type { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; align-items: flex-end;
  padding: 100px var(--gutter) 48px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: grid; gap: 0.4rem; }
.mobile-menu a { font-size: clamp(2.4rem, 12vw, 4rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; display: flex; align-items: baseline; gap: 0.6rem; }
.mobile-menu small { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-columns: minmax(0, 1fr);
  padding: 84px var(--gutter) 0;
  overflow: clip;
  isolation: isolate;
}

.hero-media { position: absolute; inset: 0; z-index: -2; transform-origin: 50% 50%; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img, .hero-slide video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
/* The outgoing slide keeps its zoom while it fades (.is-leaving); 9s outlasts slide time + fade, so it never snaps back. */
.hero-slide.is-active img, .hero-slide.is-active video,
.hero-slide.is-leaving img, .hero-slide.is-leaving video { animation: kenburns 9s linear both; }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }

.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14,14,13,0.55) 0%, rgba(14,14,13,0) 28%, rgba(14,14,13,0) 50%, rgba(14,14,13,0.85) 100%),
    rgba(14,14,13,0.18);
}

/* viewfinder corner brackets */
.finder { position: absolute; inset: 76px var(--gutter) 24px; pointer-events: none; z-index: -1; }
.finder i { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(241,237,230,0.55); }
.finder i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.finder i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.finder i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.finder i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.hero-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 14px 0;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
}
.timecode { opacity: 0.85; font-variant-numeric: tabular-nums; }

.hero-content {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2rem 4rem;
  align-items: end;
  padding: 0 14px 2.2rem;
}
.hero-title {
  font-size: clamp(2.3rem, 5.2vw, 5.4rem);
  font-weight: 500; letter-spacing: -0.045em; line-height: 0.98;
}
.hero-title .line { display: block; }
.hero-title em { letter-spacing: -0.02em; color: var(--paper); }

.turn { display: inline-block; overflow: clip; vertical-align: bottom; padding: 0 0.08em 0.08em 0; margin-bottom: -0.08em; }
.turn-word { display: inline-block; transition: transform 0.7s var(--ease-io), opacity 0.7s; }
.turn-word.is-out { transform: translateY(-110%); opacity: 0; }
.turn-word.is-below { transform: translateY(110%); opacity: 0; transition: none; }

.hero-side { max-width: 26rem; justify-self: end; }
.hero-side p { font-size: 1.02rem; color: rgba(241,237,230,0.85); margin-bottom: 1.4rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.hero-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0 14px 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  font-family: var(--font-mono); font-size: 0.75rem; color: rgba(241,237,230,0.75);
}
.hero-caption { transition: opacity 0.4s; }
.hero-caption.is-swapping { opacity: 0; }
.hero-index { display: flex; align-items: center; gap: 0.8rem; font-variant-numeric: tabular-nums; }
.hero-index .bar { width: 72px; height: 1px; background: var(--line); overflow: hidden; }
.hero-index .bar i { display: block; height: 100%; background: var(--paper); transform-origin: left; transform: scaleX(0); }
.hero-index .bar i.is-running { animation: progress var(--slide-ms, 6000ms) linear forwards; }
@keyframes progress { to { transform: scaleX(1); } }

.wordmark {
  width: max-content;
  white-space: nowrap;
  font-weight: 600; letter-spacing: -0.055em; line-height: 0.9;
  font-size: 15vw;                 /* refined by JS to fit exactly */
  margin: 0 -0.02em -0.04em;
  pointer-events: none;
  user-select: none;
}
.wordmark .char { transform: none; }
/* scroll effect (main.js): letters flip backwards into their mask one after another */
.wordmark .mask { perspective: 520px; }
.wordmark .char { transform-origin: 50% 100%; backface-visibility: hidden; }

/* Hero entrance — only while the intro owns the page */
html[data-intro] .hero-media { transform: scale(1.3); }
html[data-intro] [data-rise] { opacity: 0; transform: translateY(28px); }
html[data-intro] .wordmark { opacity: 1; transform: none; }
html[data-intro] .wordmark .char { transform: translateY(105%); }

html[data-intro="reveal"] .hero-media { transform: none; transition: transform 1.8s var(--ease-out) 0.15s; }
html[data-intro="reveal"] [data-rise] {
  opacity: 1; transform: none;
  transition: opacity 0.9s, transform 1.1s var(--ease-out);
  transition-delay: calc(0.55s + var(--d, 0) * 0.1s);
}
html[data-intro="reveal"] .wordmark .char {
  transform: none;
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(0.5s + var(--i) * 35ms);
}
.hero-top    { --d: 0; }
.hero-title  { --d: 1; }
.hero-side   { --d: 2; }
.hero-bottom { --d: 3; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: clamp(80px, 12vw, 160px) var(--gutter); }
.section-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1.2rem 2rem; margin-bottom: clamp(32px, 5vw, 64px); }
.section-head .eyebrow { grid-column: 1 / -1; }
.eyebrow { display: flex; align-items: center; gap: 0.8em; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.eyebrow span { color: var(--accent); }
.eyebrow b { font-weight: inherit; }
h2 { font-size: clamp(2.4rem, 6vw, 5.5rem); font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; }

/* scroll reveal — both directions: elements enter from where they come from and leave the way they go
   (main.js sets data-out="up" when an element has left through the top of the screen) */
html.js .reveal {
  opacity: 0; transform: translateY(48px);
  transition: opacity 0.8s ease, transform 1.1s var(--ease-out), clip-path 1.1s var(--ease-out);
  transition-delay: var(--rd, 0s);
}
html.js .reveal[data-out="up"] { transform: translateY(-48px); }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* headings unveil from a mask */
/* only headings inside a .reveal container: a heading masked by its own clip-path has no visible
   area, so the visibility observer would never report it as on screen (it stayed hidden) */
html.js .reveal h2 { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease-out) 0.1s, transform 1.1s var(--ease-out) 0.1s; transform: translateY(20%); }
html.js .reveal.is-in h2 { clip-path: inset(-10% -5% -20% -5%); transform: none; }

/* tiles rise with a slight zoom-out of the frame */
html.js .tile.reveal { transform: translateY(70px) scale(0.94); }
html.js .tile.reveal[data-out="up"] { transform: translateY(-70px) scale(0.94); }
html.js .tile.reveal.is-in { transform: none; }

/* ── Work ───────────────────────────────────────────── */
.filters { display: flex; gap: 0.3rem; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.filters button { padding: 0.55em 1.1em; border-radius: 999px; font-size: 0.85rem; color: var(--muted); transition: background 0.3s, color 0.3s; }
.filters button.is-active { background: var(--paper); color: var(--ink); }
.filters button:not(.is-active):hover { color: var(--accent); }

/* masonry: photos keep their own proportions */
.grid { columns: 3; column-gap: clamp(8px, 1.2vw, 16px); }
.tile {
  position: relative; display: block; width: 100%;
  margin-bottom: clamp(8px, 1.2vw, 16px);
  break-inside: avoid;
  overflow: hidden; border-radius: 4px; background: var(--ink-2); text-align: left;
}
/* --py is set by main.js while the tile is on screen: the photo drifts slower than the page (parallax) */
.tile img { width: 100%; height: auto; scale: 1.1; translate: 0 var(--py, 0%); transition: scale 1.2s var(--ease-out), filter 0.6s; }
.tile:hover img { scale: 1.15; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(14,14,13,0.75)); opacity: 0; transition: opacity 0.4s; }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile-info { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; display: grid; gap: 2px; opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.5s var(--ease-out); }
.tile:hover .tile-info, .tile:focus-visible .tile-info { opacity: 1; transform: none; }
.tile-info b { font-weight: 500; font-size: 1.05rem; letter-spacing: -0.02em; }
.tile-info small { font-family: var(--font-mono); font-size: 0.7rem; color: rgba(241,237,230,0.7); letter-spacing: 0.04em; }
.tile.is-hidden { display: none; }

/* spotlight: while one photo is hovered (or focused), all others fade to dimmed black & white */
@media (hover: hover) and (pointer: fine) {
  .grid .tile img { transition: scale 1.2s var(--ease-out), filter 0.5s ease; }
  .grid:has(.tile:hover) .tile:not(:hover) img,
  .grid:has(.tile:focus-visible) .tile:not(:focus-visible) img { filter: grayscale(1) brightness(0.6); }
}
.play {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(14,14,13,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(241,237,230,0.4);
  transition: background 0.3s;
}
.play::before { content: ""; position: absolute; left: 16px; top: 13px; border-left: 13px solid var(--paper); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.tile:hover .play { background: var(--accent); }
@media (hover: none) { .tile::after, .tile-info { opacity: 1; transform: none; } }

/* ── Journal ────────────────────────────────────────── */
.journal { padding-top: 0; }
.journal-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); counter-reset: story; }

/* story card: portrait photo, number, title over the image */
.story {
  position: relative; display: block; text-align: left;
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--ink-2);
  counter-increment: story; isolation: isolate;
}
.story-media { position: absolute; inset: 0; z-index: -1; }
.story-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease-out), filter 0.8s; filter: saturate(0.9); }
.story:hover .story-media img, .story:focus-visible .story-media img { transform: scale(1.06); filter: saturate(1.05); }
.story::before {
  content: counter(story, decimal-leading-zero);
  position: absolute; top: 16px; left: 18px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: rgba(241,237,230,0.85);
}
.story::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14,14,13,0.35) 0%, transparent 25%, transparent 45%, rgba(14,14,13,0.88) 100%); }
.story-body { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 0.55rem; padding: clamp(18px, 2vw, 26px); }
.story-meta { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: rgba(241,237,230,0.7); }
.story-title { font-size: clamp(1.35rem, 2vw, 1.85rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.08; color: var(--paper); text-wrap: balance; }
.story-link {
  font-size: 0.85rem; display: inline-flex; gap: 0.5em; align-items: center; color: var(--paper);
  max-height: 0; opacity: 0; transform: translateY(6px); overflow: hidden;
  transition: max-height 0.5s var(--ease-out), opacity 0.4s, transform 0.5s var(--ease-out);
}
.story:hover .story-link, .story:focus-visible .story-link { max-height: 2em; opacity: 1; transform: none; }
.story-link .arrow { transition: transform 0.35s var(--ease-out); }
.story:hover .story-link .arrow { transform: translateX(4px); }
@media (hover: none) { .story-link { max-height: 2em; opacity: 1; transform: none; } }
.journal-list .story:nth-child(3n+2) { --rd: 0.08s; }
.journal-list .story:nth-child(3n+3) { --rd: 0.16s; }

/* rail: three stories visible, the rest via the edge buttons (no scrollbar).
   With a mouse the rail is not a scroll area at all, so the page scroll never gets caught in it;
   touch screens keep native swiping (scrollbar hidden). */
.rail-wrap { position: relative; }
.journal-rail {
  display: grid; grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: calc((100% - 2 * clamp(16px, 3vw, 40px)) / 3);
  overflow-x: hidden; scroll-behavior: smooth;
  scrollbar-width: none;
}
.journal-rail::-webkit-scrollbar { display: none; }
@media (hover: none), (pointer: coarse) {
  .journal-rail { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .journal-rail .story { scroll-snap-align: start; }
}

/* transparent buttons on the left and right edge */
.rail-edge {
  position: absolute; top: 50%; z-index: 2;
  width: 56px; height: 56px; margin-top: -28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.15rem; color: var(--paper);
  background: rgba(14,14,13,0.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(241,237,230,0.35);
  transition: opacity 0.35s, background 0.3s, color 0.3s, transform 0.4s var(--ease-out);
}
.rail-prev { left: 12px; }
.rail-next { right: 12px; }
.rail-edge:hover { background: var(--paper); color: var(--ink); }
.rail-prev:hover { transform: translateX(-3px); }
.rail-next:hover { transform: translateX(3px); }
.rail-edge:disabled { opacity: 0; pointer-events: none; }

/* links to the project galleries under the work grid */
.projects { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: clamp(24px, 4vw, 48px); }
.projects-label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: 0.6rem; }
main.page .grid { margin-top: clamp(16px, 3vw, 32px); }

/* ── Services ───────────────────────────────────────── */
.service-list { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }
.service { border-top: 1px solid var(--line); padding-top: 1.4rem; display: grid; gap: 1rem; align-content: start; }
.service .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.service h3 { font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.service p { color: rgba(241,237,230,0.75); max-width: 34ch; }
.service-text { display: grid; gap: 0.8em; }
.service-text ul { list-style: disc; padding-left: 1.2em; color: rgba(241,237,230,0.75); }
.service-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.service-links li { font-size: 0.8rem; padding: 0.35em 0.8em; border: 1px solid var(--line); border-radius: 999px; color: rgba(241,237,230,0.8); }
.services .service:nth-child(2) { transition-delay: 0.08s; }
.services .service:nth-child(3) { transition-delay: 0.16s; }
.services .service:nth-child(4) { transition-delay: 0.24s; }
.service-sub { font-family: var(--font-serif); font-style: italic; font-size: 1.2rem; line-height: 1.3; color: var(--paper) !important; }
.service-links li a { color: var(--paper); transition: color 0.2s; }
.service-links li:has(a):hover { border-color: var(--paper); }
.service p strong { color: var(--paper); font-weight: 500; }
.about.no-media { grid-template-columns: minmax(0, 1fr); }
.about.no-media .about-body { max-width: 900px; }

/* ── About ──────────────────────────────────────────── */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; background: var(--ink-2); }
/* portrait never grows beyond ~400 × 500 px, however wide the screen */
.about-media { aspect-ratio: 4 / 5; width: 100%; max-width: 400px; max-height: 500px; justify-self: center; overflow: hidden; border-radius: 4px; }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-body { display: grid; gap: 2.4rem; }
.about-lead { font-family: var(--font-serif); font-size: clamp(1.7rem, 3.2vw, 2.8rem); line-height: 1.15; letter-spacing: -0.01em; }
.about-text { color: rgba(241,237,230,0.75); max-width: 56ch; display: grid; gap: 1em; }
.about-based { display: flex; align-items: center; gap: 0.7em; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.about-based .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.focus { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.focus li { display: grid; gap: 0.2rem; }
.focus b { font-weight: 500; font-size: 1.1rem; letter-spacing: -0.02em; }
.focus small { font-size: 0.8rem; color: var(--muted); }

/* ── Contact ────────────────────────────────────────── */
.contact { display: grid; gap: 2rem; padding-bottom: clamp(64px, 8vw, 120px); }
.contact-main { display: grid; gap: 2rem; align-content: start; }
.contact-title { font-size: clamp(3rem, 11vw, 11rem); line-height: 0.9; letter-spacing: -0.055em; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2.4rem; }
.contact-row p { color: var(--muted); max-width: 40ch; flex-basis: 100%; }

/* with form: text left, form right */
.contact.has-form { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact.has-form .contact-title { font-size: clamp(3rem, 7.2vw, 7.5rem); }
.contact-form {
  padding: clamp(24px, 3vw, 40px); border-radius: 12px;
  background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.contact-form .wpcf7 form p { margin: 0; }
.contact-form .wpcf7 form > p + p, .contact-form .wpcf7 form > div + p { margin-top: 1.1rem; }
.contact-form .wpcf7 textarea { min-height: 150px; }
.contact-phone { font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: 0.02em; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color 0.3s; }
.contact-phone:hover { border-color: var(--paper); }

/* ==========================================================================
   Content pages (imprint, privacy, blog posts)
   ========================================================================== */

/* main.page, not .page: WordPress also puts class="page" on <body> when the front page is a static page */
main.page { padding: clamp(120px, 14vw, 180px) var(--gutter) clamp(64px, 8vw, 120px); }
.page-head { display: grid; gap: 1.2rem; margin-bottom: clamp(32px, 5vw, 64px); max-width: 1100px; }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 6rem); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; }
.page-head .lead { color: var(--muted); max-width: 60ch; }
.page-note { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }
.page-note:empty { display: none; }

/* ── Story (post page and pop-out window share this markup) ── */
.story-page { padding-top: clamp(84px, 9vw, 110px); }
.story-article { --pad: clamp(20px, 5vw, 64px); }
.story-hero { position: relative; display: grid; align-items: end; min-height: clamp(220px, 30vh, 320px); padding: var(--pad); overflow: hidden; border-radius: 10px; background: var(--ink-2); isolation: isolate; }
.story-hero.has-cover { min-height: min(72vh, 680px); }
.story-hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; animation: storyCover 1.6s var(--ease-out) both; }
@keyframes storyCover { from { transform: scale(1.08); } }
.story-hero.has-cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14,14,13,0.25), transparent 35%, rgba(14,14,13,0.85)); }
.story-hero-text { display: grid; gap: 0.9rem; max-width: 900px; animation: storyText 1s var(--ease-out) 0.15s both; }
@keyframes storyText { from { opacity: 0; transform: translateY(24px); } }
.story-hero .story-meta { font-size: 0.75rem; color: rgba(241,237,230,0.8); }
.story-hero h1 { font-size: clamp(2.4rem, 6vw, 5.2rem); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; text-wrap: balance; }
.story-article .story-content { max-width: none; padding: clamp(36px, 5vw, 64px) var(--pad) 0; font-size: 1.1rem; }
.story-content > * { max-width: 42rem; margin-inline: auto; }
.story-content > p:first-child { font-size: 1.25rem; color: var(--paper); }
/* photos: wide, two-column masonry; overrides WordPress' gallery layout */
.story-content > .wp-block-gallery, .story-content > .gallery, .story-content > figure, .story-content > .wp-block-image { max-width: 100%; width: 100%; }
.story-content .wp-block-gallery, .story-content .gallery { display: block !important; columns: 2; column-gap: 10px; margin-top: 2.4em; }
.story-content .wp-block-gallery > figure, .story-content .gallery > .gallery-item { display: block !important; width: 100% !important; margin: 0 0 10px !important; break-inside: avoid; }
.story-content .wp-block-gallery img, .story-content .gallery img { width: 100% !important; height: auto !important; aspect-ratio: auto !important; object-fit: cover; border-radius: 4px; }
/* images placed in the text (classic editor, often alignleft/alignright thumbnails): full column width, no floats */
.story-content p > img, .story-content p > a > img, .story-content > img, .story-content .wp-caption img, .story-content .wp-block-image img {
  display: block; float: none !important; width: 100%; height: auto; max-height: 82vh; object-fit: contain;
  margin: 2em auto; border-radius: 4px;
}
.story-content .alignleft, .story-content .alignright { float: none !important; margin-inline: auto !important; }
.story-content .wp-caption { width: auto !important; max-width: 100%; }
.story-content p:has(> img:only-child), .story-content p:has(> a:only-child > img) { margin-block: 0; }
/* remaining photos of the story */
.story-content > .story-photos { max-width: 100%; columns: 2; column-gap: 10px; margin-top: 2.6em; }
.story-photos a { display: block; margin-bottom: 10px; break-inside: avoid; border-radius: 4px; overflow: hidden; }
.story-photos img { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease-out); }
.story-photos a:hover img { transform: scale(1.03); }
.story-nav { padding: 0 var(--pad) var(--pad); max-width: none; }

/* pop-out window */
.story-modal {
  width: min(1180px, calc(100vw - 32px)); max-width: none;
  height: calc(100dvh - 32px); max-height: none;
  margin: auto; padding: 0; border: 0; border-radius: 14px;
  background: var(--ink); color: var(--paper);
  box-shadow: 0 40px 120px rgba(0,0,0,0.6), 0 0 0 1px var(--line);
  overflow: hidden;
}
.story-modal[open] { display: block; animation: storyIn 0.7s var(--ease-out); }
.story-modal.is-closing { animation: storyOut 0.35s ease forwards; }
.story-modal::backdrop { background: rgba(8,8,7,0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.story-modal[open]::backdrop { animation: fade 0.5s ease; }
@keyframes storyIn { from { opacity: 0; transform: translateY(40px) scale(0.97); } }
@keyframes storyOut { to { opacity: 0; transform: translateY(24px) scale(0.98); } }
.story-modal-body { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 12px; scrollbar-width: thin; scrollbar-color: rgba(241,237,230,0.25) transparent; }
.story-modal-body:focus { outline: none; }
.story-modal .story-hero.has-cover { min-height: min(64vh, 620px); }
.story-close {
  position: absolute; top: 22px; right: 22px; z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  background: rgba(14,14,13,0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(241,237,230,0.3); transition: background 0.3s, color 0.3s, transform 0.4s var(--ease-out);
}
.story-close:hover { background: var(--paper); color: var(--ink); transform: rotate(90deg); }
.story-loading { position: absolute; inset: 0; display: none; place-items: center; background: var(--ink); }
.story-loading span { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.story-modal.is-loading .story-loading { display: grid; }
@keyframes spin { to { transform: rotate(360deg); } }
html.modal-open { overflow: hidden; }

/* project galleries and pages in the pop-out window */
.story-modal .popup-article { padding: clamp(28px, 4vw, 56px); padding-top: clamp(44px, 5vw, 72px); animation: storyText 0.8s var(--ease-out) both; }
.story-modal .popup-article .page-head { margin-bottom: clamp(20px, 3vw, 36px); padding-right: 56px; }
.story-modal .popup-article .page-head .eyebrow { display: none; } /* "back to the homepage": the × does that here */
.story-modal .popup-article .page-head h1 { font-size: clamp(2.4rem, 5.5vw, 4.6rem); }
.story-modal .popup-article .grid { margin-top: 0; }

.entry-content { max-width: 72ch; color: rgba(241,237,230,0.82); font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; color: var(--paper); margin-top: 2.2em; }
.entry-content h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; color: var(--paper); margin-top: 1.8em; }
.entry-content h4 { font-size: 1.05rem; font-weight: 600; color: var(--paper); margin-top: 1.5em; }
.entry-content a { color: var(--paper); text-decoration: underline; text-decoration-color: rgba(241,237,230,0.35); text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content strong { color: var(--paper); font-weight: 600; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li + li { margin-top: 0.4em; }
.entry-content blockquote { border-left: 2px solid var(--accent); padding-left: 1.2em; color: var(--paper); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.entry-content td, .entry-content th { border: 1px solid var(--line); padding: 0.6em 0.8em; vertical-align: top; text-align: left; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); }
.entry-content figure, .entry-content .wp-block-image { margin-inline: 0; }
.entry-content figcaption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 0.6em; }
.entry-content img { height: auto; border-radius: 4px; }
.entry-content img.is-zoomable { cursor: zoom-in; }
/* photos may break out wider than the text column; gallery layout itself comes from WordPress core */
.entry-content .wp-block-gallery, .entry-content .alignwide, .entry-content .alignfull { max-width: min(1200px, calc(100vw - 2 * var(--gutter))); width: min(1200px, calc(100vw - 2 * var(--gutter))); }
.entry-content .wp-block-gallery img { border-radius: 2px; }
.entry-content .alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.entry-content .aligncenter { margin-inline: auto; }
.journal-archive { row-gap: clamp(40px, 5vw, 64px); }

/* contact page + Contact Form 7 */
.contact-columns { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-aside { display: grid; gap: 1.2rem; justify-items: start; color: var(--muted); position: sticky; top: 110px; }
.contact-page .page-head h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.wpcf7 form { display: grid; gap: 1.1rem; }
.wpcf7 label { display: grid; gap: 0.45rem; font-size: 0.85rem; color: var(--muted); }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 input[type="url"], .wpcf7 select, .wpcf7 textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--paper);
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.85em 1em; transition: border-color 0.3s;
}
.wpcf7 textarea { min-height: 180px; resize: vertical; }
.wpcf7 input:focus, .wpcf7 textarea:focus, .wpcf7 select:focus { outline: none; border-color: rgba(241,237,230,0.6); }
.wpcf7 input[type="submit"] {
  justify-self: start; font: inherit; font-weight: 500; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 0; border-radius: 999px; padding: 0.95em 1.6em;
  transition: background 0.3s, color 0.3s;
}
.wpcf7 input[type="submit"]:hover { background: var(--accent); color: #fff; }
.wpcf7-not-valid-tip { color: var(--accent); font-size: 0.8rem; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 0.8em 1em; border-radius: 6px; border-color: var(--line); color: var(--paper); }
.wpcf7-spinner { margin: 0 0 0 12px; }
.entry-content .wpcf7 p { margin: 0; }

.post-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: clamp(48px, 6vw, 80px); padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
.post-nav a { display: grid; gap: 0.2rem; max-width: 45%; }
.post-nav small { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.06em; }
.post-nav a:last-child { text-align: right; margin-left: auto; }

/* ==========================================================================
   Logo
   ========================================================================== */

/* in the opening sequence: fades and settles in above the name, leaves with the shutters */
.intro-logo { width: clamp(90px, 11vw, 150px); height: auto; opacity: 0; transform: scale(0.85); filter: blur(6px); transition: opacity 0.9s ease, transform 1.2s var(--ease-out), filter 1s ease; margin-bottom: 0.4rem; }
html[data-intro="loading"] .intro-logo { opacity: 1; transform: none; filter: none; }
html[data-intro="reveal"] .intro-logo { opacity: 0; transform: scale(1.08); transition: opacity 0.4s ease, transform 0.6s var(--ease-io); }

/* centred in the header */
.header-logo { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: block; line-height: 0; transition: opacity 0.3s, scale 0.4s var(--ease-out); }
.header-logo img { height: 46px; width: auto; }
.header-logo:hover { scale: 1.06; }
/* small mark before the name; takes over when the centre would collide with the navigation */
.logo { display: inline-flex; align-items: center; gap: 0.7rem; }
.logo-mark { display: none; height: 34px; width: auto; }
@media (max-width: 1400px) {
  .header-logo { display: none; }
  .logo-mark { display: block; }
}

/* ==========================================================================
   Contact form (theme)
   ========================================================================== */

.sp-form { display: grid; gap: 1.1rem; }
.sp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.sp-field { display: grid; gap: 0.45rem; font-size: 0.85rem; color: var(--muted); }
.sp-field input, .sp-field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--paper);
  background: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.85em 1em; transition: border-color 0.3s, box-shadow 0.3s;
}
.sp-field textarea { min-height: 150px; resize: vertical; }
.sp-field input:focus, .sp-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.sp-captcha b { color: var(--paper); font-weight: 600; letter-spacing: 0.04em; }
.sp-form-check { align-items: end; }
.sp-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.82rem; line-height: 1.45; color: var(--muted); cursor: pointer; }
.sp-consent input { margin-top: 0.2em; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.sp-consent a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.sp-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.4rem; }
.sp-form-foot .btn { border: 0; cursor: pointer; }
.sp-form-foot .btn:disabled { opacity: 0.6; cursor: wait; }
.sp-form-status { font-size: 0.9rem; color: var(--muted); }
.sp-form-status.is-ok { color: #7fd99a; }
.sp-form-status.is-error { color: var(--accent); }
.has-error input, .has-error textarea { border-color: var(--accent); }
.sp-err { color: var(--accent); font-size: 0.78rem; }
.sp-consent .sp-err { flex-basis: 100%; }
.sp-consent:has(.sp-err) { flex-wrap: wrap; }
.sp-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sp-form.is-sent .sp-field, .sp-form.is-sent .sp-form-row { opacity: 0.45; }
@media (max-width: 640px) { .sp-form-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   Image protection (Design & Schutz → Bilder schützen)
   ========================================================================== */

body.protect-images img, body.protect-images video { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; user-select: none; }

/* ==========================================================================
   Accent colour on hover (Design & Schutz → Akzentfarbe)
   ========================================================================== */

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline-color: var(--accent); }
.lang :not(.is-active):hover { color: var(--accent); }
.logo { transition: color 0.3s; }
.logo:hover { color: var(--accent); }
.eyebrow b { transition: color 0.3s; }
/* photo tiles: a thin accent line grows along the bottom, caption label turns accent */
.tile::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 2; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease-out); }
.tile:hover::before, .tile:focus-visible::before { transform: scaleX(1); }
.tile:hover .tile-info small { color: var(--accent); }
/* journal cards */
.story::before { transition: color 0.3s; }
.story:hover::before, .story:focus-visible::before { color: var(--accent); }
.story:hover .story-link .arrow { color: var(--accent); }
/* service cards */
.service { transition: border-color 0.5s; }
.service:hover { border-top-color: var(--accent); }
.service-links li:has(a):hover { border-color: var(--accent); }
.service-links li a:hover { color: var(--accent); }
/* buttons and round controls */
.btn-ghost:hover { background: var(--accent); color: #fff; box-shadow: none; }
.rail-edge:hover, .story-close:hover, .lightbox-nav:hover { background: var(--accent); color: #fff; }
.contact-phone:hover { border-color: var(--accent); color: var(--accent); }
.entry-content a:hover { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--muted);
}
.site-footer nav { display: flex; gap: 1.4rem; }
.site-footer a:hover { color: var(--accent); }

/* ── Lightbox ───────────────────────────────────────── */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0a0a09; color: var(--paper); }
.lightbox-stage:focus { outline: none; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; animation: fade 0.35s ease; }
.lightbox-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  display: flex; align-items: center; gap: 1.2rem;
  padding: 10px var(--gutter);
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted);
}
.lightbox-title { margin-right: auto; color: var(--paper); }
.lightbox-count { font-variant-numeric: tabular-nums; }
.lightbox-stage { width: min(88vw, 1600px); height: 82vh; display: grid; place-items: center; }
.lightbox-stage img, .lightbox-stage video { max-width: 100%; max-height: 82vh; object-fit: contain; animation: fade 0.4s ease; }
.lightbox-close { font-size: 2rem; line-height: 1; width: 44px; height: 44px; color: var(--paper); }
.lightbox-nav {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 1.2rem; color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(241,237,230,0.3);
  transition: background 0.3s, color 0.3s;
}
.lightbox-nav:hover { background: var(--paper); color: var(--ink); }
.lightbox-nav[data-dir="-1"] { left: var(--gutter); }
.lightbox-nav[data-dir="1"] { right: var(--gutter); }
.lightbox.is-single .lightbox-nav, .lightbox.is-single .lightbox-count { display: none; }
.lightbox-text { max-width: 62ch; max-height: 76vh; overflow-y: auto; padding: 0 8px; display: grid; gap: 1.1em; animation: fade 0.4s ease; color: rgba(241,237,230,0.82); font-size: 1.05rem; line-height: 1.65; }
.lightbox-text h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.01em; line-height: 1.02; color: var(--paper); margin-bottom: 0.2em; }
.lightbox-text-meta { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--accent); }
@keyframes fade { from { opacity: 0; } }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { gap: 1.2rem; }
}

@media (max-width: 900px) {
  .nav, .site-header .btn-small { display: none; }
  .site-header { gap: 0.8rem; }
  .menu-toggle { display: block; }
  .hero-content { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-side { justify-self: start; }
  .about { grid-template-columns: 1fr; }
  .about-media { max-width: 420px; }
  .grid { columns: 2; }
  .focus { grid-template-columns: 1fr 1fr; }
  .journal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-rail { grid-template-columns: none; grid-auto-columns: calc((100% - clamp(16px, 3vw, 40px)) / 2); }
  .contact-columns { grid-template-columns: 1fr; }
  .contact.has-form { grid-template-columns: minmax(0, 1fr); }
  .contact-aside { position: static; }
}

@media (max-width: 640px) {
  .finder { display: none; }
  .hero { padding-top: 72px; }
  .hero-top, .hero-content, .hero-bottom { padding-left: 0; padding-right: 0; }
  .hero-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .section-head { grid-template-columns: 1fr; }
  .filters { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .filters button { white-space: nowrap; }
  .journal-list { grid-template-columns: 1fr; }
  .journal-rail { grid-template-columns: none; grid-auto-columns: 84%; }
  .story-modal { width: 100vw; height: 100dvh; border-radius: 0; }
  .story-modal-body { padding: 0; }
  .story-modal .story-hero, .story-page .story-hero { border-radius: 0; }
  .story-content .wp-block-gallery, .story-content .gallery, .story-content > .story-photos { columns: 1; }
  .rail-edge { width: 44px; height: 44px; margin-top: -22px; }
  .service-list { grid-template-columns: 1fr; }
  .lightbox-stage { width: 100vw; }
  .lightbox-nav { top: auto; bottom: 20px; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  /* `transition: none` rather than a tiny duration: a 0.01ms transition on `all` still defers font-size, which breaks the wordmark fit */
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
