/* Li's Photography
   Palette: dark charcoal, light ink, one plum accent (dark for every visitor, so photos read richer).
   Type: Bodoni Moda for display, Schibsted Grotesk for everything else. */

:root {
  --paper: #161B1D;
  --surface: #1F2629;
  --ink: #E4E8E5;
  --muted: #A2ADB1;
  --rule: #3A4448;
  --plum: #7D3A5E;
  --plum-dark: #934870;
  --accent: #D49AB9;
  --field-bg: #12171A;
  --field-border: #6E7B80;
  --error: #F2978A;
  --error-bg: #3A201C;
  --success: #8FD1A9;
  --success-bg: #1B3326;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 500; }
h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.05;
  font-variation-settings: "opsz" 72;
}
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 1em; }

a { color: inherit; text-underline-offset: 0.2em; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--ink); color: var(--surface); padding: 0.6em 1em; text-decoration: none;
}
.skip:focus { top: 12px; }

main:focus { outline: none; }

main > section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) var(--gutter) 0;
}

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

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px 32px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  font-variation-settings: "opsz" 32;
  text-decoration: none;
  margin-right: auto;
}

.site-nav { display: flex; gap: 4px 24px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-weight: 500; padding: 4px 0; }
.site-nav a:hover { text-decoration: underline; }

.lang { display: flex; border: 1px solid var(--ink); border-radius: 3px; }
.lang-btn {
  font: 600 0.875rem/1 var(--sans);
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 9px 12px;
  min-width: 44px;
  cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--ink); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.lang-btn abbr { text-decoration: none; }

/* ---------- Viewfinder frame (the one signature device) ---------- */

.viewfinder {
  position: relative;
  margin: 0;
  padding: clamp(12px, 2vw, 22px);
}
.viewfinder::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  --len: clamp(22px, 3vw, 40px);
  --w: 2px;
  background:
    linear-gradient(var(--ink), var(--ink)) top left / var(--len) var(--w),
    linear-gradient(var(--ink), var(--ink)) top left / var(--w) var(--len),
    linear-gradient(var(--ink), var(--ink)) top right / var(--len) var(--w),
    linear-gradient(var(--ink), var(--ink)) top right / var(--w) var(--len),
    linear-gradient(var(--ink), var(--ink)) bottom left / var(--len) var(--w),
    linear-gradient(var(--ink), var(--ink)) bottom left / var(--w) var(--len),
    linear-gradient(var(--ink), var(--ink)) bottom right / var(--len) var(--w),
    linear-gradient(var(--ink), var(--ink)) bottom right / var(--w) var(--len);
  background-repeat: no-repeat;
}

.badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px dashed var(--muted);
}
.viewfinder .badge { right: calc(clamp(12px, 2vw, 22px) + 10px); bottom: calc(clamp(12px, 2vw, 22px) + 10px); }

/* ---------- Hero ---------- */

main > .hero {
  padding-top: clamp(24px, 5vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: clamp(28px, 3.5vw, 56px);
  align-items: center;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.5rem, 4.3vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 96;
  margin-bottom: 0.45em;
  max-width: 13ch;
  text-wrap: balance;
}

.lead { font-size: 1.25rem; line-height: 1.5; max-width: 34em; color: var(--ink); }

.actions { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; margin-top: 32px; }

.btn {
  display: inline-block;
  font: 600 1rem/1 var(--sans);
  background: var(--plum);
  color: #fff;
  border: 0;
  border-radius: 3px;
  padding: 16px 24px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--plum-dark); }
.btn:disabled { opacity: 0.7; cursor: progress; }

.link { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

/* The single orchestrated moment: the viewfinder closes in on the hero photo. */
@media (prefers-reduced-motion: no-preference) {
  .hero-photo::before { animation: focus-in 900ms cubic-bezier(.2, .7, .2, 1) 150ms both; }
  .hero-photo img { animation: expose 1100ms ease-out both; }
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@keyframes focus-in {
  from { inset: -18px; opacity: 0; }
  to { inset: 0; opacity: 1; }
}
@keyframes expose {
  from { filter: brightness(1.35) contrast(0.6); }
  to { filter: none; }
}

/* ---------- Services ---------- */

.services h2 { margin-bottom: 40px; max-width: 14ch; }
.service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(24px, 4vw, 56px);
}
.service-photo { margin: 0 0 18px; }
.service-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.service h3 { margin-bottom: 10px; font-size: 1.25rem; }
.service p { color: var(--muted); max-width: 36ch; margin: 0; }

/* ---------- Portfolio ---------- */

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font: 500 0.9375rem/1 var(--sans);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }



/* Even-height rows: each photo's width follows its shape (--ar = width / height, set in main.js),
   so tall portraits stay narrower than wide event and group shots. */
.gallery {
  --row: 300px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.gallery::after { content: ""; flex-grow: 999; } /* keeps the last row from stretching */
.shot { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row)); }
/* A photo alone on its row may grow a little, never past 1.5x its row size (keeps tall portraits small). */
.shot { max-width: calc(var(--ar) * var(--row) * 1.5); }
.shot[hidden] { display: none; }
.shot figure { position: relative; margin: 0; }
.shot img { width: 100%; }

/* Photos open in the viewer */
.photo-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.photo-open:focus-visible { outline-offset: 2px; }

/* Camera settings, set small like the data line in a viewfinder */
.exif {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1em;
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.shot .exif {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 7px;
  color: #F1F3F1;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .shot:not([hidden]) { animation: develop 400ms ease-out; }
}
@keyframes develop { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Photo viewer ---------- */

.viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0E1112;
  color: #E4E8E5;
  overflow: hidden;
}
.viewer::backdrop { background: transparent; }
html.viewer-open { overflow: hidden; }

.viewer-figure {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 88px 28px;
}
.viewer-figure img {
  max-width: 100%;
  max-height: calc(100% - 32px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.viewer-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  color: #A9B3B7;
}
.viewer-count { font-size: 0.75rem; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; margin-left: auto; }

.viewer-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(228, 232, 229, 0.35);
  border-radius: 50%;
  background: rgba(14, 17, 18, 0.6);
  color: #E4E8E5;
  cursor: pointer;
}
.viewer-btn:hover { border-color: #E4E8E5; }
.viewer-btn:focus-visible { outline: 3px solid #D49AB9; outline-offset: 3px; }
.viewer-prev, .viewer-next { top: 50%; transform: translateY(-50%); }
.viewer-prev { left: 20px; }
.viewer-next { right: 20px; }
.viewer-close { top: 12px; right: 20px; }
.viewer.is-single .viewer-prev, .viewer.is-single .viewer-next { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: develop 200ms ease-out; }
}

/* ---------- Process ---------- */

.process h2 { margin-bottom: 40px; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(20px, 3vw, 40px);
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--display);
  font-size: 3rem;
  line-height: 1;
  font-variation-settings: "opsz" 96;
  color: var(--accent);
  margin-bottom: 12px;
}
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); margin: 0; }

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

main > .contact {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 40px clamp(32px, 6vw, 96px);
  padding-bottom: clamp(64px, 10vw, 128px);
}
.contact h2 { margin-bottom: 16px; max-width: 12ch; }
.contact dl { margin: 32px 0 0; }
.contact dt { font-weight: 600; margin-top: 16px; }
.contact dd { margin: 2px 0 0; color: var(--muted); }
.contact dd a { color: var(--ink); }

.inquiry {
  background: var(--surface);
  padding: clamp(20px, 4vw, 40px);
  border-radius: 4px;
  border: 1px solid var(--rule);
}
.field { margin-bottom: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9375rem; margin: -2px 0 8px; }

input, select, textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--sans);
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 12px 14px;
  min-height: 48px;
}
textarea { resize: vertical; min-height: 140px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }

.error { color: var(--error); font-size: 0.9375rem; font-weight: 500; margin: 6px 0 0; }
.error:empty { display: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); border-width: 2px; padding: 11px 13px; }

.form-summary, .form-result {
  padding: 14px 16px;
  border-radius: 3px;
  margin-bottom: 22px;
  font-weight: 500;
  border-left: 4px solid;
}
.form-summary { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.form-result { margin: 22px 0 0; }
.form-result.is-success { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.form-result.is-error { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.form-result:focus { outline: none; }


/* ---------- Clients (kept deliberately quiet) ---------- */

main > .clients {
  padding-top: 0;
  padding-bottom: 40px;
}
.clients h2 {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 14px;
  font-variation-settings: normal;
}
.client-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 48px;
  font-size: 0.875rem;
  line-height: 1.45;
}
.client-name { display: block; color: var(--ink); }
.client-event { display: block; color: var(--muted); font-size: 0.8125rem; }
/* Linked clients: a thin underline on the name marks them as links without drawing attention. */
.client-link { display: block; text-decoration: none; }
.client-link .client-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
}
.client-link:hover .client-name { text-decoration-color: var(--ink); }

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

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.site-footer p { margin: 0; }
.site-footer .updated {
  margin-top: 6px;
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.footer-social {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
}
.footer-social:hover { border-color: var(--ink); }

.social-link { display: inline-flex; align-items: center; gap: 8px; }
.social-link svg { width: 16px; height: 16px; flex: none; }

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  main > .hero, main > .contact { grid-template-columns: 1fr; }
  .service-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { gap: 12px 16px; }
  .site-nav { order: 3; width: 100%; gap: 4px 18px; font-size: 0.9375rem; }
  .lead { font-size: 1.125rem; }
  .steps { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .gallery { --row: 150px; gap: 8px; }
  .gallery::after { display: none; } /* on phones, let a lone last photo fill the width */
  .shot .exif { display: none; } /* too small to read on phone thumbnails; shown in the viewer */
  .viewer-figure { padding: 60px 12px 88px; }
  .viewer-prev, .viewer-next { top: auto; bottom: 20px; transform: none; }
  .viewer-prev { left: calc(50% - 60px); }
  .viewer-next { right: calc(50% - 60px); }
  .viewer-close { right: 12px; }
  .badge { font-size: 0.6875rem; right: 6px; bottom: 6px; }
}
