@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #EFE9DF;
  --ink: #111;
  --muted: #5a554d;
  --placeholder: #dcd4c6;
  --matte: 0px;
  --tilt-max: 1;
  --gutter: 28px;
  --font: "Familjen Grotesk",-apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.65, 0, .35, 1);
}

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

html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: inherit; }

/* Header */
.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 26px var(--gutter) 18px;
}
.site-name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
}
.site-header nav ul {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header nav a {
  font-size: 14px;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { border-bottom-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 48px var(--gutter) 28px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer small { font-size: inherit; }
.site-footer a { text-decoration: none; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.site-footer a:hover { color: var(--ink); border-bottom-color: currentColor; }

/* Text pages */
.prose { max-width: 38rem; padding: 24px var(--gutter) 80px; }
.prose h1 { font-size: 15px; font-weight: 500; letter-spacing: .01em; margin: 0 0 24px; }
.prose p { margin: 0 0 1em; }
.notice { padding: 0 var(--gutter); }

/* Filters */
.filters {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: clamp(40px, 8vh, 96px) var(--gutter) 0;
  min-height: 26px;
}
.filters[hidden] { display: none; }
.filter {
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  padding: 4px 9px;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(17, 17, 17, .28);
  border-radius: 5px;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Desk */
.desk {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  transition: height .8s var(--ease);
}
.desk:empty { min-height: 40vh; }

.print {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  margin: 0;
  padding: var(--matte);
  background: var(--placeholder);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.print img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--placeholder);
  opacity: 0;
  transition: opacity .35s;
  -webkit-user-drag: none;
  pointer-events: none;
}
.print img.is-loaded { opacity: 1; }
.print.is-dragging { cursor: grabbing; }
.print.is-leaving { pointer-events: none; }
.print.is-away { visibility: hidden; pointer-events: none; }

@media (hover: none) and (pointer: coarse) {
  .print { touch-action: pan-y; cursor: pointer; }
}

/* Phone layout: calm single column, no dragging */
.desk[data-mode="flow"] {
  height: auto !important;
  padding: 12px 24px 0;
}
.desk[data-mode="flow"] .print {
  position: relative;
  width: calc(min(100%, 500px) * var(--scale, 1));
  margin: 0 auto 44px;
  transform: translateX(var(--dx, 0)) rotate(var(--rot, 0deg));
  touch-action: auto;
  cursor: pointer;
  will-change: auto;
}
.desk[data-mode="flow"] .print.is-away { display: none; }

@media (max-width: 767px) {
  :root { --gutter: 20px; }
  .site-header { padding-top: 20px; }
  .site-header nav ul { gap: 18px; }
  .filters { padding-top: 32px; padding-bottom: 6px; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity .4s ease;
}
.lightbox.is-open::before { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox:not(.is-open) { pointer-events: none; }
.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 88px;
  touch-action: none; /* pinch, pan and swipe are handled in lightbox.js */
}
.lb-fig { display: none; margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lb-fig.is-current { display: block; }
.lb-fig img {
  display: block;
  margin: 0 auto;
  background: var(--placeholder);
  outline: 0 solid #fff;
  will-change: transform;
}
.lb-fig figcaption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.5em;
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox.is-open .lb-fig figcaption { opacity: 1; transition-duration: .35s; transition-delay: .3s; }
.lb-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox.is-open .lb-btn { opacity: 1; transition-duration: .35s; transition-delay: .25s; }
.lb-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.lb-close { top: 16px; right: 20px; }
.lb-prev { left: 20px; top: 50%; margin-top: -24px; }
.lb-next { right: 20px; top: 50%; margin-top: -24px; }
.lightbox.is-single .lb-prev, .lightbox.is-single .lb-next { display: none; }

@media (max-width: 767px) {
  .lb-stage { padding: 64px 16px 48px; }
  .lb-prev, .lb-next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .desk { transition: none; }
  .lightbox::before, .lb-btn, .lb-fig figcaption { transition-duration: .01s !important; transition-delay: 0s !important; }
  .print img { transition: none; }
}
