/* ---------- Font: Poppins (SIL Open Font License), served from this site ---------- */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-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: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-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: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/poppins-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; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/poppins-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: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/poppins-700-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: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/poppins-700-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; }

/* ---------- Basics ---------- */
:root {
  --pad: clamp(16px, 3vw, 40px);
  --ink: #111;
  --muted: #707070;
  --placeholder: #ececec;
  --accent: #2b6cff; /* only used by the editor */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px var(--pad);
}
.logo {
  justify-self: start;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 13px;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.nav a[aria-current="page"], .nav a:hover { border-color: currentColor; }

main { max-width: 1400px; margin: 0 auto; padding: 0 var(--pad) 120px; }

/* ---------- Headline ---------- */
.intro h1 {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 17em;
  text-wrap: balance;
  margin: clamp(48px, 8vw, 110px) 0 clamp(56px, 9vw, 130px);
}

/* ---------- Image canvas ----------
   Positions come from layout.json in "units": the canvas is always
   1000 units wide, so 1 unit = 0.1cqw. Everything scales together. */
.canvas-wrap { container-type: inline-size; }
.canvas {
  position: relative;
  height: calc(var(--ch, 1000) * 0.1cqw);
}
.item {
  position: absolute;
  left: calc(var(--x) * 0.1cqw);
  top: calc(var(--y) * 0.1cqw);
  width: calc(var(--w) * 0.1cqw);
  height: calc(var(--h) * 0.1cqw);
  margin: 0;
  overflow: hidden;
}
.item:not(.placeholder) { background-color: #f1f1f1; }
/* Soft blurred preview shown until the image arrives */
.item:not(.placeholder)::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--lqip, none);
  background-size: cover;
  background-position: var(--fx, 50%) var(--fy, 50%);
  filter: blur(18px);
  transform: scale(1.2);
}
.item img {
  position: relative;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx, 50%) var(--fy, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--fx, 50%) var(--fy, 50%);
  -webkit-user-drag: none;
  user-select: none;
}
.placeholder {
  background: var(--placeholder);
  box-shadow: inset 0 0 0 1px #dcdcdc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

body:not(.editing) .item:not(.placeholder) { cursor: zoom-in; }
.item.loaded img { opacity: 1; }
/* Video tiles */
.item video {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx, 50%) var(--fy, 50%);
}
/* Second image that slowly crossfades with the first: holds ~6 s, fades over ~2 s */
.item img.fade-alt {
  position: absolute;
  inset: 0;
  animation: crossfade 16s ease-in-out infinite;
}
@keyframes crossfade {
  0%, 37.5% { opacity: 0; }
  50%, 87.5% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .item img { transition: none; } .item img.fade-alt { animation: none; opacity: 0; } }

/* ---------- Full-size viewer ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 64px) clamp(16px, 6vw, 96px);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; background: #f1f1f1; }
.lightbox video { max-width: 100%; max-height: 100%; display: block; background: #000; cursor: default; }
.lightbox [hidden] { display: none; }
.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  color: var(--ink);
  font: 300 40px/1 "Poppins", system-ui, sans-serif;
  padding: 12px 16px;
  cursor: pointer;
  opacity: 0.6;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
html.lb-open { overflow: hidden; }
@media (max-width: 700px) {
  .lb-prev, .lb-next { display: none; } /* swipe instead */
}

/* ---------- Phone: one image per row, top-to-bottom order ---------- */
@media (max-width: 700px) {
  .site-header { grid-template-columns: auto 1fr; gap: 16px; }
  .nav { justify-self: end; gap: 20px; }
  .canvas { height: auto; display: flex; flex-direction: column; gap: 14px; }
  .item {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: var(--w) / var(--h);
  }
  .item.hide-mobile { display: none; }
}

/* ---------- About page ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  padding-top: clamp(40px, 7vw, 100px);
}
.about-photo { aspect-ratio: 1 / 1; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-text h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  text-box: trim-both cap alphabetic; /* top of the letters lines up exactly with the photo */
}
.about-text h2 { font-size: 1.4rem; margin: 56px 0 16px; scroll-margin-top: 24px; }
.about-text p { font-size: 15px; line-height: 1.75; color: #333; max-width: 36em; }
.about-text .lead { font-size: 19px; line-height: 1.6; color: var(--ink); font-weight: 500; }
.contact-list { list-style: none; padding: 0; margin: 0; font-size: 17px; line-height: 2; }
.contact-list a { text-decoration: none; border-bottom: 1px solid #ccc; }
.contact-list a:hover { border-color: var(--ink); }
/* ---------- Contact form ---------- */
.contact-form { margin-top: 40px; max-width: 36em; display: grid; gap: 18px; }
.contact-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.contact-form .optional { color: #a0a0a0; }
.contact-form input, .contact-form textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d6d6d6;
  border-radius: 0;
  padding: 12px 14px;
  width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--ink); }
.contact-form input::placeholder { color: #b0b0b0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.contact-form button {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--ink);
  border: 0;
  padding: 13px 26px;
  cursor: pointer;
}
.contact-form button:hover { background: #333; }
.contact-form button:disabled { opacity: 0.5; cursor: default; }
.contact-form .form-status { margin: 0; font-size: 14px; }
.contact-form .form-status[data-kind="ok"] { color: #1f7a3a; }
.contact-form .form-status[data-kind="error"] { color: #b3261e; }
.contact-form .form-note { margin: 0; font-size: 12px; color: #a0a0a0; }
.bot-field { position: absolute; left: -9999px; }

@media (max-width: 700px) {
  .about { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .about-photo { width: 55%; max-width: 220px; }
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 28px var(--pad) 36px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
