/* Neolithic Darkroom — public site. Warm darkroom palette; the accent is the red of "lith" in the logo. */
@view-transition { navigation: auto; }

:root {
  --bg: #110f0e;
  --bg-2: #1a1715;
  --line: #2c2724;
  --text: #ece4d8;
  --muted: #a69a8b;
  --accent: #cc0000;      /* the red of "lith" in the logo */
  --accent-2: #cc0000;
  --radius: 4px;
  --wrap: 1280px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* Light theme: warm baryta-paper tones. Applied when chosen explicitly,
   or by the system preference when the visitor left the choice on "auto". */
:root[data-theme="light"] {
  --bg: #f3eee5; --bg-2: #e8e1d5; --line: #d5ccbd; --text: #1f1b17; --muted: #6a6056;
  --accent: #cc0000; --accent-2: #cc0000;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3eee5; --bg-2: #e8e1d5; --line: #d5ccbd; --text: #1f1b17; --muted: #6a6056;
    --accent: #cc0000; --accent-2: #cc0000;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: .005em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  view-transition-name: header;
}
.brand img { width: 150px; height: auto; }
/* Light logo on the dark theme, the original black one on the light theme. */
.brand .logo-on-light { display: none; }
:root[data-theme="light"] .brand .logo-on-dark { display: none; }
:root[data-theme="light"] .brand .logo-on-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .brand .logo-on-dark { display: none; }
  :root:not([data-theme="dark"]) .brand .logo-on-light { display: block; }
}
.site-nav { display: flex; gap: clamp(16px, 3vw, 36px); margin-left: auto; }

.theme-btn {
  order: 2; flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.theme-btn:hover { color: var(--text); border-color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; display: none; }
/* The icon shows the current theme; before the script runs ("auto") it follows the system. */
.theme-btn[data-mode="light"] .i-light, .theme-btn[data-mode="dark"] .i-dark { display: block; }
.theme-btn[data-mode="auto"] .i-dark { display: block; }
@media (prefers-color-scheme: light) {
  .theme-btn[data-mode="auto"] .i-dark { display: none; }
  .theme-btn[data-mode="auto"] .i-light { display: block; }
}
.site-nav a {
  text-decoration: none; color: var(--muted); font-size: .92rem; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); border-color: var(--accent); }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 720px) {
  .nav-burger { display: block; order: 3; width: 32px; height: 24px; position: relative; cursor: pointer; }
  .theme-btn { margin-left: auto; }
  .nav-burger span, .nav-burger::before, .nav-burger::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--text); transition: transform .2s, opacity .2s;
  }
  .nav-burger::before { top: 3px; } .nav-burger span { top: 11px; } .nav-burger::after { top: 19px; }
  .nav-toggle:checked + .nav-burger::before { transform: translateY(8px) rotate(45deg); }
  .nav-toggle:checked + .nav-burger span { opacity: 0; }
  .nav-toggle:checked + .nav-burger::after { transform: translateY(-8px) rotate(-45deg); }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .site-nav a { padding: 14px clamp(16px, 4vw, 40px); border: 0; border-top: 1px solid var(--line); }
  .nav-toggle:checked ~ .site-nav { max-height: 320px; }
}

/* common */
.section { padding: clamp(40px, 7vw, 88px) 0; }
.section + .section { padding-top: 0; }
.narrow { max-width: 760px; margin: 0 auto; }
.center { text-align: center; }
.page-head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.section-head h2 { margin: 0; }
.eyebrow { color: var(--accent-2); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 14px; }
.eyebrow a { text-decoration: none; }
.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.link { color: var(--accent-2); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn {
  display: inline-block; font: inherit; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 12px 24px; border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--text); background: transparent; text-decoration: none; cursor: pointer; transition: background .2s;
}
.btn:hover { background: var(--accent); color: #fff; }
.prose { max-width: 68ch; }
.prose a { color: var(--accent-2); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.cta { margin-top: 40px; }

/* hero */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: clamp(32px, 6vw, 80px) 0;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.hero-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 28px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .slider { order: -1; } }

.slider { margin: 0; }
.slides { position: relative; aspect-ratio: 1; background: var(--bg-2); overflow: hidden; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 2s ease; }
.slide.is-active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: .9rem; min-height: 2em; }
.slider-caption { color: inherit; text-decoration: none; }
.slider-caption:hover { color: var(--text); }
.slider-ctrl { display: flex; flex: none; }
.slider-ctrl button {
  background: none; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.2rem; line-height: 1; cursor: pointer; margin-left: 6px;
}
.slider-ctrl button:hover { border-color: var(--accent); }

/* gallery cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(20px, 3vw, 36px); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card a { display: block; text-decoration: none; }
.card-img { aspect-ratio: 1; overflow: hidden; background: var(--bg-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease, filter .8s ease; filter: saturate(.85); }
.card a:hover .card-img img { transform: scale(1.04); filter: none; }
.card-body { padding-top: 14px; }
.card-body h3 { margin: 0 0 4px; }
.card-body p { color: var(--muted); margin: 0 0 4px; font-size: .95rem; }
.count { color: var(--accent-2); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }

/* justified gallery: each tile grows proportionally to its aspect ratio */
.justified { display: flex; flex-wrap: wrap; gap: 10px; }
.justified::after { content: ""; flex-grow: 999; }
.tile {
  flex-grow: calc(var(--w) / var(--h));
  flex-basis: calc(300px * var(--w) / var(--h));
  max-width: calc(440px * var(--w) / var(--h)); /* keeps the last row the same scale */
  aspect-ratio: var(--ar); overflow: hidden; background: var(--bg-2); cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.tile { position: relative; }
/* Gallery-style "sold" marker: a red dot with a label. */
.sold {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px; background: rgba(17, 15, 14, .72); color: #ece4d8;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; pointer-events: none;
}
.sold::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tile:hover img { opacity: .85; }
@media (max-width: 560px) { .justified { gap: 6px; } .tile { flex-basis: calc(50% - 3px); max-width: none; } }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { color: var(--muted); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; }
.pager a:hover { color: var(--text); }

/* about */
.about-portraits { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 36px; }
.about-portraits figure { margin: 0; }
.about-portraits figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }

/* contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } .contact-img { display: none; } }
.contact-img { margin-top: 28px; opacity: .9; }
.contact-form form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field span { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; width: 100%; transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 160px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--accent); }
.field small { color: var(--accent-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); margin-bottom: 18px; }
.notice.error { border-color: var(--accent); }
.notice.success h2 { margin-bottom: .3em; }
.contact-form button { justify-self: start; }

/* footer */
.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 28px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}
.site-footer p { margin: 0; }
.social a { color: var(--muted); margin-left: 16px; text-decoration: none; }
.social a:hover { color: var(--text); }

/* lightbox caption */
.pswp__custom-caption {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  max-width: min(90vw, 760px); padding: 6px 14px; border-radius: var(--radius);
  background: rgba(0, 0, 0, .55); color: #eee; font-size: .9rem; text-align: center;
}
.pswp__custom-caption:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  @view-transition { navigation: none; }
}
