/* Журнал инженера прода — стили блога.
   Токены и приёмы те же, что на лендинге landing/pult-egora.html:
   тёмная «телеметрия», JetBrains Mono в заголовках, панели с подписью на рамке. */

:root {
  --void:   #07090B;
  --panel:  #0D1217;
  --panel2: #131A21;
  --line:   #1E2831;
  --line2:  #161E25;
  --ink:    #DAE3EA;
  --soft:   #7B8A96;
  --faint:  #4C5B66;
  --blue:   #4C8DFF;
  --mint:   #35D6A4;
  --coral:  #FF7355;
  --pink:   #E570C0;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --game: "Press Start 2P", "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body { overflow-anchor: none; overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-color: var(--void);
  background-image: linear-gradient(#05070A 0%, #070B12 45%, #0A1220 78%, #0D1826 100%);
  background-attachment: fixed;
  padding-bottom: 40px;
}
body.page-index { padding-bottom: 150px; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

h1, h2, h3 { margin: 0; text-wrap: balance; font-family: var(--mono); letter-spacing: -0.03em; }
h1 { font-weight: 800; font-size: clamp(1.7rem, 4.6vw, 2.4rem); line-height: 1.14; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.hint { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.lead { color: var(--soft); font-size: 16px; max-width: 62ch; }

/* ---------- верхняя строка состояния ---------- */

.statusbar {
  height: 46px;
  border-bottom: 1px solid var(--line);
  background: #090C0F;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  overflow-x: auto;
  white-space: nowrap;
  position: relative;
  z-index: 3;
}
.statusbar .wrap { display: flex; align-items: center; gap: 16px; width: 100%; }
.sep { color: #2B3843; }
.sb-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.sb-name:hover { color: var(--blue); }
.sb-label { color: var(--soft); }
.sb-right { margin-left: auto; }
.sb-right a { text-decoration: none; }
.sb-right a:hover { text-decoration: underline; }

/* ---------- панель с подписью на рамке ---------- */

.panel {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 30px 24px 24px;
}
.panel.plain { background: transparent; }
.panel > .tag {
  position: absolute;
  top: -7px;
  left: 16px;
  background: var(--void);
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  background: var(--blue);
  color: var(--void);
  border: 1px solid var(--blue);
  height: 48px;
  padding: 0 22px;
  cursor: pointer;
  text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: #2B3843; font-weight: 400; }
.btn.ghost:hover { border-color: var(--blue); }
.btn:active { transform: translateY(1px); }

section { padding-top: 130px; }
.head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 30px; }

/* ---------- список заметок ---------- */

#journal { padding-top: 56px; }
/* полоса под шапкой: в ней движок ставит первый этаж, иначе персонажу негде начать.
   Только на списке заметок — на странице тега персонажа нет, и пустота там ни к чему. */
.page-index #journal .head { margin-bottom: 110px; }

.card {
  display: grid;
  gap: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px 22px 20px;
  margin-bottom: 132px;
  text-decoration: none;
  color: inherit;
}
.card:last-of-type { margin-bottom: 0; }
/* на странице тега персонаж не бегает — этажам между карточками места не нужно */
.page-post .card { margin-bottom: 26px; }
.card:hover { border-color: var(--blue); background: var(--panel2); }
.card:hover .card-more { color: var(--ink); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
}
.card-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.card-desc { color: var(--soft); font-size: 15px; line-height: 1.55; max-width: 68ch; }
.card-excerpt {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--faint);
  border-left: 2px solid var(--line);
  padding-left: 12px;
  max-width: 74ch;
}
.card-more { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--blue); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  font-family: var(--mono);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  border: 1px solid var(--line);
  padding: 3px 8px;
}
a.tag-chip:hover { border-color: var(--blue); color: var(--ink); }

/* ---------- страница заметки ---------- */

.post { max-width: 760px; margin: 0 auto; }
.post-head {
  display: grid;
  gap: 14px;
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 38px;
}
.post-head .lead { font-size: 17px; }

.prose { font-size: 17px; line-height: 1.72; color: #C2CED8; }
.prose > * + * { margin-top: 22px; }
.prose p { max-width: 68ch; }
.prose h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 56px;
  line-height: 1.25;
}
.prose h2::before { content: "// "; color: var(--faint); font-weight: 400; }
.prose h3 { font-size: 1.03rem; font-weight: 700; color: var(--ink); margin-top: 38px; }
.prose h4 { font-family: var(--mono); font-size: 0.92rem; color: var(--soft); margin: 30px 0 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); }
.prose ul, .prose ol { padding-left: 20px; margin-block: 0; }
.prose li { max-width: 66ch; }
.prose li + li { margin-top: 9px; }
.prose li::marker { color: var(--mint); font-family: var(--mono); font-size: 0.9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 42px 0; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); display: block; }

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  color: #B7C7D3;
}
.prose pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 13px; }

.prose blockquote {
  border-left: 3px solid var(--mint);
  background: rgba(53, 214, 164, 0.05);
  padding: 14px 18px;
  color: var(--soft);
  margin: 0;
}
.prose blockquote p { max-width: none; }
.prose blockquote > * + * { margin-top: 12px; }

/* пометка автору: место, куда должен встать факт из вашей практики.
   Пишется в markdown как <p class="todo">…</p>, перед публикацией удаляется. */
.prose .todo {
  border-left: 3px solid var(--coral);
  background: rgba(255, 115, 85, 0.06);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--coral);
  max-width: none;
}
.prose .todo::before { content: "// "; opacity: 0.6; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  text-align: left;
  background: var(--panel2);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.prose td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; color: #B9C6D1; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* ---------- подвал ---------- */

.site-foot .panel p { color: var(--soft); max-width: 62ch; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; }
.foot-meta { padding-top: 18px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.foot-meta a { color: var(--soft); }
.page-post #contact { padding-top: 84px; }

/* ---------- киберпанк-задник и персонаж (только список заметок) ---------- */

.city-bg {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 110px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(transparent, #000 40%);
  mask-image: linear-gradient(transparent, #000 40%);
}
.city {
  position: absolute; left: 0; right: 0; bottom: 2px; height: 96px;
  background-repeat: repeat-x;
  background-position-y: bottom;
  will-change: background-position-x;
}
.city.far {
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='96'%3E%3Cg fill='%230B1119'%3E%3Crect x='0' y='36' width='44' height='60'/%3E%3Crect x='52' y='18' width='36' height='78'/%3E%3Crect x='96' y='48' width='52' height='48'/%3E%3Crect x='156' y='10' width='30' height='86'/%3E%3Crect x='194' y='40' width='46' height='56'/%3E%3Crect x='248' y='24' width='34' height='72'/%3E%3Crect x='290' y='52' width='56' height='44'/%3E%3Crect x='354' y='14' width='40' height='82'/%3E%3C/g%3E%3Cg fill='%23142438'%3E%3Crect x='60' y='26' width='4' height='4'/%3E%3Crect x='70' y='40' width='4' height='4'/%3E%3Crect x='162' y='20' width='4' height='4'/%3E%3Crect x='172' y='34' width='4' height='4'/%3E%3Crect x='256' y='34' width='4' height='4'/%3E%3Crect x='362' y='26' width='4' height='4'/%3E%3Crect x='374' y='44' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E");
}
.city.near {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='96'%3E%3Cg fill='%23101720'%3E%3Crect x='0' y='22' width='56' height='74'/%3E%3Crect x='68' y='44' width='44' height='52'/%3E%3Crect x='124' y='8' width='40' height='88'/%3E%3Crect x='176' y='36' width='58' height='60'/%3E%3Crect x='246' y='18' width='36' height='78'/%3E%3Crect x='294' y='50' width='62' height='46'/%3E%3Crect x='368' y='12' width='44' height='84'/%3E%3Crect x='424' y='40' width='52' height='56'/%3E%3Crect x='486' y='26' width='34' height='70'/%3E%3C/g%3E%3Cg fill='%2316304C'%3E%3Crect x='8' y='32' width='5' height='5'/%3E%3Crect x='20' y='32' width='5' height='5'/%3E%3Crect x='8' y='46' width='5' height='5'/%3E%3Crect x='32' y='60' width='5' height='5'/%3E%3Crect x='132' y='18' width='5' height='5'/%3E%3Crect x='144' y='18' width='5' height='5'/%3E%3Crect x='132' y='32' width='5' height='5'/%3E%3Crect x='254' y='28' width='5' height='5'/%3E%3Crect x='266' y='42' width='5' height='5'/%3E%3Crect x='376' y='22' width='5' height='5'/%3E%3Crect x='388' y='36' width='5' height='5'/%3E%3Crect x='376' y='50' width='5' height='5'/%3E%3C/g%3E%3Cg fill='%23214D3F'%3E%3Crect x='84' y='54' width='5' height='5'/%3E%3Crect x='96' y='68' width='5' height='5'/%3E%3Crect x='308' y='60' width='5' height='5'/%3E%3Crect x='438' y='50' width='5' height='5'/%3E%3C/g%3E%3Crect x='188' y='42' width='4' height='26' fill='%23FF7355' opacity='0.8'/%3E%3Crect x='196' y='42' width='30' height='6' fill='%232A4A6E'/%3E%3Crect x='452' y='46' width='4' height='22' fill='%234C8DFF' opacity='0.8'/%3E%3Crect x='300' y='56' width='24' height='5' fill='%23255848' opacity='0.9'/%3E%3C/svg%3E");
}
.rain {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(105deg, transparent 0 46px, rgba(76,141,255,0.10) 46px 47px, transparent 47px 96px);
  background-size: 200% 200%;
  animation: rainfall 1.1s linear infinite;
  pointer-events: none;
}
@keyframes rainfall {
  from { background-position: 0 -160px; }
  to   { background-position: -60px 160px; }
}

#course, #ropeLayer {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.floor {
  position: absolute;
  height: 10px;
  background: linear-gradient(#141B23, #0D1217);
  border-top: 2px solid #2AA381;
  border-bottom: 1px solid #1E2831;
  box-shadow: 0 0 10px rgba(53, 214, 164, 0.18), inset 0 1px 0 rgba(53, 214, 164, 0.22);
}
.floor::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 4px; height: 2px;
  background-image: repeating-linear-gradient(90deg, #1E2831 0 30px, transparent 30px 72px);
}
.rope {
  position: absolute;
  width: 2px;
  background-image: repeating-linear-gradient(#5A4632 0 8px, #3E3122 8px 12px);
}
.rope::before {
  content: "";
  position: absolute;
  top: -3px; left: -7px;
  width: 16px; height: 4px;
  background: #2B3843;
  border-top: 1px solid #4C8DFF;
}
.lamp {
  position: absolute;
  width: 4px;
  background: #1B252E;
  border-top: 3px solid #2B3843;
}
.lamp::before {
  content: "";
  position: absolute;
  top: -3px; left: -5px;
  width: 14px; height: 5px;
  background: #2B3843;
  border-bottom: 2px solid #B8D8F5;
  box-shadow: 0 2px 9px rgba(140, 190, 255, 0.55);
}
.lamp::after {
  content: "";
  position: absolute;
  top: 4px; left: 50%;
  transform: translateX(-50%);
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  width: 0;
  border-bottom: 84px solid rgba(150, 200, 255, 0.06);
}
.lvl-num {
  position: absolute;
  font-family: var(--game);
  font-size: 20px;
  color: rgba(53, 214, 164, 0.22);
  text-shadow: 0 0 10px rgba(53, 214, 164, 0.18);
  pointer-events: none;
  white-space: nowrap;
}
.sign {
  position: absolute;
  font-family: var(--game);
  font-size: 10px;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  padding: 10px 5px;
  border: 1px solid currentColor;
  background: rgba(7, 9, 11, 0.72);
  pointer-events: none;
  animation: signFlicker 4.6s steps(1) infinite;
}
.sign.n-pink  { color: var(--pink);  text-shadow: 0 0 9px rgba(229, 112, 192, 0.8); box-shadow: 0 0 14px rgba(229, 112, 192, 0.25); }
.sign.n-blue  { color: var(--blue);  text-shadow: 0 0 9px rgba(76, 141, 255, 0.8);  box-shadow: 0 0 14px rgba(76, 141, 255, 0.25); }
.sign.n-mint  { color: var(--mint);  text-shadow: 0 0 9px rgba(53, 214, 164, 0.8);  box-shadow: 0 0 14px rgba(53, 214, 164, 0.25); }
.sign.n-coral { color: var(--coral); text-shadow: 0 0 9px rgba(255, 115, 85, 0.8);  box-shadow: 0 0 14px rgba(255, 115, 85, 0.25); }
@keyframes signFlicker {
  0%, 88%, 92%, 100% { opacity: 1; }
  89%, 91% { opacity: 0.35; }
}
@media (max-width: 1230px) { .sign { display: none; } }

#player {
  position: absolute;
  left: 0; top: 0;
  z-index: 60;
  pointer-events: none;
  will-change: transform;
}
#player svg { display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
#playerFlip { position: relative; transition: transform 120ms ease; }
#playerFlip .dashlines {
  position: absolute;
  top: 26px; right: 100%;
  margin-right: 4px;
  width: 26px; height: 18px;
  background-image: linear-gradient(#7CACFF 2px, transparent 2px, transparent 8px, #7CACFF 8px, #7CACFF 10px, transparent 10px, transparent 16px, #7CACFF 16px, #7CACFF 18px, transparent 18px);
  opacity: 0;
}
#playerFlip.dash .dashlines { opacity: 0.55; }

svg.px { shape-rendering: crispEdges; flex: none; overflow: visible; }
svg.px .lid { opacity: 0; }
svg.px.blink #pupilL, svg.px.blink #pupilR, svg.px.blink #glintL, svg.px.blink #glintR { opacity: 0; }
svg.px.blink .lid { opacity: 1; }

.bubble {
  position: fixed;
  left: 0;
  top: 0;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  background: rgba(13, 18, 23, 0.96);
  border: 1px solid #2B3843;
  border-left: 3px solid var(--blue);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: #9AA7B0;
  white-space: normal;
  pointer-events: none;
  z-index: 82;
  display: none;
}
.bubble.show { display: block; animation: bubbleIn 180ms ease; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble .p { color: var(--blue); }

/* ---------- телефон ---------- */

@media (max-width: 740px) {
  .wrap { padding: 0 16px; }
  #journal { padding-top: 32px; }
  section { padding-top: 118px; }
  .card { margin-bottom: 118px; padding: 20px 16px 18px; }
  .card-desc { font-size: 14px; }
  .post-head { padding: 34px 0 26px; margin-bottom: 30px; }
  .post-head .lead { font-size: 15.5px; }
  .prose { font-size: 16px; }
  .prose h2 { margin-top: 44px; font-size: 1.16rem; }
  .prose pre { padding: 13px 14px; font-size: 12px; }
  .foot-actions .btn { width: 100%; }
  .statusbar { font-size: 10px; letter-spacing: 0.06em; }
  .statusbar .wrap { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rain { animation: none; display: none; }
  #playerFlip { transition: none; }
  .sign { animation: none; }
}
