  :root {
    --bg: #f4efe6;
    --bg-alt: #ebe4d6;
    --surface: #fbf8f2;
    --ink: #1f1d1a;
    --muted: #6b645a;
    --line: #d6ccb9;
    --accent: #8a2a1f;
    --accent-ink: #fff;
    --gold: #a07a2c;
    --hero-bg: #16140f;
    --hero-ink: #efe8da;
    --hero-muted: #a89f8e;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #13120f;
      --bg-alt: #1a1814;
      --surface: #1e1c17;
      --ink: #e9e3d6;
      --muted: #a39a89;
      --line: #35312a;
      --accent: #c4533f;
      --accent-ink: #fff;
      --gold: #c9a24f;
      --hero-bg: #0c0b09;
    }
  }
  :root[data-theme="dark"] {
    --bg: #13120f;
    --bg-alt: #1a1814;
    --surface: #1e1c17;
    --ink: #e9e3d6;
    --muted: #a39a89;
    --line: #35312a;
    --accent: #c4533f;
    --accent-ink: #fff;
    --gold: #c9a24f;
    --hero-bg: #0c0b09;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "PT Serif", Georgia, serif;
    font-size: 18px;
    line-height: 1.6;
  }
  a { color: inherit; }
  .wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

  /* Навигация */
  .nav {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--hero-bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
  .nav .brand {
    font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 22px;
    color: var(--hero-ink); text-decoration: none; letter-spacing: .02em;
  }
  .nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
  .nav ul a { color: var(--hero-muted); text-decoration: none; font-size: 15px; }
  .nav ul a:hover { color: var(--hero-ink); }

  /* Шапка */
  .hero { background: var(--hero-bg); color: var(--hero-ink); padding: 72px 0 88px; }
  .hero .wrap {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
  }
  .eyebrow {
    font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
    margin: 0 0 16px;
  }
  .hero h1 {
    font-family: "Cormorant Garamond", serif; font-weight: 700;
    font-size: clamp(44px, 7vw, 80px); line-height: 1; margin: 0 0 20px;
  }
  .hero .lead { font-size: 20px; color: var(--hero-muted); max-width: 30em; margin: 0 0 32px; }
  .hero blockquote {
    margin: 0 0 36px; padding-left: 18px; border-left: 2px solid var(--gold);
    font-style: italic; color: var(--hero-ink); white-space: pre-line;
  }
  .hero blockquote cite { display: block; font-style: normal; font-size: 14px; color: var(--hero-muted); margin-top: 8px; }
  .btns { display: flex; flex-wrap: wrap; gap: 12px; }
  .btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px; border-radius: 2px; text-decoration: none;
    font-family: "PT Serif", serif; font-size: 16px; border: 1px solid transparent; cursor: pointer;
  }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { filter: brightness(1.1); }
  .btn-ghost { border-color: rgba(255,255,255,.25); color: var(--hero-ink); }
  .btn-ghost:hover { border-color: var(--hero-ink); }
  .portrait { position: relative; }
  .portrait img {
    width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%;
    display: block; filter: grayscale(.25) contrast(1.05);
  }
  .portrait::after {
    content: ""; position: absolute; inset: 14px -14px -14px 14px;
    border: 1px solid var(--gold); z-index: -1;
  }
  .portrait { z-index: 0; isolation: isolate; }

  /* Секции */
  section { padding: 80px 0; }
  .section-title {
    font-family: "Cormorant Garamond", serif; font-weight: 700;
    font-size: clamp(34px, 5vw, 48px); margin: 0 0 8px; line-height: 1.1;
  }
  .section-sub { color: var(--muted); margin: 0 0 40px; }

  .about { background: var(--bg-alt); }
  .about .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
  .about p { margin: 0 0 16px; }
  .facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
  .facts li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .facts span:first-child { color: var(--muted); }
  .facts span:last-child { text-align: right; }

  /* Оглавление */
  .toc { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 32px; }
  .toc li { border-bottom: 1px solid var(--line); }
  .toc a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; text-decoration: none; }
  .toc a:hover .t { color: var(--accent); }
  .toc .d { color: var(--muted); font-size: 14px; white-space: nowrap; }
  .toc .note { color: var(--accent); font-size: 14px; }

  /* Стихи */
  .poems { display: grid; gap: 24px; margin-top: 56px; }
  .poem {
    background: var(--surface); border: 1px solid var(--line);
    padding: 48px 56px; scroll-margin-top: 72px;
  }
  .poem header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
  .poem h3 {
    font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 34px; margin: 0; line-height: 1.15;
  }
  .poem .meta { color: var(--muted); font-size: 15px; }
  .poem .text { columns: 2; column-gap: 56px; }
  .poem .text.single { columns: 1; }
  .poem .text p { margin: 0 0 1.3em; white-space: pre-line; break-inside: avoid; }
  .poem .dedication {
    font-style: italic; color: var(--muted); font-size: 16px;
    border-top: 1px solid var(--line); padding-top: 16px; margin: 8px 0 0;
  }
  .poem footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
  .listen {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
    text-decoration: none; font-size: 15px; border-radius: 2px;
  }
  .listen:hover { filter: brightness(1.1); }
  .listen svg { width: 14px; height: 14px; fill: currentColor; }
  .soon { color: var(--muted); font-size: 15px; font-style: italic; }
  .to-top { margin-left: auto; color: var(--muted); font-size: 14px; text-decoration: none; }
  .to-top:hover { color: var(--ink); }

  /* Плеер */
  .player {
    display: flex; align-items: center; gap: 14px; flex: 1 1 360px; max-width: 560px;
    background: var(--bg-alt); border: 1px solid var(--line); padding: 10px 16px 10px 10px;
  }
  .player img { width: 48px; height: 48px; object-fit: cover; flex: none; }
  .player .pp {
    width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
    background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  }
  .player .pp:hover { filter: brightness(1.1); }
  .player .pp svg { width: 16px; height: 16px; fill: currentColor; }
  .player .pp .i-pause, .player.playing .pp .i-play { display: none; }
  .player.playing .pp .i-pause { display: block; }
  .player .body { flex: 1; min-width: 0; }
  .player .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .player .row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
  .player .bar {
    flex: 1; height: 6px; background: var(--line); cursor: pointer; position: relative;
    border: 0; padding: 0;
  }
  .player .bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
  .player .time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

  /* Обратная связь */
  .contact { background: var(--bg-alt); }
  .contact .cols { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
  .contact p { margin: 0 0 16px; }
  .form { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); padding: 32px; }
  .form label { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
  .form input[type=text], .form textarea {
    font: inherit; font-size: 17px; color: var(--ink); background: var(--bg);
    border: 1px solid var(--line); padding: 10px 12px; border-radius: 2px; width: 100%;
  }
  .form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
  .form textarea { min-height: 150px; resize: vertical; }
  .form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
  .form .check input { margin-top: 4px; accent-color: var(--accent); }
  .form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .form button { justify-self: start; border: 0; }
  .form button[disabled] { opacity: .6; cursor: wait; }
  .form .status { margin: 0; font-size: 15px; min-height: 1.4em; }
  .form .status.ok { color: #2e7d32; }
  .form .status.err { color: var(--accent); }

  /* Вкладки «Стих / Аккорды» */
  .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px 0 28px; }
  .tabs button {
    font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer;
    padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  }
  .tabs button:hover { color: var(--ink); }
  .tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
  .tabs button .n { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

  /* Аккорды */
  .song-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; color: var(--muted); margin: 0 0 16px; }
  .song-meta b { color: var(--ink); font-weight: 400; }
  .song-note { font-size: 14px; color: var(--muted); font-style: italic; margin: 0 0 20px; }
  .diagrams { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 24px; }
  .diagram { display: grid; justify-items: center; color: var(--ink); }
  .diagram b { font-family: "PT Serif", serif; font-size: 15px; color: var(--accent); }
  .diagram svg { width: 64px; height: 80px; }
  .song-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
  .song-actions button {
    font: inherit; font-size: 14px; cursor: pointer; padding: 8px 14px; border-radius: 2px;
    background: transparent; color: var(--ink); border: 1px solid var(--line);
  }
  .song-actions button:hover { border-color: var(--ink); }
  .sheet { columns: 2; column-gap: 48px; }
  .sheet .blk { break-inside: avoid; margin: 0 0 1.4em; }
  .sheet .lbl { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .sheet .blk.chorus { border-left: 3px solid var(--accent); padding-left: 14px; }
  .sheet .blk.chorus .lbl { color: var(--accent); font-weight: 700; }
  .sheet .blk.repeat .ln { opacity: .75; }
  .sheet .ln { line-height: 1.25; margin-bottom: 4px; }
  .sheet .seg { display: inline-flex; flex-direction: column; white-space: pre; vertical-align: bottom; }
  .sheet .ch {
    font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 700;
    color: var(--accent); min-height: 1.15em; padding-right: 6px;
  }
  .sheet .blk.chorus .tx { font-weight: 700; }
  #print-area { display: none; }

  .site-footer { background: var(--hero-bg); color: var(--hero-muted); padding: 40px 0; font-size: 15px; }
  .site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

  @media (max-width: 860px) {
    .hero { padding: 48px 0 64px; }
    .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
    .portrait { max-width: 380px; margin-right: 14px; order: -1; }
    .about .cols, .contact .cols { grid-template-columns: 1fr; gap: 32px; }
    .form { padding: 20px; }
    .poem { padding: 32px 20px; }
    .poem .text, .sheet { columns: 1; }
    .nav ul { gap: 16px; }
    section { padding: 56px 0; }
  }

  /* Печать одной песни с аккордами */
  @media print {
    html.printing-song body > *:not(#print-area) { display: none !important; }
    html.printing-song #print-area { display: block; color: #000; background: #fff; font-size: 13pt; }
    #print-area h1 { font-family: "Cormorant Garamond", serif; font-size: 26pt; margin: 0 0 4pt; }
    #print-area .by { margin: 0 0 10pt; font-size: 11pt; }
    #print-area .song-meta, #print-area .song-meta b, #print-area .song-note { color: #000; }
    #print-area .diagram, #print-area .diagram b, #print-area .ch, #print-area .lbl { color: #000 !important; }
    #print-area .blk.chorus { border-left-color: #000; }
    #print-area .sheet { columns: 2; }
    #print-area .src { margin-top: 12pt; font-size: 9pt; color: #444; }
  }
  @media (max-width: 420px) {
    .nav .brand { font-size: 19px; }
    .nav ul a { font-size: 14px; }
  }
