/* nilsdecker.com — direction A "Index": white, Swiss, photos first. */

:root {
  --ink: #111111;
  --mid: #555555;
  --line: #ececec;
  --paper: #ffffff;
  --gutter: 32px;
  --max: 1376px;
  --sans: 'Geist', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--mid); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 11px; color: var(--mid); }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 1px solid var(--ink); padding-top: 12px; margin-bottom: 24px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 20px var(--gutter); }
/* The name is the brand: about three times the nav size. */
.logo { font-size: clamp(28px, 3vw, 42px); font-weight: 600; letter-spacing: 0.14em; line-height: 1; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; font-size: 17px; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.nav .btn-pill { min-height: 48px; padding: 0 24px; font-size: 16px; }
@media (max-width: 600px) {
  .site-header { position: static; }
  .site-header .bar { padding: 18px var(--gutter) 14px; }
  .nav { width: 100%; justify-content: space-between; gap: 8px 16px; font-size: 16px; }
  .nav .btn-pill { min-height: 44px; padding: 0 18px; font-size: 15px; }
}
@media (max-width: 380px) {
  .nav { gap: 8px 12px; font-size: 15px; }
  .nav .btn-pill { padding: 0 14px; }
}
.btn-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 999px; font-size: 13px; }
.btn-pill:hover { background: var(--ink); color: var(--paper); }
.btn-pill.solid { background: var(--ink); color: var(--paper); }
.btn-pill.solid:hover { background: #333333; }

/* Filmstrip (home hero): static <img> tags, so the visual editor can swap each one */
.strip { display: flex; gap: 12px; overflow-x: auto; padding: 32px var(--gutter) 12px; scroll-snap-type: x proximity; scroll-padding-left: var(--gutter); scrollbar-width: thin; }
.strip figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.strip img { height: min(68vh, 760px); min-height: 360px; width: auto; aspect-ratio: 2 / 3; object-fit: cover; background: var(--line); cursor: zoom-in; }
.strip figcaption { font-family: var(--mono); font-size: 11px; color: var(--mid); }

.intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 32px; align-items: end; padding-top: 72px; padding-bottom: 48px; }
.intro p { margin: 0; }
.intro .lede { font-size: clamp(24px, 3vw, 34px); line-height: 1.18; font-weight: 300; letter-spacing: -0.01em; max-width: 760px; }
.intro .side { font-size: 13px; color: var(--mid); justify-self: end; text-align: right; }
.intro .side a { color: var(--ink); border-bottom: 1px solid var(--ink); }

/* Gallery grid: rendered from _data/*.json by assets/site.js */
.section { padding-top: 24px; padding-bottom: 88px; }
.page-title { padding-top: 56px; padding-bottom: 32px; }
.page-title h1 { margin: 0; font-size: clamp(40px, 6vw, 72px); font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
.page-title p { margin: 16px 0 0; color: var(--mid); max-width: 640px; }
#gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 24px; align-items: start; }
#gallery-grid figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
/* Every tile is a 2:3 portrait; landscape photos are cropped ("zoomed in") around their
   crop point from _data/focus.json, default centre. */
#gallery-grid img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 50%; background: var(--line); cursor: zoom-in; }
/* Story pages: a landscape photo spans two columns at the same row height instead, so group
   shots aren't cut. --cols must match the grid's column count at each width. */
.story-grid { container-type: inline-size; }
#gallery-grid[data-layout="story"] { --cols: 5; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
#gallery-grid[data-layout="story"] figure.wide { grid-column: span 2; }
#gallery-grid[data-layout="story"] figure.wide img { aspect-ratio: auto; height: calc((100cqw - (var(--cols) - 1) * 24px) / var(--cols) * 1.5); }
@media (max-width: 1100px) { #gallery-grid[data-layout="story"] { --cols: 3; } }
@media (max-width: 600px) {
  #gallery-grid, #gallery-grid[data-layout="story"] { --cols: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  #gallery-grid[data-layout="story"] figure.wide img { height: calc((100cqw - 12px) / 2 * 1.5); }
  :root { --gutter: 16px; }
}
#gallery-grid figcaption { font-family: var(--mono); font-size: 11px; color: var(--mid); }
.empty { color: var(--mid); padding: 48px 0; }

/* Stories list */
.story-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 220px) 92px; gap: 16px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.story-row .t { font-size: clamp(22px, 2.6vw, 30px); font-weight: 300; letter-spacing: -0.01em; line-height: 1.15; }
.story-row .s { font-size: 14px; color: var(--mid); }
.story-row .thumbs { display: flex; gap: 4px; justify-content: flex-end; }
.story-row .thumbs img { width: 42px; height: 56px; object-fit: cover; background: var(--line); }
.story-row:hover .t { text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 640px) {
  .story-row { grid-template-columns: 32px minmax(0, 1fr); }
  .story-row .s, .story-row .thumbs { grid-column: 2; justify-content: flex-start; }
}

/* Story page */
.story-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 40px; align-items: end; }
.story-head h1 { margin: 0; font-size: clamp(40px, 6vw, 80px); font-weight: 300; letter-spacing: -0.02em; line-height: 0.98; }
.story-head .meta { display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--mid); }
.story-head .meta p { margin: 0; }
.story-head .credits { font-family: var(--mono); font-size: 12px; white-space: pre-line; }
.story-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--ink); padding-top: 16px; font-size: 14px; }

/* About */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 48px; padding-top: 56px; padding-bottom: 96px; }
.about img { width: 100%; max-width: 460px; aspect-ratio: 3 / 4; object-fit: cover; background: var(--line); }
.about .text { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.about .text p { margin: 0; }
.about .clients { font-size: 15px; }

/* Contact band + page */
.contact { background: var(--ink); color: var(--paper); }
.contact a { color: var(--paper); }
.contact a:hover { color: #bdbdbd; }
.contact .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 64px; padding-top: 96px; padding-bottom: 96px; }
.contact h2, .contact h1 { margin: 0; font-size: clamp(44px, 5vw, 64px); line-height: 1; font-weight: 300; letter-spacing: -0.02em; }
.contact .col { display: flex; flex-direction: column; gap: 24px; }
.contact .col p { margin: 0; color: #bdbdbd; max-width: 440px; font-size: 15px; }
.contact .direct { display: flex; flex-direction: column; gap: 10px; font-size: 18px; }
.contact .foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid #2a2a2a; padding-top: 24px; padding-bottom: 24px; font-size: 12px; color: #9a9a9a; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; font-size: 13px; align-content: start; }
.form .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 6px; color: #d0d0d0; }
.form input, .form textarea, .form select { background: transparent; border: 0; border-bottom: 1px solid #555555; color: var(--paper); padding: 10px 0; font: inherit; font-size: 16px; border-radius: 0; }
.form select { background: var(--ink); }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-bottom-color: var(--paper); }
.form textarea { resize: vertical; min-height: 110px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.form legend { color: #d0d0d0; margin-bottom: 10px; padding: 0; }
.role input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.role span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid #555555; border-radius: 999px; font-size: 14px; color: var(--paper); cursor: pointer; }
.role input:checked + span { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.role input:focus-visible + span { outline: 2px solid var(--paper); outline-offset: 3px; }
.form [data-for][hidden] { display: none; }
.form button { justify-self: start; min-height: 48px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.form button:hover { background: #dcdcdc; }
.form .hp { display: none; }
@media (max-width: 560px) { .form { grid-template-columns: minmax(0, 1fr); } }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(255, 255, 255, 0.98); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb[hidden] { display: none; }
.lb .top, .lb .bottom { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); font-family: var(--mono); font-size: 12px; color: var(--mid); }
.lb .stage { display: flex; align-items: center; justify-content: center; padding: 0 72px; min-height: 0; }
.lb .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb button { min-width: 44px; min-height: 44px; background: none; border: 0; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.lb .prev, .lb .next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; }
.lb .prev { left: 12px; }
.lb .next { right: 12px; }
@media (max-width: 640px) { .lb .stage { padding: 0 8px; } .lb .prev, .lb .next { top: auto; bottom: 8px; transform: none; } }
