/* kasperausra — bright, minimal gallery */

:root {
  --bg: #faf8f4;        /* warm paper */
  --bg-header: #f3efe8; /* a shade deeper than the page */
  --ink: #141414;
  --muted: #7f7a71;
  --line: #e6e1d8;
  --gap: 16px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; height: auto; }

/* ---------- Header ---------- */

/* One row: wordmark left, contact icons right, and the menu pinned to the
   true centre of the page — so it lines up with the gallery, which is
   centred too, regardless of how wide the wordmark is. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 30px;
  background: rgba(243, 239, 232, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
}

.wordmark-name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  line-height: 1.1;
  color: #000;
}

.wordmark-tag {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.wordmark .dot { color: var(--muted); }

.site-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  gap: 26px;
}

.site-nav a {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--ink); }

/* Long label by default; the short one only appears on narrow screens. */
.nav-short { display: none; }

.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meta-icon {
  display: flex;
  color: var(--muted);
  transition: color 0.15s ease;
}

.meta-icon:hover { color: var(--ink); }

.lang-toggle {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 8px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-toggle:hover { color: var(--ink); border-color: var(--ink); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px 2px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--ink);
}

/* ---------- Gallery grid ---------- */

.site-main { min-height: 62vh; }

/* Base layout (also the no-JavaScript fallback) */
.grid {
  columns: 3 340px;
  column-gap: var(--gap);
  max-width: 1560px;
  margin: 0 auto;
  padding: 10px var(--gap) 30px;
}

.ph {
  margin: 0 0 var(--gap);
  break-inside: avoid;
}

/* Row-first masonry: photos fill left to right, so the newest and
   highlighted work sits across the top row rather than down one column. */
.grid.masonry {
  columns: auto;
  column-gap: normal;
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

.grid-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.grid.masonry .ph { margin: 0; }

.ph.is-hidden { display: none; }

/* Not loaded into the page yet — appears while scrolling */
.ph.is-beyond { display: none; }

.grid-sentinel {
  height: 1px;
  margin-top: -1px;
}


.ph a {
  position: relative;
  display: block;
  background: var(--bg);
}

/* Photo name, centred over the image, visible on hover only */
.ph-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.ph a:hover .ph-title { opacity: 1; }

.ph img {
  width: 100%;
  transition: opacity 0.25s ease;
}

/* Hover: white shows through, marking the selected photo */
.ph a:hover img { opacity: 0.55; }

/* Fade in as you scroll (enabled by JS via body.js-fade) */
body.js-fade .ph {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.25s ease, transform 1.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.js-fade .ph.in-view {
  opacity: 1;
  transform: none;
}

.page-heading {
  max-width: 1560px;
  margin: 26px auto 22px;
  padding: 0 var(--gap);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Empty state / 404 ---------- */

.empty-state {
  text-align: center;
  padding: 16vh 24px;
}

.empty-state h1 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  margin: 0 0 10px;
}

.empty-state p { color: var(--muted); margin: 0; }

/* ---------- Contact / About ---------- */

.contact {
  max-width: 1700px;
  margin: 0 auto;
  padding: 20px var(--gap) 60px;
}

.contact .page-heading { margin-left: 0; padding-left: 0; }

.about {
  display: flex;
  gap: 44px;
  align-items: flex-start;
}

/* Roughly half the window, whatever the screen size. */
.about-photo {
  flex: 0 0 auto;
  width: min(48vw, 980px);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #efeae1;
  color: #c6bfb2;
}

/* The About page borrows the menu's light, letterspaced voice. */
.about-text {
  flex: 1 1 0;
  min-width: 0;
}

.about-name {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}

@media (max-width: 900px) {
  .about { flex-direction: column; gap: 26px; }
  .about-photo { width: min(620px, 92vw); }
}

.contact-lead {
  font-size: 15px;
  line-height: 2.05;
  font-weight: 200;
  letter-spacing: 0.07em;
  color: #3a3a3a;
  margin: 0 0 32px;
  max-width: 46ch;
}

.contact-lead p { margin: 0 0 17px; }

.contact-lead p:last-child { margin-bottom: 0; }

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

.contact-list li { margin: 11px 0; }

.contact-list a {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.contact-list a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 40px 32px 38px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 30px;
  margin-bottom: 18px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-links a:hover { color: var(--ink); }

.footer-links svg { flex: none; }

.site-footer p {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Landing page: the footer stays in view, mirroring the top bar. */
body.landing { padding-bottom: 62px; }

body.landing .site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  margin-top: 0;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 28px;
  background: rgba(243, 239, 232, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

body.landing .footer-links { margin-bottom: 0; gap: 10px 24px; }

/* Phones: one compact row, so the pinned bar never eats the gallery. */
@media (max-width: 620px) {
  body.landing { padding-bottom: 52px; }

  body.landing .site-footer { padding: 10px 12px; gap: 0 18px; }

  body.landing .site-footer p { display: none; }

  body.landing .footer-links a {
    font-size: 10.5px;
    letter-spacing: 0.06em;
    gap: 6px;
  }
}

.site-footer a:hover { color: var(--ink); }

/* ---------- Lightbox: zoom in over a soft paper fade ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.975);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.open { opacity: 1; }

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.12);
  transform: scale(0.94);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lightbox.open img { transform: scale(1); }

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  line-height: 1;
  padding: 14px;
}

.lb-close { top: 16px; right: 20px; font-size: 30px; font-weight: 300; }

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 42px;
  font-weight: 200;
  color: var(--muted);
  transition: color 0.15s ease;
}

.lb-prev:hover, .lb-next:hover { color: var(--ink); }

.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

body.lightbox-open { overflow: hidden; }

/* ---------- Reduced motion ---------- */

/* Narrower windows: the wordmark gives way so the centred menu keeps its
   size and never runs into it. */
@media (max-width: 1400px) {
  .site-header { padding: 16px 24px; }

  .wordmark-name { font-size: 24px; letter-spacing: 0.16em; }

  .wordmark-tag { font-size: 10px; letter-spacing: 0.14em; }
}


@media (prefers-reduced-motion: reduce) {
  body.js-fade .ph,
  .ph img,
  .lightbox,
  .lightbox img {
    transition: none;
  }
  body.js-fade .ph {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 1200px) {
  /* No hidden menu: the wordmark and icons share the top line and the tabs
     sit on their own row underneath, always visible and centred. */
  .site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 11px;
  }

  .wordmark-name { font-size: 26px; }

  .nav-toggle { display: none; }

  .site-nav {
    order: 3;
    width: 100%;
    position: static;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px 20px;
    margin-top: 11px;
  }

  .site-nav a { font-size: 14px; letter-spacing: 0.13em; }

  .lb-prev, .lb-next { display: none; }
}

/* Phones: two photos per row, tabs kept legible. */
@media (max-width: 700px) {
  .grid { padding: 8px 8px 20px; }

  .grid.masonry { gap: 8px; }

  .grid-col { gap: 8px; }

  /* The tab row stays pinned while scrolling, so it is kept to a single
     compact line — short category labels are used where they exist. */
  .site-header { padding: 10px 12px 8px; }

  .site-nav {
    flex-wrap: nowrap;
    gap: 0 12px;
    margin-top: 8px;
    /* Should a device be narrower still, the row scrolls instead of breaking. */
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .site-nav::-webkit-scrollbar { display: none; }

  .site-nav a {
    font-size: 10.5px;
    letter-spacing: 0.05em;
    padding: 1px 0;
    white-space: nowrap;
    flex: none;
  }

  .nav-full { display: none; }

  .nav-short { display: inline; }
}

/* Small phones: trim the type a little more so the row still fits. */
@media (max-width: 390px) {
  .site-header { padding: 9px 10px 7px; }

  .site-nav { gap: 0 9px; }

  .site-nav a { font-size: 9.5px; letter-spacing: 0.03em; }

  /* No hover on touch — the name would never show, so keep the photo clean. */
  .ph-title { display: none; }

  /* Tapping opens the photo as large as the screen allows. */
  .lightbox { background: rgba(250, 248, 244, 0.99); }

  .lightbox img {
    max-width: 100vw;
    max-height: 100vh;
    box-shadow: none;
  }

  .lb-close {
    top: 6px;
    right: 10px;
    font-size: 36px;
  }

  .lb-caption { bottom: 10px; }
}

/* Phones: the header must never push the page sideways. */
@media (max-width: 620px) {
  .site-header { padding: 16px 14px; gap: 12px; }

  .wordmark-name { font-size: 21px; letter-spacing: 0.14em; }

  .wordmark-tag { font-size: 9.5px; letter-spacing: 0.18em; }

  .header-meta { gap: 10px; }

  .lang-toggle { padding: 3px 6px; }
}
