/* ------------------------------------------------------------------ шрифты */

@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif-cyrillic-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif-cyrillic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Serif";
  src: url("../fonts/pt-serif-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bad Script";
  src: url("../fonts/bad-script-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Bad Script";
  src: url("../fonts/bad-script-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

/* ------------------------------------------------------------------ токены */

:root {
  --paper: #f6f6f9;
  --paper-2: #ebeaf2;
  --ink: #191633;
  --ink-2: #4a4766;
  --violet: #3b2bc4;
  --violet-deep: #24198c;
  --violet-soft: #e4e1fa;
  --red: #d4321f;
  --rule: #d8d6e4;
  --scrollbar: #b7b3d6;
  --on-violet: #f6f6f9;
  --on-violet-2: #cfcaf5;
  --on-violet-3: #b7b1ec;
  --on-violet-rule: rgb(246 246 249 / 0.2);
  --close-bg: var(--violet-deep);
  --pencil-light: #ff8f7d;
  --pencil-note-light: #ffb2a6;
  --shadow-ink: 25 22 51;

  --f-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "PT Serif", Georgia, "Times New Roman", serif;
  --f-hand: "Bad Script", "Segoe Print", cursive;

  --gutter: clamp(1rem, 4vw, 3rem);
  --page: min(100% - 2 * var(--gutter), 76rem);
  --col-gap: clamp(1.5rem, 4vw, 4rem);
  --margin-col: minmax(0, 13.5rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pencil: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: light;
}

/* Тёмная тема: по настройке системы. Бумага — густые штемпельные чернила,
   акцентный фиолетовый и карандаш светлеют, чтобы держать контраст.
   Кнопки и выбранные фильтры инвертируются сами: текст на них — цвет бумаги. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121120;
    --paper-2: #1c1a2e;
    --ink: #ecebf6;
    --ink-2: #aeabc8;
    --violet: #a59cff;
    --violet-deep: #c4beff;
    --violet-soft: #26224a;
    --red: #ff6f5c;
    --rule: #2f2c48;
    --scrollbar: #4a4570;
    --close-bg: #1f1858;
    --shadow-ink: 0 0 0;
    color-scheme: dark;
  }

  .hero__photo img,
  .article img {
    filter: brightness(0.92);
  }
}

/* ------------------------------------------------------------------ база */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--scrollbar) var(--paper);
  caret-color: var(--violet);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--violet);
  color: var(--paper);
}

/* Атрибут hidden сильнее любых display у компонентов (кнопки, строки списка) */
[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  transition: text-decoration-color 150ms ease, color 150ms ease;
}

a:hover {
  text-decoration-color: var(--red);
}

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

.icon {
  width: 0.85em;
  height: 0.85em;
  flex: none;
  display: inline-block;
  vertical-align: -0.05em;
  margin-left: 0.35em;
  transition: transform 250ms var(--ease-out);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.375rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

/* Поля и текст: левая колонка — пометки на полях, правая — основной текст */
.grid {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  column-gap: var(--col-gap);
  width: var(--page);
  margin-inline: auto;
}

.margin {
  grid-column: 1;
}

.main {
  grid-column: 2;
}

/* ------------------------------------------------------------------ шапка */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0.85rem max(var(--gutter), (100% - 76rem) / 2);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.is-scrolled .masthead {
  border-bottom-color: var(--rule);
}

.masthead__name {
  font-weight: 680;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}

.masthead__nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.975rem;
  font-weight: 500;
}

.masthead__nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding-block: 0.35rem;
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 2px;
  transition: color 150ms ease, background-size 300ms var(--ease-out);
}

.masthead__nav a:hover,
.masthead__nav a[aria-current] {
  color: var(--ink);
  background-size: 100% 2px;
}

/* ------------------------------------------------------------------ кнопки */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: 0.8em 1.4em;
  border: 1.5px solid var(--violet);
  border-radius: 0.5rem;
  background: var(--violet);
  color: var(--paper);
  font: 600 1rem/1.2 var(--f-sans);
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover {
  background: var(--violet-deep);
  border-color: var(--violet-deep);
}

.button:active {
  transform: translateY(1px);
}

.button--ghost {
  background: transparent;
  color: var(--violet);
}

.button--ghost:hover {
  background: var(--violet-soft);
  border-color: var(--violet);
}

.button--small {
  min-height: 2.75rem;
  padding: 0.55em 1.1em;
  font-size: 0.9375rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--violet);
  font-weight: 600;
  text-decoration: none;
}

.link-arrow:hover .icon {
  transform: translateX(4px);
}

/* ------------------------------------------------------------------ первый экран */

.hero {
  padding-block: clamp(2rem, 4.5vw, 4rem) clamp(4rem, 9vw, 7rem);
  align-items: start;
}

.hero__photo {
  position: relative;
  margin-top: 0.5rem;
}

.hero__photo img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.25rem;
  background: var(--paper-2);
}

.hero__note {
  margin-top: 1rem;
  font-family: var(--f-hand);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--red);
  rotate: -3deg;
  transform-origin: 0 50%;
}

.proof {
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.proof__draft {
  max-width: 34ch;
  font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.5rem);
  line-height: 1.45;
  font-weight: 420;
  color: var(--ink-2);
}

.proof__strike {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 58% / 100% 0.1em;
}

.proof__note {
  flex: none;
  rotate: -6deg;
  font-family: var(--f-hand);
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1;
  color: var(--red);
}

.hero__title {
  font-size: clamp(3rem, 1.2rem + 5.2vw, 5.75rem);
  line-height: 0.98;
  font-weight: 680;
  letter-spacing: -0.04em;
}

.hero__accent {
  color: var(--violet);
}

.hero__lede {
  text-wrap: pretty;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 44ch;
  font-family: var(--f-serif);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* Корректура: зачёркивание, пометка на полях, чистовик.
   По умолчанию всё видно — анимация только при включённом JS и без reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .js .proof__strike {
    background-size: 0% 0.1em;
  }
  .js .proof__note {
    clip-path: inset(-20% 100% -20% 0);
  }

  .js.ready .proof__strike {
    animation: strike 760ms var(--ease-pencil) 120ms both;
  }
  .js.ready .proof__draft {
    animation: settle 500ms ease 880ms both;
  }
  .js.ready .proof__note {
    animation: write 520ms var(--ease-pencil) 820ms both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .proof__draft {
    opacity: 0.8;
  }
}

@keyframes strike {
  from { background-size: 0% 0.1em; }
  to { background-size: 100% 0.1em; }
}

@keyframes settle {
  to { opacity: 0.8; }
}

@keyframes write {
  from { clip-path: inset(-20% 100% -20% 0); }
  to { clip-path: inset(-20% 0 -20% 0); }
}


/* ------------------------------------------------------------------ секции */

.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
  border-top: 1px solid var(--rule);
  row-gap: 0;
}

.section__label {
  grid-row: 1;
  font-family: var(--f-hand);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--red);
  rotate: -3deg;
  transform-origin: 0 50%;
  padding-top: 0.4rem;
}

.section__title {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  line-height: 1.04;
  font-weight: 660;
  letter-spacing: -0.035em;
  max-width: 18ch;
  text-wrap: balance;
}

.section__lede {
  margin-top: 1.25rem;
  max-width: 52ch;
  font-family: var(--f-serif);
  font-size: 1.125rem;
  color: var(--ink-2);
}

/* Что умею: две группы — управление и текст */
.skills-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem var(--col-gap);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.skills__title {
  padding-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--violet);
}

.skills {
  border-bottom: 1px solid var(--rule);
}

.skills li {
  padding-block: 1.1rem 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.625rem);
  line-height: 1.25;
  font-weight: 480;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

/* Цитата из речи */
.quote__body {
  font-family: var(--f-serif);
  font-size: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 24ch;
  text-wrap: balance;
  hanging-punctuation: first;
}

.quote blockquote {
  margin: 0;
}

.pencil {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 92% / 100% 0.08em;
  color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  .js .pencil {
    background-size: 0% 0.08em;
    transition: background-size 1100ms var(--ease-pencil);
  }
  .js .pencil.is-in {
    background-size: 100% 0.08em;
  }
}

.quote__source {
  margin-top: 1.75rem;
  max-width: 52ch;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.quote__source a {
  color: var(--violet);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Избранное */
.features {
  grid-column: 1 / -1;
  display: grid;
  gap: clamp(3.5rem, 8vw, 6.5rem);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--col-gap);
  align-items: center;
}

.feature:nth-child(even) {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.feature:nth-child(even) .feature__media {
  order: 2;
}

.feature__media {
  overflow: hidden;
  border-radius: 0.25rem;
  background: var(--paper-2);
}

.feature__media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}

.feature:hover .feature__media img,
.feature:focus-within .feature__media img {
  transform: scale(1.03);
}

.feature__note {
  margin-bottom: 0.9rem;
  font-family: var(--f-hand);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--red);
  rotate: -3deg;
  transform-origin: 0 50%;
}

.feature__media--wide img {
  aspect-ratio: 16 / 9;
}

.feature__meta {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--violet);
}

.feature__title {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.feature__title a,
.work__link {
  text-decoration: none;
}

.feature__title a::after,
.work__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.feature__title a span,
.feature__title a {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 96% / 0 2px;
  transition: background-size 450ms var(--ease-out);
}

.feature:hover .feature__title a,
.feature:focus-within .feature__title a {
  background-size: 100% 2px;
}

.feature__text {
  margin-top: 1rem;
  max-width: 42ch;
  font-family: var(--f-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.feature__cta {
  display: inline-flex;
  align-items: center;
  margin-top: 1.25rem;
  font-weight: 600;
  color: var(--violet);
}

.feature:hover .feature__cta .icon,
.feature:focus-within .feature__cta .icon {
  transform: translateX(4px);
}

/* Все работы */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75rem;
  padding: 0.45em 1em;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 0.9375rem/1.2 var(--f-sans);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.chip:hover {
  border-color: var(--violet);
  background: var(--violet-soft);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip__count {
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  opacity: 0.75;
}

.works {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.work {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding-block: 1.15rem;
  border-top: 1px solid var(--rule);
}

.work[hidden],
.js .works:not(.is-open) .work.is-extra {
  display: none;
}

.works__more {
  margin-top: 2rem;
}

.work__inner {
  display: contents;
}

.work__venue {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--ink-2);
}

.work__kind {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--violet);
}

.work__link {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.3;
  font-weight: 520;
  letter-spacing: -0.01em;
  max-width: 56ch;
}

.work__title {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 2px;
  transition: background-size 450ms var(--ease-out);
}

.work:hover .work__title {
  background-size: 100% 2px;
}

.work__link .icon {
  color: var(--violet);
}

.work:hover .work__link .icon {
  transform: translate(2px, -2px);
}

.work__link:focus-visible {
  outline: none;
}

.work:has(.work__link:focus-visible) {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

::view-transition-group(*) {
  animation-duration: 380ms;
  animation-timing-function: var(--ease-out);
}

::view-transition-old(*):only-child {
  animation-duration: 160ms;
}

/* Опыт */
.path {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.path__row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding-block: 1.35rem;
  border-top: 1px solid var(--rule);
}

.path__when {
  font-weight: 620;
  color: var(--violet);
}

.path__what {
  max-width: 46ch;
  font-family: var(--f-serif);
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
}

.path__row--now .path__what {
  font-weight: 700;
}

.path__more {
  margin-top: 2rem;
}

.path__study {
  max-width: 46ch;
  margin-bottom: 1.25rem;
  font-family: var(--f-serif);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.path__study .path__when {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--f-sans);
}

/* ------------------------------------------------------------------ контакты */

.close {
  background: var(--close-bg);
  color: var(--on-violet);
}

.close ::selection {
  background: var(--on-violet);
  color: var(--close-bg);
}

.close :focus-visible {
  outline-color: var(--on-violet);
}

.close__inner {
  padding-block: clamp(5rem, 12vw, 9rem) clamp(4rem, 8vw, 6rem);
}

.close__note {
  font-family: var(--f-hand);
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--pencil-note-light);
  rotate: -3deg;
  transform-origin: 0 50%;
  padding-top: 1rem;
}

.close__title {
  font-size: clamp(3rem, 1.4rem + 6vw, 6rem);
  line-height: 0.98;
  font-weight: 680;
  letter-spacing: -0.04em;
}

.close__lede {
  margin-top: 1.25rem;
  max-width: 40ch;
  font-family: var(--f-serif);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--on-violet-2);
}

.close__list {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--on-violet-rule);
}

.close__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--on-violet-rule);
  text-decoration: none;
  color: var(--on-violet-2);
  transition: color 150ms ease;
}

.close__value {
  color: var(--on-violet);
  font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--pencil-light), var(--pencil-light)) no-repeat 0 100% / 0 2px;
  transition: background-size 450ms var(--ease-out);
}

.close__link:hover .close__value {
  background-size: 100% 2px;
}

.footer {
  padding-block: 2rem;
  border-top: 1px solid var(--on-violet-rule);
  font-size: 0.875rem;
  color: var(--on-violet-3);
}

/* ------------------------------------------------------------------ статьи */

.progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  .progress {
    display: block;
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    height: 3px;
    background: var(--violet);
    transform-origin: 0 50%;
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.article {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(4rem, 9vw, 7rem);
  align-items: start;
}

.article__side {
  position: sticky;
  top: 5.5rem;
  font-size: 0.9375rem;
}

.back {
  display: inline-flex;
  align-items: center;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}

.back .icon {
  margin: 0 0.4em 0 0;
}

.back:hover {
  color: var(--ink);
}

.back:hover .icon {
  transform: translateX(-3px);
}

.article__kind {
  margin-top: 2rem;
  font-family: var(--f-hand);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--red);
  rotate: -3deg;
  transform-origin: 0 50%;
}

.article__meta {
  margin-top: 0.85rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.article__meta li + li {
  margin-top: 0.4rem;
}

.article__role {
  font-weight: 600;
  color: var(--violet);
}

.article__title {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  line-height: 1.06;
  font-weight: 660;
  letter-spacing: -0.035em;
  max-width: 22ch;
  text-wrap: balance;
}

.prose p,
.prose li,
.feature__text,
.section__lede,
.path__what,
.quote__source {
  text-wrap: pretty;
}

.prose {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 40rem;
  font-family: var(--f-serif);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  line-height: 1.65;
  hanging-punctuation: first;
}

.prose p + p,
.prose p + ul,
.prose ul + p,
.prose p + ol,
.prose ol + p {
  margin-top: 1em;
}

.prose > p:first-child strong:only-child,
.prose > p:first-child > em:only-child {
  display: block;
  font-family: var(--f-sans);
  font-weight: 560;
  font-size: 1.15em;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.prose h2,
.prose h3 {
  margin: 2.2em 0 0.6em;
  font-family: var(--f-sans);
  font-size: 1.3em;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prose > h2:first-child,
.prose > h3:first-child {
  margin-top: 0;
  font-weight: 560;
  font-size: 1.15em;
  line-height: 1.4;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--violet);
}

.prose a {
  color: var(--violet);
}

.prose strong {
  font-weight: 700;
}

.prose figure {
  margin-block: 2.25rem;
}

.prose figure:first-child {
  margin-top: 0;
}

.prose figure img {
  width: 100%;
  border-radius: 0.25rem;
  background: var(--paper-2);
}

.prose figcaption {
  margin-top: 0.6rem;
  font-family: var(--f-sans);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.prose--slides {
  max-width: 48rem;
}

.prose--slides figure {
  margin-block: 1.25rem;
}

.prose--slides figure img {
  box-shadow: 0 1px 2px rgb(var(--shadow-ink) / 0.08), 0 12px 28px -14px rgb(var(--shadow-ink) / 0.35);
}

.prose--chats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 48rem;
}

.prose--chats > p,
.prose--chats > ul {
  grid-column: 1 / -1;
  margin: 0;
}

.prose--chats figure {
  margin: 0 0 1rem;
}

.prose--chats figure a {
  display: block;
  border-radius: 0.375rem;
  overflow: hidden;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.prose--chats figure a:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -16px rgb(var(--shadow-ink) / 0.45);
}

.aside-note {
  margin-top: 3rem;
  max-width: 40rem;
  padding: 1.5rem 1.75rem;
  border-radius: 0.5rem;
  background: var(--violet-soft);
}

.aside-note p {
  font-family: var(--f-serif);
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.bio__photo {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 48rem;
}

.bio__photo img {
  border-radius: 0.25rem;
}

.next {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.35rem 1.5rem;
  margin-top: clamp(3.5rem, 7vw, 5rem);
  padding-top: 1.5rem;
  max-width: 48rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.next__label {
  grid-column: 1;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.next__title {
  grid-column: 1;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.next .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--violet);
}

.next:hover .icon {
  transform: translateX(6px);
}

.proof__draft--static {
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

/* ------------------------------------------------------------------ адаптив */

@media (max-width: 60rem) {
  :root {
    --margin-col: minmax(0, 10rem);
  }

  .feature,
  .feature:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 47.99rem) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .margin,
  .main {
    grid-column: 1;
  }

  .masthead {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    padding-block: 0.6rem;
  }

  .masthead__nav {
    order: 3;
    width: 100%;
    gap: 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hero {
    padding-top: 1.25rem;
  }

  /* Фото встаёт рядом с заголовком, чтобы кнопки поместились на первый экран */
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
  }

  .hero__text {
    display: contents;
  }

  .proof,
  .hero__lede,
  .hero__actions {
    grid-column: 1 / -1;
  }

  .proof {
    grid-row: 1;
  }

  .hero__title {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }

  .hero__photo {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    width: 5.5rem;
    margin: 0;
  }

  .hero__note {
    margin-top: 0.4rem;
    font-size: 1.05rem;
    rotate: -2deg;
  }

  .masthead__name {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }

  .masthead__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-block: 0;
    background-position: 0 85%;
  }

  .skills-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .proof {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .hero__lede {
    margin-top: 1.25rem;
  }

  .hero__actions {
    margin-top: 1.5rem;
  }

  .hero__actions .button {
    flex: 1 1 auto;
  }

  .section__label {
    margin-bottom: 0.5rem;
  }

  .features {
    margin-top: 2rem;
  }

  .feature,
  .feature:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .feature:nth-child(even) .feature__media {
    order: 0;
  }

  .work,
  .path__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .work__venue,
  .work__kind,
  .work__link {
    grid-column: 1;
    grid-row: auto;
  }

  .work__venue {
    order: 1;
  }

  .work__kind {
    order: 0;
    margin: 0;
  }

  .work__link {
    order: 2;
    margin-top: 0.35rem;
  }

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

  .path__what {
    margin-top: 0.25rem;
  }

  .close__note {
    padding-top: 0;
    margin-bottom: 1rem;
  }

  .close__link {
    flex-direction: column;
    align-items: flex-start;
  }

  .article__side {
    position: static;
    margin-bottom: 1.5rem;
  }

  .article__kind {
    margin-top: 1.5rem;
  }

  .prose--chats {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer .main {
    margin-top: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

.nowrap {
  white-space: nowrap;
}
