/* Layout: a quiet "gallery wall" — slim header, filter row, masonry columns of photos, frame numbers like a contact sheet. */
:root {
  --wall: #eef0f1;      /* page background, a cool gallery-wall grey */
  --ink: #16191c;       /* main text */
  --muted: #646b72;     /* secondary text */
  --line: #d5d9dc;      /* thin rules and borders */
  --accent: #b5532f;    /* the one warm colour: darkroom safelight */
  --scrim: rgba(12, 14, 16, 0.94); /* lightbox background */
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #121416; --ink: #e9ecee; --muted: #9aa2a9; --line: #2a2e32; --accent: #e07a52;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #121416; --ink: #e9ecee; --muted: #9aa2a9; --line: #2a2e32; --accent: #e07a52;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--wall);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header */
.site-head { padding-block: 40px 20px; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; }
.brand { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 6vw, 3.6rem); letter-spacing: -0.03em; line-height: 0.95; }
.brand span { color: var(--accent); }
.tagline { margin: 8px 0 0; color: var(--muted); font-size: 1rem; }
.nav { display: flex; gap: 20px; font-size: 0.9rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 16px; border-top: 1px solid var(--line); margin-bottom: 8px; align-items: center; }
.filters .label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.chip {
  font: inherit; font-size: 0.85rem; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 5px 14px; border-radius: 999px;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--wall); border-color: var(--ink); }
.count { margin-left: auto; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Gallery: CSS columns give a simple masonry that keeps each photo's shape */
.gallery:empty { display: none; }
.gallery { columns: 3 320px; column-gap: 16px; padding-block: 8px 48px; }
.frame { break-inside: avoid; margin: 0 0 16px; }
.frame button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.frame button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.frame img { width: 100%; height: auto; background: var(--line); transition: opacity 0.25s ease; }
.frame button:hover img { opacity: 0.88; }
.frame figcaption { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; font-size: 0.85rem; }
.frame .t { min-width: 0; }
.frame .n { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.frame .meta { display: block; color: var(--muted); font-size: 0.78rem; }

/* About */
.about { border-top: 1px solid var(--line); padding-block: 40px 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 48px; }
.about h2 { margin: 0; font-family: var(--display); font-size: 1.6rem; letter-spacing: -0.02em; }
.about p { margin: 0 0 12px; max-width: 62ch; }
.about .contact { color: var(--muted); font-size: 0.95rem; }
.about .contact a { color: var(--ink); }
@media (max-width: 700px) { .about { grid-template-columns: minmax(0, 1fr); } }

.site-foot { border-top: 1px solid var(--line); padding-block: 20px 32px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: var(--scrim); color: #eef0f1; display: grid; grid-template-rows: 1fr auto; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lightbox[hidden] { display: none; }
.lightbox .stage { min-height: 0; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.lightbox .cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-top: 14px; max-width: 1100px; width: 100%; margin: 0 auto; }
.lightbox .cap .t { font-family: var(--display); font-size: 1.15rem; }
.lightbox .cap .meta { font-family: var(--mono); font-size: 0.75rem; color: #a7aeb4; }
.lb-btn { position: absolute; font: inherit; font-size: 1.6rem; line-height: 1; color: #eef0f1; background: rgba(255,255,255,0.08); border: 0; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-close { top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: max(16px, env(safe-area-inset-left, 0px)); }
.lb-next { right: max(16px, env(safe-area-inset-right, 0px)); }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: none; } .lightbox img { max-height: calc(100vh - 200px); } .lightbox .cap { padding-bottom: 56px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Page links */
.brand-link { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Home page */
.site-head--slim { padding-block: 20px; align-items: center; }
.brand--small { font-size: 1.5rem; letter-spacing: -0.02em; }

.hero { position: relative; height: min(78vh, 760px); min-height: 420px; overflow: hidden; background: var(--line); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,10,12,0.72) 0%, rgba(8,10,12,0.15) 45%, rgba(8,10,12,0) 70%); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; color: #f3f4f5; padding-block: 0 40px; }
.brand--hero { font-size: clamp(3rem, 11vw, 8rem); color: #f3f4f5; }
.hero-tag { margin: 12px 0 22px; font-size: clamp(1rem, 2.2vw, 1.25rem); color: #d9dde0; max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.hero-cap { font-family: var(--mono); font-size: 0.75rem; color: #c3c8cc; }
.button { display: inline-block; text-decoration: none; background: var(--ink); color: var(--wall); padding: 11px 24px; border-radius: 999px; font-weight: 500; }
.button--light { background: #f3f4f5; color: #16191c; }
.button:hover { background: var(--accent); color: #fff; }

.block { padding-block: 48px 8px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.block-head h2 { margin: 0; font-family: var(--display); font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.02em; }
.more { font-size: 0.9rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.more:hover { color: var(--accent); }

.latest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.tile img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; background: var(--line); transition: opacity .25s ease; }
.tile:hover img { opacity: .85; }
.tile-cap { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.tile-cap .n { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }

.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.coll { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; text-decoration: none; color: #f3f4f5; background: var(--line); }
.coll img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.coll:hover img { transform: scale(1.04); }
.coll::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,10,12,.65), rgba(8,10,12,0) 60%); }
.coll-label { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.coll-label strong { font-family: var(--display); font-size: 1.3rem; font-weight: 700; }
.coll-label span { font-family: var(--mono); font-size: 0.72rem; color: #d9dde0; }

.about { margin-top: 48px; }

@media (max-width: 800px) { .latest { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .nav { gap: 14px; } .hero { height: 70vh; } }

/* Before any photos are added */
.soon { display: none; }
.no-photos .needs-photos { display: none; }
.no-photos .soon { display: inline-block; margin: 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #f3f4f5; border: 1px solid rgba(243,244,245,0.4); padding: 8px 14px; border-radius: 999px; }
.no-photos .hero { height: auto; min-height: 0; background: #16191c; }
.no-photos .hero img, .no-photos .hero::after { display: none; }
.no-photos .hero-text { position: static; padding-block: clamp(96px, 18vw, 200px) clamp(56px, 8vw, 96px); }
.no-photos .about { margin-top: 0; border-top: 0; }
.empty { border-top: 1px solid var(--line); padding-block: 56px 96px; }
.empty > * { max-width: 46ch; }
.empty-n { margin: 0 0 12px; font-family: var(--mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.06em; }
.empty h2 { margin: 0 0 10px; font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.empty p:last-child { margin: 0; color: var(--muted); }
