:root {
  --bg: #f7f4ef;
  --ink: #2a2623;
  --muted: #7d746c;
  --line: #e3ddd4;
  --accent: #8a6f5a;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --gap: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

.button {
  display: inline-block;
  padding: .7em 1.6em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 500 12px/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.button:hover { background: var(--ink); color: var(--bg); }
.button.light { border-color: #fff; color: #fff; }
.button.light:hover { background: #fff; color: var(--ink); }

/* ---- brand ---- */
.brand { text-decoration: none; display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-name { font: 400 22px/1.1 var(--serif); letter-spacing: .06em; }
.brand-tag { font: 500 10px/1.6 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }

/* ---- cover / hero ---- */
.cover, .home-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  background: #1d1a18;
  color: #fff;
}
.cover-img, .hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  max-width: none;
}
.cover.has-image::after, .home-hero.has-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.45));
}
.cover-text, .hero-text { position: relative; z-index: 1; padding: 24px; }
.kicker { margin: 0 0 1em; font: 500 11px/1.4 var(--sans); letter-spacing: .32em; text-transform: uppercase; opacity: .9; }
.cover h1 { margin: 0; font: 400 clamp(40px, 8vw, 88px)/1.05 var(--serif); letter-spacing: .02em; }
.cover .meta { margin: .8em 0 2em; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; opacity: .9; }
.home-hero h1 { margin: 0 0 1.6em; display: flex; flex-direction: column; align-items: center; }
.home-hero .brand-name { font-size: clamp(44px, 9vw, 96px); letter-spacing: .04em; }
.home-hero .brand-tag { color: #fff; font-size: 12px; margin-top: .8em; }
.home-hero:not(.has-image) { min-height: 60svh; }

/* ---- sticky bar ---- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, env(safe-area-inset-left));
  background: rgba(247,244,239,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar-title { font: italic 400 18px/1.2 var(--serif); color: var(--muted); text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- grid (masonry via columns) ---- */
.wrap { max-width: 1600px; margin: 0 auto; padding: var(--gap) 16px 40px; }
.grid { columns: 3 320px; column-gap: var(--gap); }
.tile { display: block; margin: 0 0 var(--gap); break-inside: avoid; background: var(--line); cursor: zoom-in; overflow: hidden; }
.tile img { width: 100%; transition: opacity .4s, transform .6s; }
.tile:hover img { transform: scale(1.015); }
.note { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 19px; margin: 24px 0; }
.note.center { text-align: center; }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 28px 16px 40px; max-width: 1600px; margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; letter-spacing: .04em;
}
.site-footer .links { display: flex; gap: 20px; }

/* ---- card pages (PIN, expired, 404) ---- */
.card-page { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.card { width: 100%; max-width: 420px; text-align: center; }
.card .brand { align-items: center; margin-bottom: 48px; }
.card h1 { font: 400 36px/1.15 var(--serif); margin: 0 0 .5em; }
.card p { color: var(--muted); }
.pin-form { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.pin-form input {
  padding: 14px; font: 22px/1 var(--sans); letter-spacing: .3em; text-align: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 0;
}
.pin-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.error { color: #a1452f !important; }

/* ---- lightbox ---- */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(18,16,15,.97); display: grid; place-items: center; touch-action: pan-y; }
.lb[hidden] { display: none; }
.lb-img { max-width: calc(100vw - 32px); max-height: calc(100svh - 96px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .2s; }
.lb-img.loading { opacity: .35; }
.lb-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; color: #d8d2cb; font-size: 13px; letter-spacing: .1em;
}
.lb-actions { display: flex; align-items: center; gap: 18px; }
.lb-dl { color: #d8d2cb; text-decoration: none; text-transform: uppercase; font-size: 12px; letter-spacing: .18em; }
.lb-dl:hover { color: #fff; }
.lb button { background: none; border: 0; color: #d8d2cb; cursor: pointer; font: 28px/1 var(--sans); padding: 8px; }
.lb button:hover { color: #fff; }
.lb-close { font-size: 22px !important; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 48px !important; padding: 24px 12px !important; }
.lb-prev { left: 4px; }
.lb-next { right: 4px; }
body.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  :root { --gap: 6px; }
  .grid { columns: 2; }
  .wrap { padding-left: 6px; padding-right: 6px; }
  .bar-title { display: none; }
  .brand-name { font-size: 18px; }
  .lb-prev, .lb-next { display: none; }
  .lb-img { max-width: 100vw; }
}
