/* DesssssignTool — базовая типографика и сетка */

:root {
  --paper:      #efece5;
  --paper-2:    #e6e2d9;
  --paper-3:    #dcd7cc;
  --ink:        #16150f;
  --ink-2:      #3b3930;
  --muted:      #8b877a;
  --line:       #d3cec2;
  --line-soft:  #e0dbd0;

  --stage-dark:  #17161a;
  --stage-light: #e2ded5;

  --gutter: clamp(20px, 4.2vw, 72px);
  --maxw: 1560px;

  --t-fast: .18s cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

/* Inter Variable даёт более плотный набор, если шрифт доступен */
@supports (font-variation-settings: normal) {
  body { font-family: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------------------------------------------------------- */
/*  Шапка                                                            */
/* ---------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 62px;
}

.brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.05em;
  white-space: nowrap;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(13px, 2vw, 30px);
  font-size: 13.5px;
  letter-spacing: -0.014em;
  color: var(--muted);
  /* На узких экранах список кистей прокручивается, а не ломает шапку */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-left: 2px;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { white-space: nowrap; }

.site-nav a { transition: color var(--t-fast); }
.site-nav a:hover,
.site-nav a[aria-current='page'] { color: var(--ink); }

/* ---------------------------------------------------------------- */
/*  Титульный экран                                                  */
/* ---------------------------------------------------------------- */

.hero { padding: clamp(56px, 11vw, 150px) 0 clamp(40px, 7vw, 92px); }

.hero h1 {
  font-size: clamp(2.9rem, 10.5vw, 10.5rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.058em;
  text-indent: -0.04em;
  max-width: 14ch;
}

.hero-foot {
  margin-top: clamp(32px, 5vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: end;
}

.hero-lead {
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.45;
  letter-spacing: -0.017em;
  color: var(--ink-2);
  max-width: 46ch;
}

.hero-meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 34ch;
  justify-self: end;
  text-align: right;
}

/* ---------------------------------------------------------------- */
/*  Секции                                                           */
/* ---------------------------------------------------------------- */

.section { padding: clamp(40px, 6vw, 88px) 0; border-top: 1px solid var(--line-soft); }

.section-label {
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: var(--muted);
  margin-bottom: clamp(24px, 3.4vw, 46px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.section h2 {
  font-size: clamp(1.9rem, 5.2vw, 4.6rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.052em;
  max-width: 18ch;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 96px);
  align-items: start;
}

.prose p {
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.014em;
  color: var(--ink-2);
  max-width: 52ch;
}
.prose p + p { margin-top: 1.1em; }
.prose strong { font-weight: 500; color: var(--ink); }

kbd {
  font: inherit;
  font-size: 0.86em;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 2px;
  color: var(--ink-2);
  white-space: nowrap;
}

.facts {
  margin-top: clamp(28px, 4vw, 52px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.facts div { background: var(--paper); padding: 20px 22px; }
.facts dt { font-size: 12.5px; color: var(--muted); letter-spacing: -0.01em; }
.facts dd {
  font-size: clamp(1.5rem, 2.6vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin-top: 6px;
}

/* ---------------------------------------------------------------- */
/*  Карточки кистей                                                  */
/* ---------------------------------------------------------------- */

/* Пятнадцать карточек ложатся ровно по три в ряд */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.grid > * { grid-column: span 2; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: 18px 18px 20px;
  transition: background var(--t-fast);
}
.card:hover { background: var(--paper-2); }

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stage-dark);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .card-media img { transform: scale(1.028); }
.card-media--light { background: var(--stage-light); }

.card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.card h3 {
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.card-index { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.card p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--muted);
  max-width: 40ch;
}

.card-open {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: -0.012em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.card-open span { transition: transform var(--t-fast); }
.card:hover .card-open span { transform: translateX(4px); }

.card > a.card-link { position: absolute; inset: 0; }

/* ---------------------------------------------------------------- */
/*  Подвал                                                           */
/* ---------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0;
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.site-foot .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.site-foot a { color: var(--ink); }

/* ---------------------------------------------------------------- */

@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > * { grid-column: span 1; }
}

@media (max-width: 760px) {
  .hero-foot { grid-template-columns: 1fr; }
  .hero-meta { justify-self: start; text-align: left; }
  .two-col { grid-template-columns: 1fr; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > * { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- */
/*  Переключатель кистей в шапке инструмента                         */
/* ---------------------------------------------------------------- */

.head-right { display: flex; align-items: center; gap: 16px; min-width: 0; }

.head-current {
  font-size: 13.5px;
  letter-spacing: -0.014em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brush-menu { position: relative; flex: none; }

.brush-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  letter-spacing: -0.014em;
  padding: 5px 13px;
  border: 1px solid #000000;
  border-radius: 999px;
  white-space: nowrap;
  transition: all var(--t-fast);
  background: #000000;
  color: #ffffff;
}

.brush-menu summary:hover {
  border-color: #333333;
  background: #1a1a1a;
}

.brush-menu[open] summary {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.brush-menu summary::-webkit-details-marker { display: none; }
.brush-menu summary:hover { border-color: var(--ink); }
.brush-menu[open] summary { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.brush-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 264px;
  max-height: 68vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 18px 40px -14px rgba(20, 20, 15, .3);
}

.brush-menu-panel a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13.5px;
  letter-spacing: -0.016em;
  color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.brush-menu-panel a i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.brush-menu-panel a:hover { background: var(--paper-2); color: var(--ink); }
.brush-menu-panel a[aria-current='page'] { color: var(--ink); font-weight: 500; }
.brush-menu-panel a[aria-current='page'] i { color: var(--ink); }
