@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400&display=swap');

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

:root {
  --bg:       #f5f3f0;
  --fg:       #1a1917;
  --fg-muted: #767370;
  --border:   #dddbd8;
  --font:     'DM Sans', system-ui, -apple-system, sans-serif;
  --gap:      clamp(10px, 1.5vw, 20px);
  --pad:      clamp(16px, 3vw, 40px);
  --max:      1440px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #111110;
    --fg:       #e8e6e3;
    --fg-muted: #8f8d8a;
    --border:   #2e2d2b;
  }
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -999px;
  left: var(--pad);
  background: var(--fg);
  color: var(--bg);
  padding: 8px 16px;
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 200;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease;
}
.site-header.hidden { transform: translateY(-100%); }

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
}

.site-nav { display: flex; gap: 28px; }

.site-nav a {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg); }

/* Main content */
#content {
  min-height: 60vh;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 64px) var(--pad);
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
@media (max-width: 700px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .photo-grid { grid-template-columns: 1fr; }
}

.photo-item {
  cursor: pointer;
  overflow: hidden;
}
.photo-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s;
}
.photo-item:hover img { opacity: 0.88; }
.photo-item:focus { outline: 2px solid var(--fg); outline-offset: 2px; }

.work-darkroom-link {
  text-align: center;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  padding: 48px var(--pad) 32px;
}
.work-darkroom-link a { color: var(--fg-muted); text-underline-offset: 3px; }
.work-darkroom-link a:hover { color: var(--fg); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px var(--pad);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* Inner page prose */
.prose { max-width: 600px; }

.prose h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}
.prose h2 {
  font-size: 1.125rem;
  font-weight: 400;
  margin-top: 40px;
  margin-bottom: 12px;
}
.prose p {
  color: var(--fg-muted);
  margin-bottom: 1.2em;
  font-size: 1.0625rem;
}
.prose a {
  color: var(--fg);
  text-underline-offset: 3px;
}
.contact-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}
.contact-label {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  min-width: 80px;
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#lightbox[hidden] { display: none; }

#lightbox img {
  max-height: calc(100dvh - 80px);
  max-width: 100%;
  object-fit: contain;
  user-select: none;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color 0.15s;
}
.lb-close:hover { color: #fff; }

.lb-exif {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 28px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  font-family: var(--font);
}
.lb-exif span:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
  .photo-item img { transition: none; }
  .lb-close { transition: none; }
}

/* ── Darkroom ──────────────────────────────────────────────────────────── */
body.darkroom-page { background: #0a0a0a; color: #c8c8c8; }
body.darkroom-page .site-header { background: #141414; border-color: #2a2a2a; }
body.darkroom-page .wordmark,
body.darkroom-page .site-nav a { color: #666; }
body.darkroom-page .site-nav a:hover { color: #ccc; }
body.darkroom-page .site-footer { display: none; }
body.darkroom-page #content { padding: 0; max-width: none; overflow: hidden; }

#darkroom-root { display: flex; flex-direction: column; }

.dr-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #141414; border-bottom: 1px solid #222;
}
.dr-spacer { flex: 1; }

.dr-btn {
  font-family: var(--font); font-size: 0.8125rem; letter-spacing: 0.04em;
  cursor: pointer; border: none; border-radius: 4px; padding: 6px 14px;
}
.dr-btn-open { background: #2a2a2a; color: #c0c0c0; }
.dr-btn-open:hover { background: #333; }
.dr-btn-open input { display: none; }
.dr-btn-dl { background: #e8e6e3; color: #111; transition: background 0.15s; }
.dr-btn-dl:hover { background: #fff; }
.dr-btn-dl:disabled { opacity: 0.5; cursor: default; }

.dr-icon-btn {
  background: none; border: none; color: #666; font-size: 1.25rem;
  cursor: pointer; padding: 4px 8px; border-radius: 4px; line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.dr-icon-btn:hover { color: #ddd; background: #2a2a2a; }

.dr-workspace { display: flex; flex: 1; min-height: 0; height: calc(100vh - 113px); }

.dr-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #0d0d0d; overflow: auto; position: relative;
}
.dr-canvas-wrap.dr-drag-over { outline: 2px dashed #555; outline-offset: -2px; }

.dr-drop { text-align: center; color: #3a3a3a; font-size: 0.9375rem; letter-spacing: 0.04em; pointer-events: none; }
.dr-drop-sub { font-size: 0.8125rem; color: #2a2a2a; margin-top: 6px; }

.dr-canvas { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
.dr-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #666; font-size: 0.8125rem; letter-spacing: 0.06em; pointer-events: none; }

.dr-panel {
  width: 220px; flex-shrink: 0;
  background: #141414; border-left: 1px solid #222;
  overflow-y: auto; padding: 12px 16px 32px;
}

.dr-section-title {
  font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #484848; margin: 18px 0 8px; font-weight: 400;
}
.dr-section-title:first-child { margin-top: 2px; }

.dr-row {
  display: grid; grid-template-columns: 72px 1fr 32px;
  align-items: center; gap: 6px; margin-bottom: 8px;
}
.dr-label { font-size: 0.75rem; color: #777; }
.dr-val { font-size: 0.6875rem; color: #4a4a4a; text-align: right; font-variant-numeric: tabular-nums; }

.dr-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; background: #2a2a2a; border-radius: 2px; outline: none; cursor: pointer; }
.dr-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #b0b0b0; cursor: pointer; }
.dr-slider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #b0b0b0; border: none; cursor: pointer; }

.dr-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.dr-preset-btn {
  font-family: var(--font); font-size: 0.75rem; letter-spacing: 0.03em;
  background: #1e1e1e; color: #777; border: none; border-radius: 3px;
  padding: 5px 9px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.dr-preset-btn:hover { background: #2e2e2e; color: #bbb; }

.dr-reset-btn {
  font-family: var(--font); font-size: 0.75rem; letter-spacing: 0.04em;
  background: none; color: #444; border: 1px solid #252525; border-radius: 3px;
  padding: 6px 12px; cursor: pointer; width: 100%; margin-top: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.dr-reset-btn:hover { color: #999; border-color: #3a3a3a; }

@media (max-width: 640px) {
  .dr-workspace { flex-direction: column; height: auto; }
  .dr-canvas-wrap { min-height: 50vw; }
  .dr-panel { width: 100%; border-left: none; border-top: 1px solid #222; max-height: 55vh; overflow-y: auto; }
  .dr-row { grid-template-columns: 80px 1fr 32px; }
}
