/* ==========================================================================
   ЗАЗА — цифровой паспорт
   Современный литературный минимализм: печатное достоинство + спокойная
   современная вёрстка. Мобильный-first, читаемость превыше всего.
   ========================================================================== */

:root {
  --night: #10191F;
  --night-soft: #16232B;
  --paper: #F9F8F4;
  --paper-alt: #F1EEE7;
  --ink: #18282C;
  --ink-soft: #64726E;
  --bronze: #8C7554;
  --bronze-light: #B99B74;
  --ivory: #F5EFDF;
  --line: #D9DED8;

  --font-display: 'Cormorant Garamond', 'PT Serif', Georgia, 'Times New Roman', serif;
  --font-serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --measure: 760px;
  --pad: clamp(18px, 5vw, 40px);
  --radius: 999px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 100%;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::selection { background: rgba(140, 117, 84, 0.26); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 12px 18px;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

/* --- индикатор прочитанного (только с JS) --------------------------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.js .progress { opacity: 1; }
.progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--bronze), var(--bronze-light));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
  background: var(--night);
  color: var(--ivory);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 25, 31, 0.88) 0%, rgba(16, 25, 31, 0.58) 42%, rgba(16, 25, 31, 0.92) 100%),
    radial-gradient(120% 90% at 50% 40%, rgba(16, 25, 31, 0) 40%, rgba(16, 25, 31, 0.72) 100%);
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) var(--pad) 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 223, 0.72);
}
.hero__domain { color: inherit; text-decoration: none; }
.hero__domain:hover { color: var(--ivory); }

.hero__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px var(--pad) 20px;
}

.hero__eyebrow {
  margin: 0 auto clamp(18px, 3.6vw, 26px);
  max-width: 46ch;
  text-align: center;
}
.hero__eyebrow-lead {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-sans);
  font-size: clamp(10.5px, 2.7vw, 12.5px);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: var(--bronze-light);
}
.hero__eyebrow-text {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(15px, 3.8vw, 20px);
  line-height: 1.6;
  color: rgba(245, 239, 223, 0.84);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(80px, 19vw, 210px);
  line-height: 0.92;
  letter-spacing: 0.05em;
  color: var(--ivory);
  text-indent: 0.05em;
}

.hero__claim {
  margin: clamp(20px, 4vw, 30px) 0 0;
  font-size: clamp(17px, 4.4vw, 26px);
  line-height: 1.5;
  color: var(--ivory);
  max-width: 30ch;
}

.hero__gift {
  margin: clamp(16px, 3vw, 24px) auto 0;
  max-width: 58ch;
  font-family: var(--font-sans);
  font-size: clamp(12.5px, 3.3vw, 15px);
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: rgba(245, 239, 223, 0.72);
}

.hero__dedication {
  margin: clamp(26px, 5vw, 40px) auto 0;
  max-width: 34ch;
  font-style: italic;
  font-size: clamp(15px, 4vw, 19px);
  line-height: 1.7;
  color: rgba(245, 239, 223, 0.74);
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 var(--pad) calc(22px + env(safe-area-inset-bottom));
  color: rgba(245, 239, 223, 0.68);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.scroll-cue:hover { color: var(--ivory); }
.scroll-cue__arrow { animation: cue 2.6s ease-in-out infinite; }

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* --- стихотворение ---------------------------------------------------- */

.poem {
  background: var(--paper);
  padding: clamp(64px, 12vw, 140px) 0 clamp(56px, 10vw, 120px);
}

.poem__title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 9.5vw, 76px);
  line-height: 1.05;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.poem__caption {
  margin: 12px 0 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(12px, 3.2vw, 14px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.poem__epigraph {
  position: relative;
  margin: clamp(30px, 6vw, 48px) auto 0;
  padding-top: 26px;
  max-width: 30ch;
  text-align: center;
  font-style: italic;
  font-size: clamp(15px, 3.9vw, 18px);
  line-height: 1.65;
  color: var(--bronze);
}
.poem__epigraph::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 34px;
  height: 1px;
  background: var(--bronze);
  transform: translateX(-50%);
  opacity: 0.6;
}

.poem__body {
  max-width: var(--measure);
  margin: clamp(44px, 8vw, 80px) auto 0;
  padding: 0 var(--pad);
  font-size: clamp(18px, 4.4vw, 23px);
  line-height: 1.8;
  color: var(--ink);
  overflow-wrap: break-word;
}

.stanza { margin: 0 0 2.3em; }
.stanza:last-child { margin-bottom: 0; }
.line { display: block; }

.poem__end {
  max-width: var(--measure);
  margin: clamp(56px, 9vw, 96px) auto 0;
  padding: 0 var(--pad);
  text-align: center;
}
.poem__rule {
  display: block;
  width: 56px;
  height: 1px;
  margin: 0 auto 30px;
  background: var(--bronze);
  opacity: 0.55;
}
.poem__dedication {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 5.6vw, 40px);
  letter-spacing: 0.05em;
  color: var(--ink);
}

/* --- смысловые секции -------------------------------------------------- */

.section { padding: clamp(56px, 10vw, 110px) 0; }
.section--idea { background: var(--paper-alt); }
.section--closing { background: var(--paper); }
.section--passport { background: var(--paper); padding-top: 0; }

.section__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section__title {
  margin: 0 0 clamp(24px, 5vw, 36px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 7vw, 54px);
  line-height: 1.12;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.section p {
  margin: 0 0 1.2em;
  font-size: clamp(17px, 4.1vw, 21px);
  line-height: 1.8;
  color: #26373C;
}
.section p:last-child { margin-bottom: 0; }

.section--closing p.lead {
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.9em;
}

.section__note {
  margin-top: clamp(24px, 4vw, 34px) !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: var(--ink-soft) !important;
}

/* --- цифровой паспорт -------------------------------------------------- */

.passport {
  border: 1px solid var(--line);
  border-top-width: 1px;
  background: #FFFFFF;
  padding: 0 clamp(18px, 5vw, 40px) clamp(10px, 2vw, 18px);
}
.passport__summary { padding: 24px 0; }
.passport__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze);
}
.passport__summary::-webkit-details-marker { display: none; }
.passport__summary::after {
  content: '+';
  margin-left: auto;
  font-size: 17px;
  letter-spacing: 0;
  color: var(--bronze);
}
.passport[open] .passport__summary::after { content: '−'; }
.passport__stamp {
  font-family: var(--font-display);
  font-size: clamp(23px, 5.4vw, 36px);
  line-height: 1.1;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
}
.passport__summary-note {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--ink-soft);
}
.passport__summary:hover { color: var(--ink); }
.passport__summary:hover .passport__stamp { color: var(--ink); }

.passport__body { padding-bottom: 10px; }
.passport__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.passport__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.passport__sub {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.passport__list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 32px;
}
.passport__list dt {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 14px;
}
.passport__list dd {
  margin: 4px 0 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

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

.footer {
  background: var(--night);
  color: rgba(245, 239, 223, 0.78);
  padding: clamp(52px, 9vw, 88px) 0 calc(52px + env(safe-area-inset-bottom));
}
.footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--pad);
  text-align: center;
}
.footer p { margin: 0 0 16px; font-size: 15px; line-height: 1.7; }
.footer__sign { font-style: italic; color: rgba(245, 239, 223, 0.7); }
.footer__from {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze-light);
  margin-bottom: 18px;
}
.footer__studio { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0.06em; }
.footer__studio strong { color: var(--bronze-light); font-weight: 600; letter-spacing: 0.16em; }
.footer__domain {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 239, 223, 0.55);
  margin-bottom: 0;
}
.footer__actions { margin: 26px 0 0; }
.footer__share {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid rgba(245, 239, 223, 0.28);
  border-radius: var(--radius);
  background: transparent;
  color: rgba(245, 239, 223, 0.86);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.footer__share:hover {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--night);
}

/* --- плавающие кнопки и уведомление ----------------------------------- */

/* Плавающие кнопки живут только в свободном поле широкого экрана,
   чтобы никогда не перекрывать текст стихотворения. На узких экранах
   те же действия доступны в подвале. */

.tools {
  position: fixed;
  right: var(--pad);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 30;
  display: none;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}
.tools.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

.tools__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(24, 40, 44, 0.14);
  border-radius: var(--radius);
  background: rgba(249, 248, 244, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(16, 25, 31, 0.09);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.tools__btn:hover { background: var(--night); color: var(--ivory); border-color: var(--night); }

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translate(-50%, 12px);
  margin: 0;
  padding: 11px 20px;
  border-radius: var(--radius);
  background: var(--night);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* --- адаптация --------------------------------------------------------- */

@media (min-width: 768px) {
  .passport__list { grid-template-columns: 42% 1fr; }
  .passport__list dt { padding-top: 16px; }
  .passport__list dd { padding-top: 16px; margin-top: 0; }
  .hero__top { font-size: 12.5px; }
}

/* Плавающие кнопки появляются только там, где они не задевают текст. */
@media (min-width: 1024px) {
  .tools { display: flex; }
}

@media (hover: none) {
  .scroll-cue__arrow { animation: none; }
}

/* --- доступность и печать ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .hero { min-height: auto; color: var(--ink); }
  .hero__bg, .tools, .progress, .scroll-cue, .toast, .skip-link { display: none !important; }
  body { background: #fff; }
  .poem, .section, .footer { background: #fff; color: #000; }
  .section--idea { background: #fff; }
}
