:root {
  --page-bg: #E8E8EA;
  --body-bg: #F3F3F1;   /* фон тела папки и активной вкладки */
  --footer-bg: #DEDEE1;
  --ink: #1C1C1E;
  --ink-soft: #4A4A4E;
  --muted: #8B8B90;
  --muted-2: #6E6E73;
  --hairline: rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: 'Hanken Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(28,28,30,0.14); }

.page {
  min-height: 1000px;
  display: flex;
  flex-direction: column;
}

.shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 44px 48px 0;
  flex: 1;
}

/* ---------- HEADER ---------- */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 38px;
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand__logo { width: 34px; height: 34px; flex-shrink: 0; }
.brand__logo img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0); }
.brand__name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px; font-weight: 600; line-height: 1.1;
}
.brand__role { font-size: 13px; color: var(--muted); }

/* segmented control */
.switch {
  justify-self: center;
  display: flex;
  background: #D7D7DA;
  padding: 3px;
  border-radius: 12px;
  gap: 2px;
}
.switch__btn {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  padding: 8px 18px;
  border-radius: 10px;
  color: var(--muted-2);
  cursor: pointer;
  transition: all .15s ease;
}
.switch__btn.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* social row */
.social { justify-self: end; display: flex; align-items: center; gap: 14px; }
.social__mail { font-size: 13px; font-weight: 500; color: var(--muted-2); transition: color .15s ease; }
.social__mail:hover { color: var(--ink); }
.social__dot {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); flex-shrink: 0;
  transition: all .15s ease;
}
.social__dot:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- DEV: folder cards ---------- */
.dev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 24px;
}
.dev-grid[hidden] { display: none; }

.folder { display: flex; flex-direction: column; }

.folder__tabs {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  position: relative;
  z-index: 2;
}
.folder__tab {
  border: none;
  cursor: pointer;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14.5px; font-weight: 600;
  padding: 10px 18px 12px;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: #A8A8AD;
  font-weight: 500;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all .15s ease;
}
.folder__tab.is-active {
  background: var(--body-bg);
  color: var(--ink);
  font-weight: 600;
}

.folder__body {
  background: var(--body-bg);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  border-radius: 0 14px 14px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 6px 16px rgba(0,0,0,0.05);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.folder__inner {
  position: relative;
  z-index: 2;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* --- медиа-фон: картинка появляется ТОЛЬКО во вкладке «Подробнее» --- */
.folder__bg,
.folder__scrim { display: none; }              /* по умолчанию скрыто (короткая вкладка) */
.folder.is-media .folder__bg,
.folder.is-media .folder__scrim { display: block; }

.folder__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(1.5px);           /* слабый блюр */
  transform: scale(1.04);        /* прячем размытые края */
  z-index: 0;
}
.folder__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* лёгкое затемнение: верх почти прозрачный, к низу чуть плотнее */
  background: linear-gradient(
    180deg,
    rgba(15,15,17,0.08) 0%,
    rgba(15,15,17,0.24) 50%,
    rgba(15,15,17,0.48) 100%
  );
}

/* светлый текст — только когда активна вкладка с фото */
.folder.is-media .folder__longtext { color: #EDEDEF; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.folder.is-media .folder__rule { background: rgba(255,255,255,0.24); }
.folder.is-media .folder__link { color: #fff; }
.folder.is-media .folder__link:hover { color: rgba(255,255,255,0.72); }
.folder.is-media .folder__link .arw { color: rgba(255,255,255,0.72); }
.folder.is-media .coauthor__name { color: rgba(255,255,255,0.82); }

.folder__short {
  font-size: 14.5px; line-height: 1.55; color: var(--ink-soft);
  text-wrap: pretty;
}
.folder__long { display: flex; flex-direction: column; gap: 14px; }
.folder__longtext {
  font-size: 13.5px; line-height: 1.6; color: var(--ink-soft);
  text-wrap: pretty;
}

.coauthor { display: inline-flex; align-items: center; gap: 8px; transition: opacity .15s ease; }
.coauthor:hover { opacity: 0.7; }
.coauthor__ava {
  width: 24px; height: 24px; border-radius: 50%;
  background: #DBDBDE; color: var(--ink-soft);
  font-size: 9.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.coauthor__name { font-size: 12.5px; color: var(--muted); }

.folder__foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; }
.folder__rule { height: 1px; background: var(--hairline); margin-bottom: 12px; }
.folder__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.folder__link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: color .15s ease;
}
.folder__link:hover { color: var(--muted); }
.folder__link .arw { color: #9A9AA0; }

/* ---------- DESIGN: masonry ---------- */
.masonry { column-count: 4; column-gap: 16px; }
.masonry[hidden] { display: none; }
.masonry__item { break-inside: avoid; margin-bottom: 16px; }
.masonry__frame {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #DBDBDE;
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9A9AA0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
}
.masonry__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.05);
  cursor: zoom-in;
  transition: opacity .15s ease;
}
.masonry__img:hover { opacity: 0.88; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12,12,14,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox__close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.lightbox__close:hover { background: rgba(255,255,255,0.24); }

/* ---------- FOOTER ---------- */
.footer {
  width: 100%;
  margin-top: 64px;
  border-top: 1px solid rgba(0,0,0,0.09);
  background: var(--footer-bg);
}
.footer__grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 48px 40px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
}
.footer__label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.footer__about {
  margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft);
  max-width: 380px; text-wrap: pretty;
}

.recs { display: flex; flex-direction: column; gap: 14px; }
.rec { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; transition: opacity .15s ease; }
.rec:hover { opacity: 0.7; }
.rec__name { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.rec__role { display: block; font-size: 11.5px; color: var(--muted); }

.footer__copy {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px 32px;
  font-size: 12px;
  color: #9A9AA0;
}
