/* ---------------------------------------------------------------
   ТОДОР СТОЯНОВ — визитка / портфолио
   Пастелен цветен облак с мотивите от кутиите
   --------------------------------------------------------------- */

:root {
  /* пастелните тонове са извадени от снимките на кутиите */
  --c-blue:   #b3d6f8;   /* синьото на фламингото */
  --c-yellow: #fbe098;   /* жълтото на папагала */
  --c-pink:   #fbbedb;   /* розовото на фламингото */
  --c-orange: #fbc6a5;   /* оранжевото на пандата */
  --c-beige:  #f2dcbd;   /* крафт кутията */
  --c-green:  #d2e6b2;   /* листата */
  --c-purple: #d6cbf2;   /* лилавата кутия */
  --paper:    #fdfaf5;

  /* Цялата типография е в гамата на кутията с фламингото: тъмно синьо за
     четене, циклама за акцентите, розово върху цикламените плоскости. */
  --ink:     #1b3552;   /* тъмното синьо на кутията */
  --ink-dim: #4d6b8a;
  --accent:      #9c0050;   /* цикламеното поле */
  --accent-deep: #7a0045;

  --line:       #c7dcf0;

  /* кутията с фламингото: синьо тяло и цикламено поле с логото.
     Наситените тонове от снимката са #5794d2 и #ff71b5, но върху тях
     буквите не се четат (контраст под 1.9), затова за фон върви светлото
     синьо на палитрата, а за букви — наситената циклама. */
  --cyclamen:      #9c0050;   /* цикламеното поле, снишено за четимост */
  --cyclamen-deep: #7a0045;   /* същото при hover */
  --blue-line:     #8ab8e4;   /* ръбът на синята кутия */

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1180px;
  --radius: 4px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;

  /* многоцветният облак: меки петна от цветовете на кутиите */
  background:
    radial-gradient(58% 46% at 10% 4%,  var(--c-orange) 0%, transparent 62%),
    radial-gradient(52% 42% at 88% 2%,  var(--c-yellow) 0%, transparent 60%),
    radial-gradient(56% 48% at 82% 32%, var(--c-blue)   0%, transparent 62%),
    radial-gradient(48% 40% at 14% 40%, var(--c-pink)   0%, transparent 60%),
    radial-gradient(54% 44% at 52% 62%, var(--c-green)  0%, transparent 62%),
    radial-gradient(46% 38% at 92% 74%, var(--c-purple) 0%, transparent 60%),
    radial-gradient(50% 42% at 8% 88%,  var(--c-beige)  0%, transparent 60%),
    var(--paper);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.16;
  margin: 0 0 .5em;
  letter-spacing: 0;
  color: var(--ink);
}
h1, h2 { color: var(--cyclamen); }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.eyebrow {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9em; font-weight: 700;
}

.section-lede { color: var(--ink-dim); max-width: 56ch; font-size: 1.05rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: .6rem 1rem; font-weight: 700;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------- джунглата ---------------------------- */
/* Мотивите са изрязани от снимките на кутиите и пуснати да се движат
   зад съдържанието. Слоят не приема кликания. */

.jungle {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.jungle img {
  position: absolute;
  height: auto;   /* иначе височината от атрибута надделява над ширината */
  filter: drop-shadow(0 10px 18px rgba(80, 50, 30, .18));
  will-change: transform;
}

/* Гирляндата виси отгоре, шумата стеле дъното, а животните стоят
   ниско по нея, извън колоната с текста. Без движение. */
/* Лентите се изрязват на височина, иначе заемат целия екран.
   Селекторът е с .jungle отпред, за да бие height:auto по-горе. */
.jungle img.j-shuma-gore {
  top: 0; left: 0; width: 100%;
  height: clamp(90px, 16vh, 180px);
  object-fit: cover; object-position: center top;
}
.jungle img.j-shuma-dolu {
  bottom: 0; left: 0; width: 100%;
  height: clamp(110px, 20vh, 220px);
  object-fit: cover; object-position: center bottom;
}

/* Лявата колона (7vw) е извън панела с текста и трите се виждат изцяло:
   пандата горе точно под шумата, туканът долу. Фламингото е една колона
   по-навън, по височина между тях. */
.j-panda    { top: 18vh;    left: 7vw;   width: clamp(95px, 11vw, 185px); }
.j-flamingo { top: 36vh;    left: -1vw;  width: clamp(80px, 9vw, 155px); }
.j-tukan    { bottom: 18vh; left: 7vw;   width: clamp(120px, 14vw, 235px); }
/* Клонът на лемура е диагонален — върхът му опира десния ръб на екрана,
   долният му край стъпва в шумата. */
.j-lemur    { bottom: 17vh; right: 0;    width: clamp(110px, 13vw, 215px); }
.j-papagal  { top: 21vh;    right: 6vw;  width: clamp(140px, 16vw, 270px); }

.j-kakao-1 { top: 9vh;  left: 20vw;  width: clamp(38px, 4vw, 66px); }
.j-kakao-2 { top: 7vh;  right: 33vw; width: clamp(38px, 4vw, 66px); }
.j-kakao-3 { top: 11vh; right: 17vw; width: clamp(36px, 3.8vw, 62px); }

/* на тесни екрани остават само няколко, за да не задръстят */
@media (max-width: 760px) {
  .j-kakao-1, .j-kakao-2, .j-kakao-3, .j-flamingo { display: none; }
  .jungle img { filter: none; opacity: .85; }
}

/* ------------------------------ header ------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(253, 250, 245, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 126px; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand-logo { width: auto; height: 104px; }

@media (max-width: 760px) {
  .header-inner { min-height: 96px; }
  .brand-logo { height: 76px; }
}
@media (max-width: 440px) {
  .header-inner { min-height: 82px; }
  .brand-logo { height: 62px; }
}

.nav { display: flex; gap: 1.9rem; }
.nav a {
  text-decoration: none; font-size: .88rem; font-weight: 600;
  color: var(--ink-dim); position: relative; padding: .25rem 0;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: .8rem; }

.lang { display: flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; }
.lang button {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-dim); font-family: inherit;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  padding: .4rem .7rem;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.lang button.is-active { background: var(--accent); color: var(--c-pink); }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.burger span {
  display: block; width: 22px; height: 2px; background: var(--ink);
  margin: 4px 0; transition: transform .3s var(--ease), opacity .2s var(--ease);
}

/* ------------------------------ hero --------------------------- */

main, .site-header, .site-footer { position: relative; z-index: 1; }

.hero { position: relative; overflow: hidden; }
.hero-bg { display: none; }

.hero-inner {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.4rem, 3vw, 2.6rem) clamp(2.5rem, 6vw, 4rem);
  max-width: 44rem;
  margin-block: clamp(2rem, 5vw, 4rem);
  /* мека подложка, за да се чете текстът върху шумата */
  background: rgba(255, 253, 249, .74);
  backdrop-filter: blur(3px);
  border-radius: 10px;
}
.hero h1 { margin-bottom: .35em; }
.hero .lede {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--ink-dim); max-width: 46ch;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }

.btn {
  display: inline-block; text-decoration: none;
  font-size: .85rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .95rem 1.9rem; border-radius: 100px;
  transition: transform .25s var(--ease), background .25s var(--ease),
              color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
/* Двата бутона повтарят двойката на филтрите: цикламен с розово за главния,
   син с циклама за втория. */
.btn-primary { background: var(--accent); color: var(--c-pink); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--c-blue); border: 1px solid var(--blue-line); color: var(--accent); }
.btn-ghost:hover { border-color: var(--accent); }

/* Цветната лента цитира всичките кутии, затова остава пъстра. Ползва се и
   под заглавната част, и под „За мен“. */
.strip {
  height: 4px;
  background: linear-gradient(90deg, var(--c-orange), var(--c-yellow), var(--c-green), var(--c-blue), var(--c-pink), var(--c-purple));
  opacity: .9;
}

/* ------------------------------ stats -------------------------- */

.stats { background: rgba(255, 253, 249, .78); }
.stats-inner {
  display: grid; grid-template-columns: repeat(3, 1fr);
  text-align: center; padding: 2.6rem 0;
}
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--accent); line-height: 1;
}
.stat span {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim);
}

/* ------------------------------ about -------------------------- */

section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.stats, .hero { padding: 0; }

/* Лентата стъпва на самия ръб на секцията, както под заглавната част,
   вместо да увисне в отстъпа отдолу. */
.about { padding-bottom: 0; }
.about .strip { margin-top: clamp(3.5rem, 8vw, 6.5rem); }

/* Текстът е отгоре на цялата ширина, снимките минават под него в един ред. */
.about-inner {
  display: grid; grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
}
.about-text p {
  color: var(--ink-dim);
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  max-width: 70ch;   /* иначе редовете стават неудобно дълги */
}

.about-media { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.about-media img {
  width: 100%; height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(80, 50, 30, .16);
}
.about-media img:nth-child(odd) { transform: translateY(-14px); }

/* ------------------------------ boxes -------------------------- */

/* фонът е на самото каре, не на цялата секция */
.box-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem; margin-top: 2.5rem;
}
.box-card {
  padding: 0; border: 0; cursor: pointer; background: none;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 10px 26px rgba(80, 50, 30, .2);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.box-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(80, 50, 30, .3); }
.box-card img { width: 100%; height: auto; transition: transform .6s var(--ease); }
.box-card:hover img { transform: scale(1.04); }

/* ------------------------------ gallery ------------------------ */

.gallery { background: rgba(255, 253, 249, .78); }

.gallery-tools {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  margin: 2.4rem 0 1.2rem;
}

.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button {
  background: var(--c-blue); cursor: pointer; font-family: inherit;
  border: 1px solid var(--blue-line); color: var(--cyclamen);
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  padding: .5rem 1rem; border-radius: 100px;
  transition: all .25s var(--ease);
}
.filters button:hover { border-color: var(--cyclamen); }
.filters button.is-active { background: var(--cyclamen); border-color: var(--cyclamen); color: var(--c-pink); }

.search { flex: 0 1 260px; }
.search input {
  width: 100%; font-family: inherit; font-size: .9rem;
  background: rgba(255, 255, 255, .8); color: var(--ink);
  border: 1px solid var(--line); border-radius: 100px; padding: .6rem 1.1rem;
}
.search input::placeholder { color: var(--ink-dim); opacity: .8; }
.search input:focus { border-color: var(--accent); outline: none; }

.result-count {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); margin: 0 0 1.4rem;
}

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--c-blue);
  border: 1px solid var(--blue-line);
  border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  padding: 0; text-align: left; font-family: inherit; color: inherit;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  box-shadow: 0 6px 16px rgba(80, 50, 30, .14);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(80, 50, 30, .24); }

/* No aspect-ratio and no object-fit here on purpose: the label crops are not
   all the same shape, and any fixed box would shave a slice off some of them.
   height:auto lets every photo show in full. */
.card img { width: 100%; height: auto; transition: transform .5s var(--ease); }
.card:hover img { transform: scale(1.05); }

.card-body {
  padding: .8rem .9rem 1rem;
  background: var(--c-blue);
  border-top: 1px solid var(--blue-line);
}
.card-body h3 {
  font-family: var(--font-body);
  font-size: .92rem; font-weight: 700; line-height: 1.3;
  margin: 0 0 .25rem; color: var(--cyclamen);
}
.card-body span {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyclamen); opacity: .9;
}

.empty { text-align: center; color: var(--ink-dim); padding: 3rem 0; }

/* ------------------------------ process ------------------------ */

/* Същата мека подложка като в заглавната част — иначе животните от
   неподвижния слой минават през текста и той не се чете. Ползва се от
   „За мен“, „Кутиите“, „Как се ражда един бонбон“ и „Да направим кутия
   за теб“. */
.about .wrap, .boxes .wrap, .process .wrap, .contact .wrap {
  /* по-голям страничен отстъп от другите секции, за да личи че е каре,
     но на телефон се свива, иначе остава неоправдано тясно */
  width: min(100% - clamp(2.5rem, 8vw, 5rem), 58rem);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.4rem, 3vw, 2.6rem);
  background: rgba(255, 253, 249, .74);
  backdrop-filter: blur(3px);
  border-radius: 10px;
}

/* Точно две колони, за да са четирите стъпки две по две. С auto-fit на широк
   екран се събираха три и оставаше една сама на втория ред. */
.steps {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem clamp(1.6rem, 4vw, 3rem);
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
}
.steps li { border-top: 2px solid var(--line); padding-top: 1.2rem; }
.step-no {
  font-family: var(--font-display); font-size: 1.5rem; color: var(--accent);
  display: block; margin-bottom: .4rem;
}
.steps h3 { margin-bottom: .4rem; }
.steps p { color: var(--ink-dim); font-size: .93rem; margin: 0; }

/* ------------------------------ contact ------------------------ */

/* фонът е на самото каре, не на цялата секция */
.contact-inner {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.contact-list span {
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim);
}
.contact-list a, .contact-list b {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  text-decoration: none; color: var(--ink);
  transition: color .25s var(--ease);
}
.contact-list a:hover { color: var(--accent); }

/* --------------------------- бутон нагоре ---------------------- */

.to-top {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  width: 46px; height: 46px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; line-height: 1;
  cursor: pointer; font-family: inherit;
  background: var(--accent); color: var(--c-pink);
  border: 1px solid var(--accent); border-radius: 100px;
  box-shadow: 0 6px 18px rgba(27, 53, 82, .28);
  /* visibility, а не hidden/display: така преходът работи и не трябва
     да се чака кадър, за да се хване */
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease),
              visibility 0s linear .25s, background .25s var(--ease);
}
.to-top.is-visible {
  opacity: 1; visibility: visible; transform: none;
  transition-delay: 0s;
}
.to-top:hover { background: var(--accent-deep); }

/* ------------------------------ footer ------------------------- */

.site-footer {
  background: rgba(253, 250, 245, .82);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 1.4rem 0;
}
.footer-inner {
  display: flex; flex-direction: column; gap: .7rem;
  justify-content: center; align-items: center;
  min-height: 96px;
}
.footer-logo { width: auto; height: 76px; }
.site-footer p { margin: 0; font-size: .85rem; color: var(--ink-dim); }

@media (max-width: 440px) {
  .footer-inner { min-height: 72px; }
  .footer-logo { height: 58px; }
}

/* ------------------------------ lightbox ----------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 26, 43, .93);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.lightbox[hidden] { display: none; }

.lb-figure { margin: 0; max-width: 760px; width: 100%; }
.lb-figure img { width: 100%; border-radius: var(--radius); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); }
.lb-figure figcaption {
  text-align: center; padding-top: 1.1rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.lb-figure strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: #fff; }
.lb-figure span {
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--c-pink);
}

.lb-close, .lb-nav {
  background: none; border: 0; cursor: pointer; color: #fff; line-height: 1;
  transition: color .25s var(--ease), transform .25s var(--ease);
}
.lb-close { position: absolute; top: 1.2rem; right: 1.6rem; font-size: 2.4rem; }
.lb-nav { font-size: 3.2rem; padding: 0 1rem; flex: none; }
.lb-close:hover, .lb-nav:hover { color: var(--c-yellow); }
.lb-next:hover { transform: translateX(3px); }
.lb-prev:hover { transform: translateX(-3px); }

/* ------------------------------ responsive --------------------- */

@media (max-width: 900px) {
  .contact-inner { grid-template-columns: 1fr; }
  /* четирите снимки в един ред стават твърде тесни — минават две по две */
  .about-media { grid-template-columns: 1fr 1fr; }
  .about-media img:nth-child(odd) { transform: none; }
}

@media (max-width: 760px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 96px 0 auto;
    background: var(--paper);
    flex-direction: column; gap: 0;
    padding: .5rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(80, 50, 30, .18);
    transform: translateY(-120%);
    transition: transform .35s var(--ease);
  }
  .nav.is-open { transform: translateY(0); }
  .nav a { padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }

  .stats-inner { grid-template-columns: 1fr; gap: 1.6rem; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); padding-top: 1.6rem; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
  .lb-nav { font-size: 2.2rem; padding: 0 .3rem; }
}
