/* Журнал лаборатории: список записей и страница записи.
   Подключается после seo-pages.css и берёт его токены (--ink, --paper, --orange, --blue, --content). */

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-feature-settings: "tnum"; }

/* ---------- сигнальная линия под ключевым словом ---------- */
.signal { position: relative; display: inline-block; color: inherit; font-style: normal; white-space: nowrap; }
.signal svg { position: absolute; left: -2%; right: -2%; bottom: -.14em; width: 104%; height: .32em; overflow: visible; pointer-events: none; }
.signal path { fill: none; stroke: var(--orange); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: signal-draw .9s cubic-bezier(.6, 0, .2, 1) .45s forwards; }
@keyframes signal-draw { to { stroke-dashoffset: 0; } }

/* ---------- общее: подъём при появлении ---------- */
.rise { opacity: 0; transform: translateY(18px); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- список: шапка ---------- */
.journal-hero { width: var(--content); margin: 0 auto; padding: clamp(64px, 8vw, 118px) 0 clamp(56px, 6vw, 84px); border-bottom: 1px solid var(--ink); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: clamp(48px, 8vw, 120px); align-items: end; }
.journal-hero h1 { font-size: clamp(54px, 7vw, 104px); }
.journal-hero .hero-answer { max-width: 700px; }
.legend { padding: 26px 0 0 30px; border-left: 1px solid var(--ink); }
.legend b { display: block; margin-bottom: 20px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.legend dl { margin: 0; display: grid; gap: 18px; }
.legend dt { font-weight: 700; font-size: 17px; }
.legend dd { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }

.kind { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.kind::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.kind-dug { color: var(--blue); }
.kind-tested { color: var(--orange); }
.kind-parsed { color: var(--ink); }

/* ---------- список: строки журнала ---------- */
.ledger { width: var(--content); margin: 0 auto; padding: 0 0 clamp(80px, 9vw, 130px); }
.ledger-head, .entry-row { display: grid; grid-template-columns: 92px 130px 150px minmax(0, 1fr) 40px; gap: 24px; align-items: baseline; }
.ledger-head { padding: 22px 0 14px; border-bottom: 2px solid var(--ink); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.entry-row { position: relative; padding: 30px 0 34px; border-bottom: 1px solid var(--ink); text-decoration: none; opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2, .7, .2, 1) forwards; }
.entry-row:nth-child(2) { animation-delay: .35s; }
.entry-row:nth-child(3) { animation-delay: .45s; }
.entry-row:nth-child(4) { animation-delay: .55s; }
.entry-row:nth-child(n+5) { animation-delay: .65s; }
.entry-no { font-size: 15px; font-weight: 500; }
.entry-date { color: var(--muted); font-size: 14px; }
.entry-row h2 { font-size: clamp(26px, 2.5vw, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.06; }
.entry-row p { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.entry-row p b { color: var(--ink); font-weight: 700; }
.entry-arrow { justify-self: end; color: var(--orange); font-size: 26px; font-weight: 700; transition: transform .25s ease; }
a.entry-row::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 0; height: 3px; background: var(--orange); transition: width .45s cubic-bezier(.6, 0, .2, 1); }
a.entry-row:hover::after, a.entry-row:focus-visible::after { width: 100%; }
a.entry-row:hover .entry-arrow { transform: translateX(6px); }
.entry-row.is-draft { color: var(--muted); }
.entry-row.is-draft h2 { color: color-mix(in srgb, var(--ink) 55%, var(--paper)); }
.entry-status { justify-self: end; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

.journal-feed { width: var(--content); margin: 0 auto; padding: clamp(60px, 7vw, 100px) 0; border-bottom: 1px solid var(--ink); display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; }
.journal-feed h2 { font-size: clamp(36px, 4vw, 58px); letter-spacing: -.045em; line-height: 1; }
.journal-feed p { max-width: 560px; margin: 0 0 26px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.journal-feed .actions { display: flex; flex-wrap: wrap; gap: 14px; }
.button-ghost { background: transparent; color: var(--ink); }

/* ---------- запись: протокол ---------- */
.record { width: var(--content); margin: 0 auto; padding: clamp(48px, 6vw, 90px) 0 0; }
.record-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); font-size: 14px; }
.record-meta .mono { font-weight: 500; }
.record h1 { max-width: 1100px; margin: clamp(34px, 4vw, 56px) 0 0; font-size: clamp(46px, 6.2vw, 92px); }
.protocol { margin: clamp(40px, 5vw, 64px) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.protocol div { padding: 26px 30px 32px 0; }
.protocol div + div { padding-left: 30px; border-left: 1px solid var(--line); }
.protocol dt { margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.protocol dd { margin: 0; font-size: 18px; line-height: 1.5; }
.protocol .verdict { background: var(--ink); color: var(--white); padding-right: 30px; }
.protocol .verdict dt { color: var(--orange); }
.protocol .verdict dd { font-weight: 600; }

/* ---------- запись: текст ---------- */
.record-body { width: var(--content); margin: 0 auto; padding: clamp(56px, 7vw, 96px) 0 clamp(70px, 8vw, 120px); display: grid; grid-template-columns: minmax(220px, .32fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 110px); border-bottom: 1px solid var(--ink); }
.record-aside { position: sticky; top: 112px; align-self: start; font-size: 14px; }
.record-aside b { display: block; margin-bottom: 14px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.record-aside ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 10px; }
.record-aside li { counter-increment: toc; }
.record-aside a { display: grid; grid-template-columns: 32px 1fr; color: var(--muted); text-decoration: none; line-height: 1.4; }
.record-aside a::before { content: counter(toc, decimal-leading-zero); font-family: "IBM Plex Mono", monospace; color: var(--orange); }
.record-aside a:hover { color: var(--ink); }
.prose { max-width: 760px; }
.prose h2 { margin: 72px 0 22px; font-size: clamp(32px, 3.2vw, 46px); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; scroll-margin-top: 110px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 18px; line-height: 1.62; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 22px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--orange); font-weight: 700; }
.prose a { text-underline-offset: 3px; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.prose strong { font-weight: 700; }
.pullquote { margin: 44px 0; padding: 4px 0 4px 26px; border-left: 5px solid var(--orange); font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }

.data-table { margin: 30px 0 36px; overflow-x: auto; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.data-table table { width: 100%; min-width: 640px; border-collapse: collapse; }
.data-table th { padding: 14px 16px 12px 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 16px 16px 16px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; vertical-align: top; }
.data-table td:first-child { font-weight: 700; }
.data-table td.num { font-family: "IBM Plex Mono", monospace; font-size: 22px; font-weight: 500; white-space: nowrap; }
.data-table tr.is-low td.num { color: var(--blue); }
.data-table tr.is-high td.num { color: var(--orange); }

.spread { margin: 34px 0 40px; }
.spread-scale { position: relative; height: 84px; border-bottom: 2px solid var(--ink); }
.spread-dot { font-style: normal; position: absolute; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--ink); opacity: 0; animation: rise .5s ease forwards; }
.spread-dot span { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-family: "IBM Plex Mono", monospace; font-size: 13px; white-space: nowrap; }
.spread-dot:nth-child(even) span { bottom: 44px; }
.spread-dot.is-low { background: var(--blue); color: var(--blue); }
.spread-dot.is-high { background: var(--orange); color: var(--orange); }
.spread-legend { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 13px; }

.sources { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.sources li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.sources a { font-weight: 600; }

.record-nav { width: var(--content); margin: 0 auto; padding: 34px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--ink); font-weight: 700; }
.record-nav a { text-decoration: none; }
.record-nav a + a { text-align: right; }
.record-nav a:hover { color: var(--orange); }

/* ---------- запись: дополнительные блоки ---------- */
.record-flag { padding: 4px 10px; border: 1px solid var(--orange); color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.prose .lead { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.45; }
.case-list { margin: 30px 0 34px; border-top: 2px solid var(--ink); }
.case { padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.case b { display: block; margin-bottom: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.case p { margin: 0; color: var(--muted); font-size: 17px; }
.prose .qlist { margin: 30px 0 34px; padding: 0; list-style: none; counter-reset: q; border-top: 2px solid var(--ink); }
.prose .qlist li { counter-increment: q; margin: 0; padding: 20px 0 20px 64px; position: relative; border-bottom: 1px solid var(--ink); font-size: clamp(19px, 1.7vw, 23px); font-weight: 700; line-height: 1.35; }
.prose .qlist li::before { content: counter(q, decimal-leading-zero); position: absolute; left: 0; top: 22px; color: var(--orange); font-family: "IBM Plex Mono", monospace; font-size: 17px; font-weight: 500; }
.editor-note { margin: 56px 0 0; padding: 26px 28px 8px; background: var(--white); border-left: 5px solid var(--blue); }
.editor-note b { display: block; margin-bottom: 12px; color: var(--blue); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.editor-note p { font-size: 17px; }
.record-channel-line { width: var(--content); margin: 0 auto; padding: 18px 0 40px; text-align: right; }
.record-channel-line a { color: var(--muted); font-size: 15px; font-weight: 600; text-underline-offset: 3px; }
.record-channel-line a:hover { color: var(--ink); }

@media (max-width: 1000px) {
  .ledger-head { display: none; }
  .entry-row { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .entry-no { grid-column: 1; }
  .entry-date { grid-column: 1; grid-row: 2; }
  .entry-row .kind { grid-column: 2; grid-row: 1; justify-self: end; }
  .entry-main { grid-column: 1 / -1; margin-top: 8px; }
  .entry-arrow, .entry-status { grid-column: 2; grid-row: 2; }
  .record-body { grid-template-columns: 1fr; }
  .record-aside { position: static; }
}
@media (max-width: 900px) {
  .journal-hero, .journal-feed { grid-template-columns: 1fr; }
  .legend { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--ink); }
  .protocol { grid-template-columns: 1fr; }
  .protocol div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .protocol .verdict { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 560px) {
  .journal-hero h1 { font-size: clamp(44px, 12vw, 58px); }
  .record h1 { font-size: clamp(38px, 10.5vw, 52px); }
  .signal { white-space: normal; }
  .prose p, .prose li { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise, .entry-row, .spread-dot { opacity: 1; transform: none; animation: none; }
  .signal path { stroke-dashoffset: 0; animation: none; }
  a.entry-row::after, .entry-arrow { transition: none; }
}
