:root {
  --bg: #ffffff;
  --fg: #1c1b1a;
  --muted: #8d8a85;
  --line: #ececea;
  --accent: #b08d57;
  --accent-ink: #8a6d3f;
  --max: 1320px;
  --gap: 10px;
  --radius: 3px;
  --header-h: 64px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* центрированные страницы (PIN, лендинг, 404) */
body.centered { display: flex; min-height: 100svh; align-items: center; justify-content: center; padding: 24px; }
.gate { text-align: center; max-width: 360px; width: 100%; }
.gate-brand { font-weight: 600; letter-spacing: .22em; font-size: 18px; }
.gate-sub { font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0; }
.gate h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 34px; margin: 22px 0 10px; }
.gate-note { color: var(--muted); font-size: 14px; line-height: 1.6; }
.gate-form { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.gate-form input {
  font: inherit; font-size: 16px; text-align: center; letter-spacing: .12em;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; outline: none;
}
.gate-form input:focus { border-color: var(--accent); }
.gate-form input.err { border-color: #e0584f; }
.gate-err { color: #c0392b; font-size: 13px; margin: 0; }
.gate-form button {
  font: inherit; font-size: 15px; padding: 14px; border: none; border-radius: 10px;
  background: var(--fg); color: #fff; cursor: pointer; letter-spacing: .03em;
}
.gate-form button:hover { background: #000; }

/* шапка */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 50;
  display: flex; align-items: center; color: #fff;
  transition: background .3s, box-shadow .3s, color .3s;
}
.site-header.scrolled {
  background: rgba(255,255,255,.985);
  color: var(--fg); box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px); display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-mark { font-weight: 600; letter-spacing: .22em; font-size: 16px; }
.brand-sub { font-size: 10px; letter-spacing: .35em; text-transform: uppercase; opacity: .7; margin-top: 4px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.badge-private {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  padding: 5px 10px; border-radius: 100px; border: 1px solid currentColor; opacity: .85;
}
.photo-count { font-size: 12px; letter-spacing: .08em; opacity: .8; text-transform: uppercase; }

/* обложка */
.cover {
  position: relative; height: 86svh; min-height: 480px;
  display: flex; align-items: flex-end; justify-content: center; text-align: center;
  color: #fff; overflow: hidden;
}
.cover-img { position: absolute; inset: 0; background: #1a1a1a 50% 35% / cover no-repeat; }
.cover-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.25) 40%, rgba(0,0,0,.5)); }
.cover-content { position: relative; z-index: 2; padding: 0 24px clamp(80px, 18vh, 200px); max-width: 760px; text-shadow: 0 2px 16px rgba(0,0,0,.55); }
.cover-arrow { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3; color: #fff; opacity: .85; display: flex; padding: 8px; animation: coverbounce 2s ease-in-out infinite; }
.cover-arrow:hover { opacity: 1; }
@keyframes coverbounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }
.eyebrow { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; margin: 0 0 18px; opacity: .9; }
.cover-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: clamp(44px, 9vw, 104px); line-height: .98; margin: 0; }
.cover-divider { width: 54px; height: 1px; background: rgba(255,255,255,.7); margin: 24px auto; }
.cover-note { font-size: 15px; line-height: 1.6; opacity: .9; font-weight: 300; max-width: 460px; margin: 0 auto; }
.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; }
.scroll-hint span { display: block; width: 1px; height: 42px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0)); animation: scrollpulse 2s ease-in-out infinite; }
@keyframes scrollpulse { 0%,100%{opacity:.3;transform:scaleY(.6)} 50%{opacity:1;transform:scaleY(1)} }

/* секция галереи */
.gallery-section { max-width: var(--max); margin: 0 auto; padding: 64px clamp(16px,4vw,24px) 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.section-head h2 { font-family: "Cormorant Garamond", serif; font-weight: 500; font-size: 32px; margin: 0; }
.gallery-tools { display: flex; gap: 10px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 7px; background: none;
  border: 1px solid var(--line); color: var(--fg); padding: 9px 14px; border-radius: 100px;
  cursor: pointer; font: inherit; font-size: 13px; transition: all .2s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.tool-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* justified grid */
.justified-grid { display: flex; flex-direction: column; gap: var(--gap); }
.jrow { display: flex; gap: var(--gap); }
.tile { position: relative; overflow: hidden; background: #f1f0ee; border-radius: var(--radius); cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .4s; opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.045); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.28)); opacity: 0; transition: opacity .3s; }
.tile:hover::after { opacity: 1; }
.tile-fav {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.32); color: #fff;
  border: none; cursor: pointer; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s;
}
.tile:hover .tile-fav { opacity: 1; transform: translateY(0); }
.tile-fav.on { opacity: 1; transform: translateY(0); color: #ff5b73; }
.tile-fav.on svg { fill: currentColor; }
.empty-fav { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }

/* подвал */
.site-footer { background: #fafafa; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px clamp(16px,4vw,24px) 24px; display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.footer-col { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.footer-brand { font-weight: 600; letter-spacing: .2em; color: var(--fg); font-size: 16px; }
.footer-col a:hover { color: var(--accent-ink); }
.footer-social { flex-direction: row; gap: 18px; align-items: flex-start; }
.footer-bottom { max-width: var(--max); margin: 0 auto; padding: 16px clamp(16px,4vw,24px); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-footer-min { text-align: center; padding: 26px 16px calc(26px + env(safe-area-inset-bottom)); margin-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .04em; }

/* лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(14,13,12,.97); display: flex; align-items: center; justify-content: center; animation: fade .25s; }
.lightbox[hidden] { display: none; }
@keyframes fade { from{opacity:0} to{opacity:1} }
.lb-toolbar { position: absolute; top: 0; left: 0; right: 0; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(22px, env(safe-area-inset-left)); color: #fff; z-index: 3; background: linear-gradient(180deg, rgba(0,0,0,.5), transparent); }
.lb-counter { font-size: 13px; letter-spacing: .1em; opacity: .85; }
.lb-actions { display: flex; gap: 4px; }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: none; border: none; color: #fff; cursor: pointer; opacity: .82; transition: all .2s; }
.lb-btn:hover { opacity: 1; background: rgba(255,255,255,.12); }
.lb-btn.on { color: #ff5b73; opacity: 1; }
.lb-btn.on svg { fill: currentColor; }
.lb-stage { max-width: 92vw; max-height: calc(100svh - 120px); display: flex; align-items: center; justify-content: center; }
.lb-stage img { max-width: 92vw; max-height: calc(100svh - 120px); object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: lbpop .35s cubic-bezier(.2,.8,.2,1); transition: filter .35s ease; cursor: zoom-out; }
.lb-stage img.lb-loading { filter: blur(16px); }
.lb-spinner { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: lbspin .8s linear infinite; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 4; }
.lb-spinner.on { opacity: 1; }
@keyframes lbspin { to { transform: rotate(360deg); } }
@keyframes lbpop { from{opacity:0;transform:scale(.97)} to{opacity:1;transform:scale(1)} }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; background: none; border: none; color: #fff; cursor: pointer; opacity: .65; transition: all .2s; z-index: 3; }
.lb-nav:hover { opacity: 1; background: rgba(255,255,255,.1); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-toast { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(255,255,255,.95); color: #1c1b1a; padding: 10px 18px; border-radius: 100px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .3s; }
.lb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* адаптив */
@media (max-width: 720px) {
  .header-right .badge-private span { display: none; }
  .cover { height: 78svh; min-height: 420px; }
  .lb-nav { width: 44px; height: 44px; opacity: .8; }
  .footer-inner { flex-direction: column; gap: 22px; }
}
@media (hover: none) {
  .tile-fav { opacity: 1; transform: none; background: rgba(0,0,0,.28); }
}
