:root {
  --bg: #f5f1ea;
  --surface: #fffdf9;
  --ink: #1f1b16;
  --muted: #6d6458;
  --line: #dcd4c6;
  --accent: #8a4b22;
  --accent-ink: #fffaf3;
  --ok: #2f6b3f;
  --error: #a3312a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171411;
    --surface: #211d18;
    --ink: #efe8dc;
    --muted: #a69c8d;
    --line: #3a332a;
    --accent: #d9a06a;
    --accent-ink: #1c140c;
    --ok: #8fca9c;
    --error: #f0958d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: 4px;
}
.skip:focus { top: 0.75rem; color: var(--bg); }

/* Header */

.site-header {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) var(--gutter);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
}

.brand { text-decoration: none; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.brand:hover { color: inherit; }
.brand-name { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -0.01em; }
.brand-tag { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }

.site-header nav { display: flex; align-items: baseline; gap: clamp(1rem, 3vw, 2rem); }
.site-header nav a { text-decoration: none; padding: 0.25rem 0; border-bottom: 1px solid transparent; }
.site-header nav a[aria-current="page"] { border-bottom-color: currentColor; }
.site-header nav a.lang { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.08em; }
.site-header nav a.lang:hover { color: var(--accent); }

/* Intro */

.intro { padding: clamp(24px, 6vw, 72px) 0 clamp(20px, 4vw, 44px); }
.lede {
  font-family: var(--serif); font-size: clamp(1.45rem, 3.4vw, 2.5rem); line-height: 1.25;
  letter-spacing: -0.015em; max-width: 24em; margin: 0; text-wrap: balance;
}

/* Search and tags */

.finder { margin-bottom: clamp(16px, 2.5vw, 28px); }

.search input {
  width: 100%; max-width: 34rem;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23857a6b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")
    no-repeat 0.9rem 50%;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.7rem 1.1rem 0.7rem 2.6rem;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.chips.collapsed { max-height: 4.6rem; overflow: hidden; }

.chip {
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  padding: 0.3rem 0.8rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.9rem; text-decoration: none; background: transparent; white-space: nowrap;
}
.chip:hover { border-color: var(--ink); color: inherit; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-count { font-size: 0.75rem; opacity: 0.6; font-variant-numeric: tabular-nums; }

.link-button {
  font: inherit; font-size: 0.9rem; color: var(--muted); background: none; border: 0; padding: 0.4rem 0;
  text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}
.link-button:hover { color: var(--accent); }

.count { color: var(--muted); font-size: 0.85rem; margin: 0.9rem 0 0; font-variant-numeric: tabular-nums; }

/* Grid */

.grid { columns: 3 150px; column-gap: clamp(8px, 1.2vw, 16px); }

.card {
  display: block; position: relative; break-inside: avoid;
  margin-bottom: clamp(8px, 1.2vw, 16px);
  background: var(--line); border-radius: 3px; overflow: hidden;
}
.card img { display: block; width: 100%; height: auto; transition: transform 0.5s ease, opacity 0.3s; }
.card-title {
  position: absolute; inset: auto 0 0 0; padding: 2.2rem 0.9rem 0.7rem;
  color: #fff; font-size: 0.9rem; line-height: 1.3;
  background: linear-gradient(to top, rgb(0 0 0 / 0.62), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.card:hover .card-title, .card:focus-visible .card-title { opacity: 1; }
@media (hover: hover) { .card:hover img { transform: scale(1.025); } }
@media (hover: none) { .card-title { opacity: 1; } }

/* A collection: one card for several photos of the same piece or set */
.card-set .card-title { opacity: 1; font-size: 1rem; font-weight: 500; }
.card-badge {
  position: absolute; top: 0.6rem; right: 0.6rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: rgb(16 14 12 / 0.62); color: #fff; font-size: 0.75rem; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.set-head { padding: clamp(16px, 4vw, 48px) 0 clamp(20px, 3vw, 36px); max-width: 46rem; }
.back { display: inline-block; color: var(--muted); font-size: 0.9rem; text-decoration: none; margin-bottom: 1.25rem; }
.back:hover { color: var(--accent); }
.set-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 1rem; }
.set-head > p { margin: 0 0 1em; font-size: 1.05rem; }
.set-tags { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.set-head .set-actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin: 1.75rem 0 0; }
.set-actions .count { margin: 0; }

.empty, .none-yet, .notfound { padding: clamp(32px, 8vw, 96px) 0; color: var(--muted); }
.empty p { margin: 0 0 1rem; }
.notfound h1 { font-size: clamp(3rem, 10vw, 6rem); margin: 0; color: var(--ink); }

/* Buttons */

.button {
  display: inline-block; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 0.7rem 1.3rem; border-radius: 999px;
}
.button:hover { filter: brightness(1.08); color: var(--accent-ink); }
.button[disabled] { opacity: 0.6; cursor: default; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button.secondary:hover { border-color: var(--ink); color: var(--ink); filter: none; }

/* Lightbox */

.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
  background: #100e0c; color: #efe8dc; overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.lightbox::backdrop { background: #100e0c; }

.lb-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.lb-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }

.lb-nav, .lb-close {
  font: inherit; line-height: 1; cursor: pointer; color: #efe8dc;
  background: rgb(16 14 12 / 0.55); border: 0; border-radius: 999px;
  width: 2.75rem; height: 2.75rem; font-size: 1.7rem;
  display: grid; place-items: center; padding: 0 0 0.15em;
}
.lb-nav:hover, .lb-close:hover { background: rgb(239 232 220 / 0.2); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }

.lb-panel {
  position: relative; overflow-y: auto;
  padding: 4.25rem 1.5rem 1.5rem; border-left: 1px solid rgb(239 232 220 / 0.14);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem;
}
.lb-close { position: absolute; top: 0.9rem; right: 0.9rem; background: rgb(239 232 220 / 0.1); }
.lb-panel h2 { font-size: 1.5rem; margin: 0; }
.lb-panel p { margin: 0; color: #c9bfb0; white-space: pre-line; }
.lb-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lb-tags button {
  font: inherit; font-size: 0.85rem; cursor: pointer; color: #efe8dc; background: none;
  border: 1px solid rgb(239 232 220 / 0.3); border-radius: 999px; padding: 0.25rem 0.75rem;
}
.lb-tags button:hover { border-color: #efe8dc; }
.lb-panel .button { margin-top: 0.5rem; background: #d9a06a; border-color: #d9a06a; color: #1c140c; }

@media (max-width: 800px) {
  .lightbox[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .lb-panel { border-left: 0; border-top: 1px solid rgb(239 232 220 / 0.14); padding: 1rem 1.1rem 1.25rem; max-height: 42dvh; gap: 0.6rem; }
  .lb-close { position: fixed; top: 0.75rem; right: 0.75rem; background: rgb(16 14 12 / 0.55); }
  .lb-panel h2 { font-size: 1.2rem; }
  .lb-nav { width: 2.4rem; height: 2.4rem; }
}

/* Contact */

.contact {
  display: grid; gap: clamp(32px, 6vw, 80px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  padding: clamp(24px, 5vw, 64px) 0 clamp(40px, 8vw, 96px);
  max-width: 1100px;
}
.contact h1, .contact h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 1rem; }
.about p { max-width: 34em; margin: 0 0 1em; }
.public-contact { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); }
.inquiry { max-width: 34rem; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }

.ref {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
  padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.ref img { width: 72px; height: 72px; object-fit: cover; border-radius: 3px; flex: none; }
.ref p { margin: 0; display: flex; flex-direction: column; }
.ref-label { color: var(--muted); font-size: 0.85rem; }

form label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 1.1rem; }
form input[type="text"], form input[type="email"], form textarea {
  display: block; width: 100%; margin-top: 0.35rem;
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.85rem;
}
form textarea { resize: vertical; min-height: 9rem; }
form input:focus, form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-bottom: 1.1rem; }
.privacy { color: var(--muted); font-size: 0.85rem; margin: 0.9rem 0 0; }

.form-status { margin: 1rem 0 0; min-height: 1.6em; }
.form-status.ok { color: var(--ok); font-family: var(--serif); font-size: 1.3rem; }
.form-status.error { color: var(--error); }

/* Hidden page: /carmen */

body.egg { align-items: center; justify-content: center; text-align: center; padding: var(--gutter); }
body.egg main {
  flex: 1; padding: 0; max-width: 44rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.75rem;
  animation: egg-in 0.9s ease both;
}
.egg-for { margin: 0; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase; }
body.egg figure { margin: 0; }
body.egg blockquote {
  margin: 0; font-family: var(--serif); font-size: clamp(1.6rem, 4.6vw, 2.6rem); line-height: 1.3;
  letter-spacing: -0.01em; text-wrap: balance;
}
body.egg figcaption { margin-top: 1.5rem; color: var(--muted); font-size: 0.95rem; }
body.egg cite::before { content: "· "; font-style: normal; }
.egg-heart {
  color: var(--accent); font-size: 1.6rem; line-height: 1; text-decoration: none;
  padding: 0.5rem 0.9rem; border-radius: 999px; transition: transform 0.25s ease;
}
.egg-heart:hover { transform: scale(1.25); color: var(--accent); }
body.egg footer { color: var(--muted); font-size: 0.8rem; padding-top: 1rem; }
body.egg footer a { text-decoration: none; }
@keyframes egg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.egg main { animation: none; } }

/* Footer */

.site-footer {
  width: 100%; max-width: 1400px; margin: clamp(32px, 6vw, 72px) auto 0;
  padding: 1.25rem var(--gutter) 2rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: 0.85rem;
}
.site-footer p { margin: 0; }

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