/* =========================================================
   Ульяна — персональный сайт
   Дизайн-система: «лента» (художественная гимнастика)
   ========================================================= */

:root {
  /* Палитра */
  --paper:      #EAF5F5;
  --card:       #FFFFFF;
  --ink:        #241F4B;
  --ink-soft:   #605A8A;
  --ink-faint:  #9891BE;
  --pink:       #FF4F87;
  --teal:       #17BEBB;
  --sun:        #FFC93C;
  --lilac:      #B79CFF;
  --line:       rgba(36, 31, 75, .12);

  /* Цвета разделов творчества: небесно-голубой, бирюзовый, светло-синий.
     Взяты разной светлоты, иначе рядом сливаются в одно пятно. */
  --sky:        #4FC0EA;
  --aqua:       #17BEBB;
  --blue:       #8AA4F7;

  /* Типографика */
  --display: "Unbounded", "Trebuchet MS", system-ui, sans-serif;
  --body:    "Literata", Georgia, "Times New Roman", serif;
  --hand:    "Caveat", "Segoe Script", cursive;

  /* Ритм */
  --gap:  clamp(1rem, 2.5vw, 1.75rem);
  --pad:  clamp(1.25rem, 5vw, 2.5rem);
  --wrap: 1120px;
  --r:    18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Фон: бирюзовая бумага, сиреневый и бирюзовый рассвет по углам,
   поверх — редкая россыпь сердечек (тот же мотив, что у кнопки «нравится»). */
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg%3E%3Cpath d='M12 20.5C4.5 15 2 11.2 4.6 8.1 6.5 5.8 9.9 6.2 12 9c2.1-2.8 5.5-3.2 7.4-.9 2.6 3.1.1 6.9-7.4 12.4z' transform='translate(22 26) scale(.78)' fill='%2317BEBB' opacity='.3'/%3E%3Cpath d='M12 20.5C4.5 15 2 11.2 4.6 8.1 6.5 5.8 9.9 6.2 12 9c2.1-2.8 5.5-3.2 7.4-.9 2.6 3.1.1 6.9-7.4 12.4z' transform='translate(158 62) rotate(12 12 14) scale(.6)' fill='%23FF4F87' opacity='.26'/%3E%3Cpath d='M12 20.5C4.5 15 2 11.2 4.6 8.1 6.5 5.8 9.9 6.2 12 9c2.1-2.8 5.5-3.2 7.4-.9 2.6 3.1.1 6.9-7.4 12.4z' transform='translate(86 132) rotate(-8 12 14) scale(.9)' fill='%23B79CFF' opacity='.32'/%3E%3Cpath d='M12 20.5C4.5 15 2 11.2 4.6 8.1 6.5 5.8 9.9 6.2 12 9c2.1-2.8 5.5-3.2 7.4-.9 2.6 3.1.1 6.9-7.4 12.4z' transform='translate(210 176) scale(.65)' fill='%234FC0EA' opacity='.28'/%3E%3Cpath d='M12 20.5C4.5 15 2 11.2 4.6 8.1 6.5 5.8 9.9 6.2 12 9c2.1-2.8 5.5-3.2 7.4-.9 2.6 3.1.1 6.9-7.4 12.4z' transform='translate(36 212) rotate(16 12 14) scale(.55)' fill='%23FF4F87' opacity='.24'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(900px 620px at 92% -8%, rgba(183, 156, 255, .30), transparent 62%),
    radial-gradient(760px 680px at -12% 104%, rgba(23, 190, 187, .24), transparent 62%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pink);
  display: inline-block;
  translate: 0 -2px;
}

.nav {
  display: flex;
  gap: clamp(.5rem, 2vw, 1.5rem);
  align-items: center;
}

.nav a {
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .01em;
  text-decoration: none;
  padding: .45rem .1rem;
  position: relative;
  color: var(--ink-soft);
  transition: color .2s ease;
  white-space: nowrap;
}

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

.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .1rem;
  height: 3px;
  border-radius: 3px;
  background: var(--pink);
  scale: 0 1;
  transform-origin: left;
  transition: scale .25s ease;
}

.nav a:hover::after { scale: 1 1; }

.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"]::after { scale: 1 1; }

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

.hero {
  position: relative;
  padding-block: clamp(2.5rem, 8vw, 5.5rem) clamp(2rem, 6vw, 4rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.eyebrow {
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.3rem, 7.5vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.035em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  display: block;
  background: linear-gradient(100deg, var(--pink), var(--lilac) 55%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.fullname {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--display);
  font-size: .8rem;
  letter-spacing: .05em;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.fullname::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--teal);
  flex: none;
}

.lede {
  font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 1.75rem;
}

.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fff;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(36,31,75,.6); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--card); }

/* Лента — сигнатурный элемент */

.ribbon { width: 100%; height: auto; overflow: visible; }

.ribbon path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ribbon--hero path {
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
  animation: draw 2.4s cubic-bezier(.22,.61,.36,1) forwards;
}

.ribbon--hero path:nth-child(2) { animation-delay: .18s; }
.ribbon--hero path:nth-child(3) { animation-delay: .34s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

/* Фото стоит поверх ленты, поэтому лента вылетает из-за него петлями
   и не закрывает лицо. */
.hero__art {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: clamp(1rem, 4vw, 2rem) 2.5rem;
}

.ribbon--hero {
  position: absolute;
  left: -16%;
  width: 132%;
  top: 50%;
  translate: 0 -54%;
  z-index: 0;
}

.photo {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(76%, 320px);
  aspect-ratio: 4 / 5;
  border-radius: 50% 50% 24px 24px / 44% 44% 24px 24px;
  overflow: hidden;
  background: var(--card);
  box-shadow:
    0 0 0 7px var(--card),
    0 30px 55px -34px rgba(36, 31, 75, .85);
  rotate: -1.5deg;
}

/* Кадр с телефона вертикальный: подрезаем и приближаем средствами CSS,
   исходник в media/images/ остаётся целым. */
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 57% 41%;
  scale: 1.32;
}

.hero__art .hand {
  position: absolute;
  right: 0;
  bottom: -.25rem;
  z-index: 2;
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--ink-faint);
  rotate: -6deg;
}

/* Разделитель-лента между секциями */
.divider { padding-block: clamp(1rem, 4vw, 2.5rem); }
.divider svg { width: 100%; height: auto; opacity: .85; }

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

.section { padding-block: clamp(2.5rem, 7vw, 4.5rem); scroll-margin-top: 90px; }
.section--tight { padding-block: clamp(1.5rem, 4vw, 2.5rem); }

.section__head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); max-width: 62ch; }

.section h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 .75rem;
}

.section p { max-width: 62ch; }

/* Чем я занимаюсь */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
}

.fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
  transition: transform .2s ease, box-shadow .2s ease;
}

.fact:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -24px rgba(36,31,75,.7); }

.fact__mark {
  width: 34px; height: 4px;
  border-radius: 4px;
  margin-bottom: 1rem;
  background: var(--pink);
}
.fact:nth-child(2) .fact__mark { background: var(--teal); }
.fact:nth-child(3) .fact__mark { background: var(--sun); }
.fact:nth-child(4) .fact__mark { background: var(--lilac); }

.fact h3 {
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 600;
  margin: 0 0 .4rem;
  letter-spacing: -.01em;
}

.fact p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* Благодарности — письмо */

.letter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 6px);
  padding: clamp(1.5rem, 5vw, 3.25rem);
  position: relative;
  box-shadow: 0 28px 60px -50px rgba(36,31,75,.9);
}

.letter::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: calc(var(--r) + 6px) 0 0 calc(var(--r) + 6px);
  background: linear-gradient(var(--pink), var(--sun) 50%, var(--teal));
}

.letter h2.letter__title {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.letter p { font-size: 1.05rem; margin: 0 0 1.15rem; max-width: 60ch; }
.letter p:last-of-type { margin-bottom: 0; }

.letter mark {
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 60%, transparent) 0);
  color: inherit;
  padding: 0 .1em;
}

.letter__sign {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--ink-soft);
  margin-top: 2rem;
  display: block;
}

/* ---------------- Блог ---------------- */

.page-head { padding-block: clamp(2.25rem, 6vw, 3.75rem) clamp(1rem, 3vw, 2rem); }

.page-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -.035em;
  line-height: 1;
  margin: 0 0 .75rem;
}

.page-head p { color: var(--ink-soft); max-width: 52ch; margin: 0; }

.notes { display: grid; gap: clamp(1rem, 3vw, 1.75rem); padding-bottom: 3rem; }

.note {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.25rem, 3vw, 1.9rem);
}

.note__when {
  font-family: var(--display);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ink-faint);
  border-right: 1px solid var(--line);
  padding-right: 1rem;
}

.note__when b {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: .3rem;
}

.note h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  letter-spacing: -.02em;
  margin: 0 0 .75rem;
  line-height: 1.2;
}

.note__body p { margin: 0 0 .9rem; }
.note__body p:last-child { margin-bottom: 0; }

/* Снимки с телефона бывают вертикальными — приводим превью к общему
   квадрату, полный кадр открывается по клику. */
.note__media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin: 1.15rem 0 0;
}

.note__shot {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  display: block;
}

.note__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.note__shot:hover img { transform: scale(1.05); }

.note__video { margin: 1.15rem 0 0; }

.note__video video {
  width: 100%;
  max-width: 340px;
  max-height: 70vh;
  border-radius: 14px;
  background: #0F0D22;
  display: block;
}

/* Просмотр фото во весь экран */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 4vmin;
  background: rgba(18, 15, 42, .88);
  backdrop-filter: blur(6px);
  border: 0;
  cursor: zoom-out;
  animation: fade .2s ease;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 40px 80px -40px #000;
}

.lightbox__close {
  position: absolute;
  top: max(1rem, 3vmin);
  right: max(1rem, 3vmin);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: 600 1.1rem/1 var(--display);
  cursor: pointer;
}

.lightbox__close:hover { background: rgba(255, 255, 255, .22); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.note__links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.15rem; }

.note__links a {
  font-family: var(--display);
  font-size: .74rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .85rem;
  color: var(--ink-soft);
  transition: border-color .2s ease, color .2s ease;
}

.note__links a:hover { border-color: var(--ink); color: var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.tag {
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: lowercase;
  color: var(--ink-faint);
}

.tag::before { content: "#"; opacity: .6; }

/* ---------------- Творчество ---------------- */

.tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.tab {
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 600;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .6rem 1.2rem;
  cursor: pointer;
  transition: all .2s ease;
}

.tab:hover { border-color: var(--ink-faint); color: var(--ink); }

/* У каждого раздела свой цвет: он же горит на корешке карточки.
   Текст оставляем чернильным — на светлой заливке он читается лучше белого. */
.tab[data-kind="books"]  { --kind: var(--sky); }
.tab[data-kind="poems"]  { --kind: var(--aqua); }
.tab[data-kind="tracks"] { --kind: var(--blue); }

.tab:hover { border-color: var(--kind); }

.tab[aria-selected="true"] {
  background: var(--kind);
  border-color: var(--kind);
  color: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--gap);
  padding-bottom: 3rem;
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
  transition: transform .2s ease, box-shadow .2s ease;
}

.work:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -30px rgba(36,31,75,.9); }

/* Ссылка в заголовке растягивается на всю карточку — кликается вся карточка,
   но кнопка «нравится» остаётся выше по z-index и работает отдельно. */
.work__link { text-decoration: none; color: inherit; }

.work__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r);
}

.work__link:focus-visible { outline: none; }
.work__link:focus-visible::after { outline: 3px solid var(--pink); outline-offset: 3px; }

.work .stats {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.work__kind {
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.work__spine {
  height: 6px;
  width: 46px;
  border-radius: 6px;
  margin-bottom: 1.1rem;
  background: var(--sky);
}
.work__spine[data-hue="sky"]   { background: var(--sky); }
.work__spine[data-hue="aqua"]  { background: var(--aqua); }
.work__spine[data-hue="blue"]  { background: var(--blue); }
.work__spine[data-hue="pink"]  { background: var(--pink); }
.work__spine[data-hue="lilac"] { background: var(--lilac); }
.work__spine[data-hue="sun"]   { background: var(--sun); }

.work h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 .5rem;
}

.work p { color: var(--ink-soft); font-size: .95rem; margin: 0 0 1.25rem; }

.work__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--display);
  font-size: .74rem;
  color: var(--ink-faint);
}

.work__go { color: var(--pink); font-weight: 600; }

/* Стихи — превью первых строк */
.work__preview {
  font-family: var(--body);
  font-size: .95rem;
  color: var(--ink-soft);
  white-space: pre-line;
  margin: 0 0 1.25rem;
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

/* ---------------- Лайки и просмотры ---------------- */

.stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  font-family: var(--display);
  font-size: .74rem;
  color: var(--ink-faint);
  position: relative;
  z-index: 1;
}

.stats svg { width: 17px; height: 17px; flex: none; }

.like {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: inherit;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .8rem;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.like svg { fill: none; stroke: currentColor; stroke-width: 1.7; transition: fill .2s ease, stroke .2s ease; }

.like:hover { border-color: var(--pink); color: var(--pink); }

.like[aria-pressed="true"] {
  color: var(--pink);
  border-color: color-mix(in srgb, var(--pink) 45%, transparent);
  background: color-mix(in srgb, var(--pink) 8%, transparent);
}

.like[aria-pressed="true"] svg { fill: var(--pink); stroke: var(--pink); }

.like.is-bumped svg { animation: bump .45s ease; }

@keyframes bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  60%  { transform: scale(.92); }
  100% { transform: scale(1); }
}

.views { display: inline-flex; align-items: center; gap: .45rem; }
.views svg { fill: none; stroke: currentColor; stroke-width: 1.5; }

.stats.is-loading { opacity: .45; }

/* Музыка */
.track {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
}

.track__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .35rem;
}

.track h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  margin: 0;
}

.track__year { font-family: var(--display); font-size: .74rem; color: var(--ink-faint); }

.track p { color: var(--ink-soft); font-size: .92rem; margin: 0 0 1.15rem; }

.track audio { width: 100%; }

.track__soon {
  font-family: var(--display);
  font-size: .78rem;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  text-align: center;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 2.5rem;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--display);
  font-size: .9rem;
}

/* ---------------- Читалка ---------------- */

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--pink), var(--sun), var(--teal));
  z-index: 100;
  transition: width .1s linear;
}

.reader { padding-block: clamp(2rem, 6vw, 3.5rem) 4rem; }

.reader__wrap { max-width: 44rem; margin-inline: auto; }

/* Текст читается с белого листа — фон с сердечками остаётся вокруг. */
.reader__panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 6px);
  padding: clamp(1.5rem, 5vw, 3.25rem);
  box-shadow: 0 28px 60px -50px rgba(36, 31, 75, .9);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--display);
  font-size: .76rem;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 2rem;
}

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

.reader h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5.5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  margin: 0 0 .75rem;
  text-wrap: balance;
}

.reader__meta {
  font-family: var(--display);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}

.reader__note {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 2.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.reader__note:empty { display: none; }

.reader__text {
  font-size: clamp(1.06rem, 1rem + .3vw, 1.2rem);
  line-height: 1.85;
}

.reader__text p { margin: 0 0 1.4rem; }

.reader__text.verse p { white-space: pre-line; margin-bottom: 2rem; }

.reader__text h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  margin: 3rem 0 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.reader__text h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.reader__end {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--ink-faint);
  text-align: center;
}

.reader__stats .stats { justify-content: center; margin-top: 1.5rem; }

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

.foot {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  margin-top: auto;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-family: var(--display);
  font-size: .76rem;
  color: var(--ink-faint);
}

.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

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

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .note { grid-template-columns: 1fr; }
  .note__when {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 .9rem;
    display: flex;
    align-items: baseline;
    gap: .6rem;
  }
  .note__when b { font-size: 1.25rem; margin: 0; }
}

@media (max-width: 700px) {
  /* fixed-фон на мобильных тормозит прокрутку */
  body { background-attachment: scroll, scroll, scroll; }
}

@media (max-width: 560px) {
  .nav { gap: .9rem; }
  .stats { flex-wrap: wrap; gap: .6rem 1rem; }
  .nav a { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .ribbon--hero path { stroke-dashoffset: 0; }
}
