/* „След 30 години“ – платформата на випуска. Черно, слонова кост, злато и кехлибар; зад всичко – ДНК от искри. */

@font-face {
  font-family: "Prata"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/prata-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Prata"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/prata-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --night: #070605;
  --night-2: #100E0B;
  --night-3: #1A1611;
  --black: #030302;
  --ivory: #F3E9D2;
  --ivory-dim: #BDB098;
  --gold: #E3C27A;
  --gold-bright: #F6DFA6;
  --gold-deep: #8C7440;
  --on-gold: #17120A;
  --hair: rgba(227, 194, 122, 0.3);
  --hair-soft: rgba(243, 233, 210, 0.13);
  --error: #F0A79B;
  --display: "Prata", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(18px, 4.5vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  background: var(--night);
  scrollbar-color: var(--gold-deep) var(--night);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  caret-color: var(--gold);
}
::selection { background: var(--gold); color: var(--on-gold); }
::-webkit-scrollbar { width: 12px; height: 10px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: #5C4E33; border: 3px solid var(--night); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; border-radius: 6px; }

#app, .gate { position: relative; z-index: 1; }
/* Платното с ДНК-то стои зад всичко и не пречи на докосванията. */
.dna { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Бутони ---------- */

.btn-gold, .btn-outline, .btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s var(--out), color 0.25s var(--out), border-color 0.25s var(--out), transform 0.25s var(--out);
}
.btn-gold { border: 0; background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-bright); }
.btn-gold:active { transform: scale(0.98); }
.btn-gold[disabled] { opacity: 0.55; cursor: default; }
.btn-outline { border: 1px solid var(--hair); background: transparent; color: var(--gold-bright); }
.btn-outline:hover { border-color: var(--gold); background: rgba(227, 194, 122, 0.1); }
.btn-quiet { min-height: 48px; padding: 0 16px; border: 0; background: transparent; color: var(--ivory-dim); font-weight: 500; }
.btn-quiet:hover { color: var(--ivory); }

/* ---------- Вход ---------- */

.gate {
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(28px, 8vh, 90px) 22px 56px;
  text-align: center;
}
.gate-emblem { display: block; width: min(250px, 62vw); height: auto; margin: 0 auto; }
.gate h1 { margin-top: 26px; font-size: clamp(36px, 9vw, 46px); }
.gate-lead { margin: 16px 0 34px; color: var(--ivory-dim); text-wrap: pretty; }
.gate-form { text-align: left; }
.gate-form label { display: block; margin-bottom: 10px; font-weight: 600; font-size: 16px; }
.gate-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--night-2);
  transition: border-color 0.25s var(--out), box-shadow 0.25s var(--out);
}
.gate-row:focus-within { border-color: var(--gold); outline: 2px solid var(--gold); outline-offset: 2px; }
.gate-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 17px 16px;
  border: 0;
  background: transparent;
  color: var(--ivory);
  font: inherit;
  font-size: 20px;
  outline: none;
}
.gate-error { min-height: 1.6em; margin: 12px 0 6px; color: var(--error); font-weight: 600; font-size: 16px; }
.gate .btn-gold { width: 100%; min-height: 58px; font-size: 19px; }

/* ---------- Встъпление: 1996 → 2026 ---------- */

.intro { position: fixed; inset: 0; z-index: 30; }
/* Годината и искрите се рисуват на платното; тук са само линията на броенето и бутонът. */
.intro-track {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(360px, 60vw);
  height: 1px;
  margin: calc(min(13.5vw, 21vh, 160px) + 26px) 0 0 calc(min(360px, 60vw) / -2);
  background: var(--hair-soft);
  transition: opacity 0.6s ease;
}
.intro-track span { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.intro-skip { position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); transition: opacity 0.6s ease; }
.intro.landed .intro-track, .intro.landed .intro-skip { opacity: 0; }
body.intro-on #app { opacity: 0; }

/* ---------- Горна лента ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px var(--pad);
  background: rgba(7, 6, 5, 0.84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair-soft);
}
.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 20px;
  color: var(--ivory);
  white-space: nowrap;
}
.brand img { width: 46px; height: auto; }
/* Емблемата е със сини части; тук се показва в златни тонове, формите ѝ не се променят. */
.brand img, .gate-emblem { filter: sepia(1) saturate(1.25) hue-rotate(-6deg) brightness(1.04); }
.top nav { display: flex; gap: clamp(4px, 2vw, 22px); }
.top nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 17px;
  color: var(--ivory-dim);
  transition: color 0.25s var(--out);
}
.top nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--out);
}
.top nav a:hover { color: var(--ivory); }
.top nav a[aria-current="page"] { color: var(--gold-bright); }
.top nav a[aria-current="page"]::after { transform: scaleX(1); }

main { display: block; }
.view { max-width: 1440px; margin: 0 auto; padding: clamp(28px, 5vw, 60px) var(--pad) 72px; }
.view.narrow { max-width: 980px; }
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-bottom: clamp(22px, 3.5vw, 40px);
}
.view-head h1 { font-size: clamp(34px, 6vw, 62px); }
.note { margin: 12px 0 0; max-width: 46ch; color: var(--ivory-dim); text-wrap: pretty; }
.empty {
  max-width: 26em;
  margin: 12vh auto;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.35;
  color: var(--ivory-dim);
  text-wrap: balance;
}

/* ---------- Начало ---------- */

.home { position: relative; max-width: 1280px; padding-top: clamp(22px, 6vh, 70px); }
/* На тесен екран спиралата минава по диагонал през целия екран, зад текста. */
.hero { padding-top: clamp(70px, 20vh, 220px); text-align: center; }
.hero h1 { font-size: clamp(46px, 11.5vw, 104px); letter-spacing: -0.02em; color: var(--ivory); }
.hero-years {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 30px);
  margin: clamp(20px, 4vh, 40px) 0 0;
  font-family: var(--display);
  font-size: clamp(22px, 3.6vw, 34px);
  font-variant-numeric: lining-nums;
  color: var(--gold-bright);
}
.hero-years i { width: clamp(60px, 16vw, 220px); height: 1px; background: var(--gold); }
.lead { max-width: 44ch; margin: clamp(20px, 4vh, 34px) auto 0; font-size: clamp(18px, 2.4vw, 21px); color: var(--ivory-dim); text-wrap: pretty; }

.doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: clamp(44px, 11vh, 120px);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.door {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 20px;
  padding: clamp(26px, 4.5vw, 46px) clamp(14px, 3vw, 40px);
  background: rgba(7, 6, 5, 0.72);
  text-decoration: none;
  transition: background 0.5s var(--out);
}
.door + .door { border-left: 1px solid var(--hair); }
.door:hover { background: rgba(26, 22, 17, 0.9); }
.door-title { font-family: var(--display); font-size: clamp(34px, 5.4vw, 60px); line-height: 1.1; color: var(--ivory); transition: color 0.4s var(--out); }
.door:hover .door-title { color: var(--gold-bright); }
.door-text { grid-column: 1; margin-top: 12px; max-width: 34ch; color: var(--ivory-dim); text-wrap: pretty; }
.door-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--hair);
  border-radius: 50%;
  color: var(--gold);
  transition: transform 0.5s var(--out), background 0.4s var(--out), color 0.4s var(--out), border-color 0.4s var(--out);
}
.door:hover .door-go { transform: translateX(8px); background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

/* Появяване на началото след встъплението – веднъж. */
@media (prefers-reduced-motion: no-preference) {
  .reveal .hero h1 { animation: wipe-in 1.6s var(--out) 0.1s both; }
  .reveal .hero-years { animation: rise-in 1.1s var(--out) 0.8s both; }
  .reveal .hero-years i { animation: line-in 1.4s var(--out) 1s both; }
  .reveal .lead { animation: rise-in 1.1s var(--out) 1.1s both; }
  .reveal .doors { animation: doors-in 1.3s var(--out) 1.5s both; }
  .reveal .top { animation: fade-in 1s ease 1.5s both; }
  .reveal .foot { animation: fade-in 1s ease 1.9s both; }
}
@keyframes line-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wipe-in {
  from { opacity: 0; clip-path: inset(-10% 100% -10% 0); letter-spacing: 0.06em; }
  to { opacity: 1; clip-path: inset(-10% -5% -10% 0); letter-spacing: -0.01em; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes doors-in { from { opacity: 0; transform: translateY(26px); clip-path: inset(0 50% 0 50%); } to { opacity: 1; transform: none; clip-path: inset(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Снимки ---------- */

/* Редове по реда на вечерта, с въздух между снимките; нищо не се изрязва. */
.grid { --row: 26vw; display: flex; flex-wrap: wrap; gap: clamp(18px, 4.2vw, 64px); }
/* Невидим последен елемент, за да не се разтягат снимките от последния ред. */
.grid::after { content: ""; flex-grow: 1000000; }
.tile {
  position: relative;
  flex: var(--r) 1 calc(var(--r) * var(--row));
  aspect-ratio: var(--r);
  max-width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}
/* Снимката се разкрива отдолу нагоре, когато стигне до екрана. */
.tile-in {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--night-3);
  clip-path: inset(0);
  transition: clip-path 1.1s var(--out) var(--d, 0s), transform 1.2s var(--out) var(--d, 0s);
}
.tile.wait .tile-in { clip-path: inset(100% 0 0 0); transform: translateY(46px); }
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.9s var(--out), filter 0.5s ease;
}
.tile img.ready { opacity: 1; }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.35s var(--out);
  pointer-events: none;
}
.tile:hover img { transform: scale(1.05); }
.tile:hover::after, .tile:focus-visible::after { border-color: var(--gold); }
.tile:focus-visible { outline-offset: -2px; z-index: 1; }

/* ---------- Колеги ---------- */

.search { margin-bottom: clamp(26px, 4vw, 44px); }
.search label { display: block; margin-bottom: 10px; font-weight: 600; font-size: 16px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--night-2);
  color: var(--gold);
  transition: border-color 0.25s var(--out), box-shadow 0.25s var(--out);
}
.search-field:focus-within { border-color: var(--gold); outline: 2px solid var(--gold); outline-offset: 2px; }
.search-field svg { flex: 0 0 auto; }
.search-field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 17px 0;
  border: 0;
  background: transparent;
  color: var(--ivory);
  font: inherit;
  font-size: 20px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
.letters button {
  min-width: 46px;
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-family: var(--display);
  font-size: 20px;
  color: var(--gold);
  transition: border-color 0.25s var(--out), background 0.25s var(--out);
}
.letters button:hover { border-color: var(--hair); background: rgba(227, 194, 122, 0.08); }

.group {
  display: grid;
  grid-template-columns: clamp(52px, 9vw, 104px) 1fr;
  border-top: 1px solid var(--hair);
  scroll-margin-top: 84px;
}
.group-letter {
  margin: 0;
  font-weight: 400;
  position: sticky;
  top: 84px;
  align-self: start;
  padding-top: 14px;
  font-family: var(--display);
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1;
  color: var(--gold);
}
.person + .person { border-top: 1px solid var(--hair-soft); }
.person summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 18px;
  padding: 20px 4px 20px 0;
  cursor: pointer;
  list-style: none;
}
.person summary::-webkit-details-marker { display: none; }
.person .name { font-family: var(--display); font-size: clamp(23px, 3.6vw, 30px); line-height: 1.2; color: var(--ivory); overflow-wrap: anywhere; transition: color 0.3s var(--out); }
.person summary:hover .name, .person[open] .name { color: var(--gold-bright); }
.person .name { grid-column: 2; }
.person .meta { grid-column: 2; color: var(--ivory-dim); overflow-wrap: anywhere; }
.person .spec { color: var(--gold); font-weight: 500; }
.avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: clamp(58px, 9vw, 76px);
  height: clamp(58px, 9vw, 76px);
  border: 1px solid var(--hair);
  border-radius: 50%;
  overflow: hidden;
  background: var(--night-3);
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 26px);
  color: var(--gold);
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.person .chev {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hair);
  border-radius: 50%;
  color: var(--gold);
  transition: transform 0.4s var(--out), background 0.3s var(--out);
}
.person summary:hover .chev { background: rgba(227, 194, 122, 0.1); }
.person[open] .chev { transform: rotate(180deg); }
.more { padding: 0 0 26px calc(clamp(58px, 9vw, 76px) + 18px); }
.portrait { display: block; width: auto; max-width: min(100%, 300px); max-height: 380px; margin: 0 0 20px; border: 1px solid var(--hair); border-radius: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.thumb {
  display: block; flex: 0 0 auto; height: clamp(76px, 11vw, 104px); margin: 0; padding: 0;
  border: 1px solid var(--hair); border-radius: 6px; overflow: hidden; background: var(--night-3);
  cursor: pointer; transition: border-color 0.25s var(--out), transform 0.25s var(--out);
}
.thumb:hover, .thumb:focus-visible { border-color: var(--gold); transform: translateY(-2px); outline: none; }
.thumb img { display: block; height: 100%; width: auto; }
.thumb-more {
  display: grid; place-items: center; min-width: clamp(76px, 11vw, 104px); color: var(--gold);
  font-family: var(--display); font-size: 22px; text-decoration: none;
}
.bio { margin: 0 0 18px; max-width: 62ch; white-space: pre-line; overflow-wrap: anywhere; text-wrap: pretty; }
.contacts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.contacts a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  max-width: 100%;
  padding: 8px 22px 8px 16px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ivory);
  transition: border-color 0.25s var(--out), background 0.25s var(--out);
}
.contacts a:hover { border-color: var(--gold); background: rgba(227, 194, 122, 0.1); }
.contacts svg { flex: 0 0 auto; color: var(--gold); }
.contacts span { min-width: 0; overflow-wrap: anywhere; font-weight: 500; line-height: 1.25; }

.foot { position: relative; z-index: 1; padding: 0 20px 34px; text-align: center; font-size: 14px; color: var(--ivory-dim); }
.foot a { color: var(--gold); }

/* ---------- Преглед на цял екран и прожекция ---------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-auto-rows: auto;
  /* minmax(0, …) не позволява на дългата лента с малки снимки да разшири прегледа извън екрана. */
  grid-template-columns: minmax(0, 1fr);
  background: var(--black);
  color: var(--ivory);
  animation: fade-in 0.3s ease both;
}
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
.lb-count { padding-left: 8px; font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; color: var(--ivory-dim); white-space: nowrap; }
.lb-tools { display: flex; gap: 6px; }
.lb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--hair-soft);
  border-radius: 999px;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.25s var(--out), border-color 0.25s var(--out), color 0.25s var(--out);
}
.lb-btn:hover { background: rgba(243, 233, 210, 0.09); }
.lb-btn .i-pause { display: none; }
.lb-btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-bright); }
.lb-btn[aria-pressed="true"] .i-play { display: none; }
.lb-btn[aria-pressed="true"] .i-pause { display: block; }
.lb-progress { height: 2px; }
.lb-progress span { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.lb.playing .lb-progress span { animation: progress var(--slide, 5s) linear both; }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.lb-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  /* Докато прегледът е отворен, страницата отдолу не се скролира, затова жестът с пръст тук е изцяло за смяна на снимката. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lb-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.lb-stage img.on { opacity: 1; }
.lb-stage img.settle { transition: opacity 0.5s ease, transform 0.35s var(--out); }
.lb.playing .lb-stage img { transition-duration: 1.4s; }
.lb.playing .lb-stage img.on { animation: drift calc(var(--slide, 5s) + 1.6s) linear both; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }

.lb-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: -40px;
  border: 1px solid var(--hair-soft);
  border-radius: 50%;
  background: rgba(3, 3, 2, 0.62);
  transition: background 0.25s var(--out), border-color 0.25s var(--out), opacity 0.4s ease;
}
.lb-nav:hover { background: rgba(3, 3, 2, 0.92); border-color: var(--gold); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lb-nav[disabled] { opacity: 0.22; cursor: default; }

.lb-bottom {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.lb-strip {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 6px;
  padding: 4px 2px;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* Лентата се плъзга само хоризонтално и не пречи на жеста върху голямата снимка. */
  touch-action: pan-x;
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--night-3);
  opacity: 0.45;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
}
.lb-strip button:hover { opacity: 0.85; }
.lb-strip button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--gold); }
.lb-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-download { flex: 0 0 auto; }
.lb-size { font-weight: 400; font-variant-numeric: tabular-nums; }

/* По време на прожекция управлението се скрива, докато не се докосне екранът. */
.lb.playing.idle .lb-top, .lb.playing.idle .lb-bottom, .lb.playing.idle .lb-nav { opacity: 0; pointer-events: none; }
.lb-top, .lb-bottom { transition: opacity 0.6s ease; }
.lb.playing.idle { cursor: none; }

/* ---------- Размери на екрана ---------- */

@media (min-width: 700px) {
  .grid { --row: clamp(130px, 16vw, 240px); }
}
/* На широк екран текстът е вляво, а спиралата – вдясно. */
@media (min-width: 900px) {
  .hero { max-width: min(58%, 700px); padding-top: clamp(40px, 14vh, 160px); text-align: left; }
  .hero-years { justify-content: flex-start; }
  .hero .lead { margin-left: 0; }
}
@media (max-width: 760px) {
  .doors { grid-template-columns: 1fr; }
  .door + .door { border-left: 0; border-top: 1px solid var(--hair); }
  .brand span { display: none; }
  .view-head .btn-outline { width: 100%; }
  .lb-nav { width: 48px; height: 48px; }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }
  .lb-bottom { flex-direction: column; align-items: stretch; gap: 10px; }
  .lb-download { width: 100%; padding: 0 14px; font-size: 16px; }
  .lb-btn { padding: 0 13px; }
  .contacts a { width: 100%; }
}
@media (max-width: 420px) {
  .lb-btn span { display: none; }
  .lb-btn { width: 48px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.contacts a.to-photos { border-color: var(--gold); background: var(--gold); color: var(--on-gold); }
.contacts a.to-photos svg { color: var(--on-gold); }
.contacts a.to-photos:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

/* Търсачка в снимките и имена в прегледа */
#photoSearchBox { max-width: 720px; }
.search-field .btn-quiet { flex: 0 0 auto; margin-right: -10px; color: var(--gold); }
.lb-info { display: flex; align-items: baseline; gap: 14px; min-width: 0; margin: 0; }
.lb-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ivory); }
@media (max-width: 760px) {
  .more { padding-left: 0; }
  .lb-names { display: none; }
}
@media (max-width: 560px) {
  .group { grid-template-columns: 1fr; gap: 0; }
  .group-letter { position: static; padding-top: 14px; font-size: 30px; }
  .avatar { width: 52px; height: 52px; font-size: 18px; }
  .person summary { gap: 2px 14px; }
  .contacts a { padding: 8px 16px 8px 14px; gap: 10px; }
  .contacts span { font-size: 16px; }
}

/* Начало на широк екран: всичко се побира на един екран, затова размерите следват и височината му. */
@media (min-width: 900px) {
  .home { padding-top: clamp(12px, 3vh, 40px); padding-bottom: clamp(16px, 3vh, 40px); }
  .hero { max-width: min(60%, 720px); padding-top: clamp(16px, 6vh, 120px); }
  .hero h1 { font-size: clamp(40px, min(6.4vw, 10.5vh), 96px); }
  .hero-years { margin-top: clamp(12px, 3vh, 36px); font-size: clamp(20px, min(2.6vw, 4vh), 32px); }
  .hero .lead { max-width: 46ch; margin-top: clamp(12px, 3vh, 30px); font-size: clamp(16px, min(1.7vw, 2.7vh), 20px); }
  .doors { margin-top: clamp(20px, 5vh, 90px); }
  .door { padding: clamp(14px, 3vh, 40px) clamp(14px, 3vw, 40px); }
  .door-title { font-size: clamp(28px, min(4.4vw, 6.4vh), 56px); }
  .door-text { margin-top: 8px; font-size: clamp(15px, 2.4vh, 18px); }
  .door-go { width: 50px; height: 50px; }
}

/* По-сбита търсачка и по-сбит указател, за да остава място за спиралите отстрани. */
.view.narrow { max-width: 760px; }
.view.narrow .view-head h1 { font-size: clamp(32px, 4.6vw, 50px); }
.search, #photoSearchBox { max-width: 520px; }
.search-field { padding: 0 14px; border-radius: 12px; }
.search-field input { padding: 12px 0; font-size: 18px; }
.person .name { font-size: clamp(20px, 2.6vw, 25px); }
.person summary { padding-top: 14px; padding-bottom: 14px; }
@media (min-width: 761px) {
  .group { grid-template-columns: clamp(44px, 6vw, 68px) 1fr; }
  .group-letter { font-size: clamp(34px, 4.6vw, 50px); }
  .avatar { width: clamp(50px, 6vw, 60px); height: clamp(50px, 6vw, 60px); font-size: clamp(17px, 2.2vw, 21px); }
  .more { padding-left: calc(clamp(50px, 6vw, 60px) + 18px); }
}

/* ---------- Тагване на хора в прегледа на снимка ---------- */
.lb-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 6px 12px; max-height: 26vh; overflow-y: auto; }
.lb.picking .lb-bottom, .lb.picking .lb-tags { display: none; }
.lb-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.lb-people .none { color: var(--ivory-dim); font-size: 15px; padding: 8px 4px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; max-width: 100%; border: 1px solid var(--hair); border-radius: 999px; background: rgba(243, 233, 210, 0.05); }
.chip-name { padding: 0 4px 0 14px; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.chip-x { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ivory-dim); cursor: pointer; }
.chip-x:hover, .chip-x:focus-visible { color: var(--gold-bright); background: rgba(243, 233, 210, 0.08); outline: none; }
.lb-tag-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--hair); border-radius: 999px; background: none; color: var(--ivory); font: inherit; font-size: 16px; cursor: pointer; }
.tag-btn:hover, .tag-btn:focus-visible { border-color: var(--gold); color: var(--gold-bright); outline: none; }
.tag-btn-gold { border-color: var(--gold); background: var(--gold); color: var(--on-gold); font-weight: 600; }
.tag-btn-gold:hover, .tag-btn-gold:focus-visible { background: var(--gold-bright); color: var(--on-gold); }
.lb-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--hair-soft); background: rgba(227, 194, 122, 0.08); font-size: 16px; }
.lb-toast button { min-height: 40px; padding: 0 14px; border: 1px solid var(--gold); border-radius: 999px; background: none; color: var(--gold-bright); font: inherit; cursor: pointer; }
.lb-panel { max-height: min(48vh, 420px); overflow-y: auto; padding: 12px; border-top: 1px solid var(--hair); background: var(--night-2); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.lb-panel h3 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 20px; }
.lb-panel p { margin: 0 0 12px; font-size: 16px; line-height: 1.45; }
.panel-find { display: block; width: 100%; max-width: 520px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 8px; background: var(--night); color: var(--ivory); font: inherit; font-size: 17px; }
.panel-find:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.pick-list button { display: block; width: 100%; min-height: 46px; padding: 8px 14px; border: 1px solid var(--hair-soft); border-radius: 8px; background: none; color: var(--ivory); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.pick-list button:hover, .pick-list button:focus-visible { border-color: var(--gold); outline: none; }
.pick-list small { display: block; color: var(--ivory-dim); font-size: 13px; }
.pick-empty { margin: 10px 0 0; color: var(--ivory-dim); font-size: 15px; }
.panel-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 760px) {
  .lb-tag-actions { width: 100%; }
  .lb-tag-actions .tag-btn { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 420px) {
  .lb-tag-actions .tag-btn { padding: 0 10px; gap: 6px; font-size: 15px; }
  .lb-tag-actions .tag-btn svg { display: none; }
}
