/* ═══════════ BASILISK — crumpled newspaper terminal ═══════════ */
:root {
  --paper: #edeae0;
  --paper-hi: #f4f1e7;
  --ink: #16130f;
  --ink-soft: #55503f;
  --ink-faint: #8b8571;
  --line: #16130f;
  --mono: 'Space Mono', 'Courier New', ui-monospace, monospace;
  --hand: 'Fredericka the Great', 'Space Mono', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

/* мятая бумага: складки + зерно */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 18% 12%, rgba(255,255,250,.5), transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 30%, rgba(120,110,90,.10), transparent 65%),
    radial-gradient(ellipse 70% 45% at 40% 78%, rgba(120,110,90,.09), transparent 60%),
    radial-gradient(ellipse 45% 35% at 70% 95%, rgba(255,255,250,.4), transparent 65%),
    linear-gradient(112deg, transparent 42%, rgba(110,100,82,.07) 43%, transparent 45%),
    linear-gradient(74deg, transparent 60%, rgba(110,100,82,.06) 61%, transparent 64%),
    linear-gradient(160deg, transparent 24%, rgba(255,255,250,.35) 25%, transparent 28%);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.33 0 0 0 0 0.27 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; }
img { max-width: 100%; }
code { font-family: inherit; background: rgba(22,19,15,.07); padding: 1px 5px; }

/* ═══ кастомный курсор ═══ */
.cur-dot, .cur-ring { display: none; position: fixed; z-index: 9999; pointer-events: none; top: 0; left: 0; mix-blend-mode: difference; }
.cur-dot {
  width: 11px; height: 11px; background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: width .15s, height .15s;
}
.cur-ring {
  width: 36px; height: 36px; border: 2.5px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .18s ease, height .18s ease, border-radius .18s ease, opacity .18s;
}
.cur-ring.on-link { border-radius: 0; }
.cur-ring.pressed:not(.on-link) { width: 20px; height: 20px; }

/* показываем кастомный курсор только там, где есть настоящая мышь */
@media (hover: hover) and (pointer: fine) {
  body, a, button, [data-cursor] { cursor: none; }
  .cur-dot, .cur-ring { display: block; }
}

.ink-splat {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 5px; height: 5px; background: var(--ink); border-radius: 50%;
  animation: splat .5s ease-out forwards;
}
@keyframes splat {
  to { transform: translate(var(--dx), var(--dy)) scale(.1); opacity: 0; }
}

/* ═══ лист ═══ */
.sheet {
  position: relative; z-index: 1;
  max-width: 1460px; margin: 14px auto; padding: 0;
  border: 1.5px solid var(--line);
  background: rgba(244, 241, 231, .35);
  box-shadow: 0 1px 0 rgba(22,19,15,.25), 0 14px 44px rgba(22,19,15,.18);
  min-height: calc(100vh - 28px);
  display: flex; flex-direction: column;
}
@media (max-width: 1500px) { .sheet { margin: 10px; min-height: calc(100vh - 20px); } }
main { flex: 1; display: flex; flex-direction: column; }
.screen.on { flex: 1; }

/* ═══ masthead ═══ */
.masthead {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 18px;
  border-bottom: 1.5px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--hand); font-size: 25px; letter-spacing: 2px; }
.brand-sub { font-size: 10px; color: var(--ink-soft); letter-spacing: .6px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  padding: 5px 9px; font-size: 11.5px; letter-spacing: .4px;
  border: 1.5px solid transparent;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.nav a:hover { border-color: var(--line); }
.nav a.on { background: var(--ink); color: var(--paper); border-color: var(--line); }
.mast-actions { display: flex; align-items: center; gap: 12px; }
.x-head img { width: 17px; height: 17px; display: block; transition: transform .2s; }
.x-head:hover img { transform: scale(1.18) rotate(-6deg); }

.btn-ink {
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 7px 14px; font-size: 11.5px; letter-spacing: .8px;
  transition: background .15s, color .15s, transform .1s;
  position: relative;
}
.btn-ink:hover { background: transparent; color: var(--ink); }
.btn-ink:active { transform: translateY(1px); }
.btn-ink.big { padding: 11px 22px; font-size: 13px; }
.btn-ink.wide { width: 100%; margin-top: 12px; text-align: center; display: block; }
.btn-line {
  border: 1.5px solid var(--ink); padding: 11px 22px; font-size: 13px;
  letter-spacing: .8px; display: inline-block;
  transition: background .15s, color .15s;
}
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* ═══ экраны ═══ */
main { padding: 16px; }
.screen { display: none; }
.screen.on { display: block; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }

.sc-head { padding: 14px 4px 18px; }
.sc-head h2 { font-family: var(--hand); font-size: 44px; letter-spacing: 3px; line-height: 1; }
.sc-sub { max-width: 720px; color: var(--ink-soft); margin-top: 8px; font-size: 12.5px; }
.sc-sub a { border-bottom: 1px solid var(--ink-faint); }

/* reveal при скролле/входе */
[data-rv] { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
[data-rv].rv-in { opacity: 1; transform: none; }

/* ═══ панели ═══ */
.panel {
  border: 1.5px solid var(--line);
  background: rgba(250, 248, 240, .5);
  padding: 12px 14px;
  position: relative;
}
.p-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid rgba(22,19,15,.35);
  padding-bottom: 7px; margin-bottom: 10px;
  flex-wrap: wrap;
}
.p-head.slim { border-bottom: none; margin-bottom: 6px; padding-bottom: 0; }
.p-title { font-weight: 700; font-size: 11.5px; letter-spacing: 1.2px; }
.p-note { font-size: 10.5px; color: var(--ink-faint); }
.p-more {
  display: inline-block; margin-top: 10px; font-size: 10.5px; letter-spacing: .8px;
  border-bottom: 1px solid transparent; transition: border-color .15s;
}
.p-more:hover { border-color: var(--ink); }

.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ═══ NETWORK layout ═══ */
.net-grid {
  display: grid; grid-template-columns: 250px 1fr 270px; gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 1080px) { .net-grid { grid-template-columns: 1fr; } }

/* мысли слева */
.thinking { display: flex; flex-direction: column; min-height: 480px; }
.think-log { flex: 1; overflow-y: auto; max-height: 520px; display: flex; flex-direction: column; gap: 0; }
.tweet {
  display: block; margin-bottom: 8px; padding: 10px 11px;
  border: 1px solid rgba(22,19,15,.45);
  background: rgba(255,253,246,.65);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  animation: thoughtIn .4s ease;
}
a.tweet:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 rgba(22,19,15,.75); border-color: var(--ink); }
@keyframes thoughtIn { from { opacity: 0; transform: translateX(-6px); } }
.tw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tw-ava {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: #fdfcf7;
  object-fit: cover; flex: 0 0 32px; transform: scaleX(-1);
}
.tw-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tw-name { font-weight: 700; font-size: 11.5px; }
.tw-handle { font-size: 9.5px; color: var(--ink-faint); letter-spacing: .3px; }
.tw-x { width: 12px; height: 12px; margin-left: auto; opacity: .7; transition: transform .15s, opacity .15s; }
a.tweet:hover .tw-x { opacity: 1; transform: scale(1.2); }
.tw-text { font-size: 12px; }
.tw-text.greek { font-style: italic; }
.typing::after { content: '▍'; animation: blink .7s steps(1) infinite; }

/* system status */
.sys { margin-top: 12px; border-top: 1.5px solid var(--line); padding-top: 10px; }
.ekg { width: 100%; height: 30px; margin: 4px 0 8px; }
.ekg path {
  stroke: var(--ink); stroke-width: 1.5;
  stroke-dasharray: 460; stroke-dashoffset: 460;
  animation: ekgdraw 3.2s linear infinite;
}
@keyframes ekgdraw { to { stroke-dashoffset: -460; } }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 2.5px 0; }
.kv span { color: var(--ink-soft); letter-spacing: .5px; }
.kv b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.kv b.mono { font-size: 10px; }

/* герой */
.hero { text-align: center; padding: 26px 12px 8px; position: relative; }
.hero-title {
  font-family: var(--hand); font-weight: 400;
  font-size: clamp(64px, 9vw, 128px);
  letter-spacing: 8px; line-height: .95;
}
.hero-sub { font-size: 13px; letter-spacing: 4px; color: var(--ink-soft); margin-top: 4px; }
.hero-note { margin: 18px auto 0; max-width: 430px; color: var(--ink-soft); font-size: 12px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.ca-row {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin-top: 14px; font-size: 11px; color: var(--ink-soft); flex-wrap: wrap;
}
.ca-row code { font-size: 10.5px; }
.ca-row a { border-bottom: 1px solid var(--ink-faint); font-size: 10.5px; }
/* ═══ карта-глаз ═══ */
.eye-wrap {
  margin-top: 20px; border: 1.5px solid var(--line);
  background: rgba(250,248,240,.5); text-align: left;
  padding: 12px 14px;
}
.eye-view {
  position: relative; overflow: hidden; height: 470px;
  touch-action: none; user-select: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(22,19,15,.045), transparent 70%);
}
.eye-view.big { height: 66vh; min-height: 480px; }
.eye-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ecell {
  position: absolute; border: 1px solid rgba(22,19,15,.5);
  padding: 0; display: block;
  transition: background .12s ease;
}
.ecell:hover { z-index: 3; outline: 2px solid var(--ink); outline-offset: 0; }
.ecell.taken { background: #3a352a !important; }
.ecell.memory { background: var(--ink) !important; }
.ecell .mk {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--paper); font-weight: 700; font-size: 9px; letter-spacing: .5px;
  font-family: var(--mono);
}
.eye-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.eye-svg .lid { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.eye-svg .pupil-path { fill: var(--ink); }
.eye-svg .pupil-glint { fill: var(--paper-hi); }
.pupil-g {
  transform-box: fill-box; transform-origin: center;
  animation: pupilPulse 6s ease-in-out infinite;
}
@keyframes pupilPulse { 50% { transform: scaleX(.78); } }
.gene-label {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--paper-hi); border: 1.5px solid var(--ink);
  padding: 2px 8px; font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap;
  z-index: 4; font-family: var(--mono);
  box-shadow: 2px 2px 0 rgba(22,19,15,.5);
}
.eye-tip {
  position: fixed; z-index: 1200; pointer-events: none;
  background: var(--paper-hi); border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(22,19,15,.6);
  padding: 8px 11px; font-size: 11px; max-width: 280px;
}
.eye-tip .tt-head { font-weight: 700; letter-spacing: 1px; font-size: 10px; margin-bottom: 3px; }
.eye-tip .tt-note { font-style: italic; }
.eye-tip .tt-dim { color: var(--ink-faint); font-size: 9.5px; margin-top: 3px; }

/* правая колонка */
.right-col { display: flex; flex-direction: column; gap: 14px; }
.specimen {
  position: relative; padding: 16px 18px;
  background: rgba(250, 248, 240, .4);
}
.cb { position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--ink); }
.cb.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.cb.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.cb.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.cb.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.overview .ov-row {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 11.5px; padding: 3.5px 0;
}
.ov-g { width: 15px; text-align: center; }
.ov-l { letter-spacing: .5px; color: var(--ink-soft); }
.dots { flex: 1; border-bottom: 1.5px dotted rgba(22,19,15,.5); transform: translateY(-3px); }
.ov-row b { font-weight: 700; }

.hunger .hbar {
  height: 14px; border: 1.5px solid var(--line); margin: 8px 0 6px;
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(22,19,15,.06) 6px 12px);
  position: relative; overflow: hidden;
}
.hunger .hbar i {
  display: block; height: 100%; width: 0%;
  background: repeating-linear-gradient(135deg, var(--ink) 0 8px, #2e2a22 8px 16px);
  transition: width 1s ease;
}

/* ═══ соты ═══ */
.mapwrap { margin-bottom: 14px; }
.honeycomb {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
  padding: 8px 0 4px;
}
.gene-cluster {
  border: 1px solid rgba(22,19,15,.4);
  padding: 10px 12px 9px;
  background: rgba(250,248,240,.45);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
}
.gene-cluster:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 4px 0 rgba(22,19,15,.15); }
.gene-cluster.dominant { border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 rgba(22,19,15,.85); }
.gene-cluster.dominant::after {
  content: 'DOMINANT'; position: absolute; top: -8px; right: 8px;
  background: var(--ink); color: var(--paper);
  font-size: 8px; letter-spacing: 1.5px; padding: 1px 6px;
}
.gc-head { display: flex; gap: 7px; align-items: baseline; margin-bottom: 2px; }
.gc-glyph { font-size: 15px; }
.gc-name { font-weight: 700; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; }
.gc-blurb { font-size: 9.5px; color: var(--ink-faint); margin-bottom: 7px; max-width: 190px; }
.gc-cells { display: grid; grid-template-columns: repeat(8, 22px); gap: 3px; }
.honeycomb.big .gc-cells { grid-template-columns: repeat(8, 30px); gap: 4px; }
.hex {
  width: 22px; height: 25px; position: relative;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: rgba(22,19,15,.55);
  transition: transform .12s ease;
}
.honeycomb.big .hex { width: 30px; height: 34px; }
.hex::before {
  content: ''; position: absolute; inset: 1.5px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--paper-hi);
  transition: background .15s;
}
.hex:hover { transform: scale(1.22); z-index: 2; }
.hex:hover::before { background: #dcd7c6; }
.hex.taken { background: var(--ink); }
.hex.taken::before { background: var(--ink); }
.hex .mark {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: var(--paper);
  letter-spacing: .5px;
}
.honeycomb.big .hex .mark { font-size: 10px; }
.hex.memory { background: var(--ink); }
.hex.memory::before { background: #2c2820; }
.gc-foot {
  display: flex; justify-content: space-between; margin-top: 7px;
  font-size: 9px; color: var(--ink-faint); letter-spacing: .5px;
}

/* ═══ нижний ряд ═══ */
.quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1080px) { .quad { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .quad { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; font-size: 11px; }
.list.tall { max-height: 420px; overflow-y: auto; }
.li {
  display: flex; gap: 8px; align-items: baseline;
  padding: 5.5px 2px; border-bottom: 1px dashed rgba(22,19,15,.18);
}
.li:last-child { border-bottom: none; }
.li .t { color: var(--ink-faint); font-size: 9.5px; white-space: nowrap; }
.li b { font-weight: 700; }
.li .grow { flex: 1; overflow-wrap: anywhere; }
.li .num { font-weight: 700; white-space: nowrap; }
.empty { color: var(--ink-faint); font-size: 11px; padding: 10px 2px; font-style: italic; }

/* verses */
.verses .eye { display: flex; justify-content: center; padding: 6px 0 2px; }
.verses .eye svg { width: 110px; height: 56px; }
.eye-lid { stroke: var(--ink); stroke-width: 1.5; }
.eye-pupil { fill: var(--ink); animation: pupil 7s ease-in-out infinite; }
@keyframes pupil {
  0%, 40%, 100% { transform: translate(0, 0); }
  46%, 60% { transform: translate(9px, 0); }
  66%, 80% { transform: translate(-8px, 0); }
}
.verse {
  text-align: center; font-size: 11.5px; font-style: italic;
  min-height: 64px; padding: 8px 6px; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}

/* ═══ offerings ═══ */
.offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .offer-grid { grid-template-columns: 1fr; } }
.ritual { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ritual li { display: flex; gap: 10px; font-size: 12px; align-items: baseline; }
.ritual .step {
  border: 1.5px solid var(--ink); padding: 1px 6px; font-size: 10px; font-weight: 700;
  white-space: nowrap;
}
.gene-row { padding: 8px 2px; border-bottom: 1px dashed rgba(22,19,15,.2); }
.gene-row:last-child { border-bottom: none; }
.gr-head { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; }
.gr-head b { letter-spacing: 1px; text-transform: uppercase; }
.gr-head .g { font-size: 14px; }
.gr-head .n { margin-left: auto; color: var(--ink-soft); font-size: 10.5px; }
.gr-bar { height: 8px; border: 1px solid var(--ink); margin-top: 5px; overflow: hidden; }
.gr-bar i { display: block; height: 100%; background: var(--ink); width: 0%; transition: width .9s ease; }
.gr-blurb { font-size: 9.5px; color: var(--ink-faint); margin-top: 4px; }

.tbl-scroll { max-height: 420px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.tbl th {
  text-align: left; font-size: 9.5px; letter-spacing: 1px; color: var(--ink-soft);
  border-bottom: 1.5px solid var(--line); padding: 4px 6px;
  position: sticky; top: 0; background: var(--paper-hi);
}
.tbl td { padding: 5px 6px; border-bottom: 1px dashed rgba(22,19,15,.18); }
.tbl tr:hover td { background: rgba(22,19,15,.05); }
.tbl a { border-bottom: 1px solid var(--ink-faint); }

/* ═══ brood ═══ */
.brood { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.child-card {
  border: 1.5px solid var(--line); background: rgba(250,248,240,.5);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}
.child-card:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: 4px 4px 0 rgba(22,19,15,.8); }
.child-card.dead { opacity: .55; }
.child-card.dead::after {
  content: 'DEAD'; position: absolute; top: 10px; right: 10px;
  border: 1.5px solid var(--ink); padding: 1px 7px; font-size: 9px; letter-spacing: 2px;
  transform: rotate(8deg);
}
.cc-img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 1px solid rgba(22,19,15,.4); filter: contrast(1.03);
  mix-blend-mode: multiply;
}
.cc-name { font-weight: 700; font-size: 13px; }
.cc-meta { font-size: 10px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.cc-links { display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.cc-links a { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .5px; border: 1px solid rgba(22,19,15,.4); padding: 3px 8px; transition: background .15s, color .15s; }
.cc-links a:hover { background: var(--ink); color: var(--paper); }
.cc-links img { width: 13px; height: 13px; }
.cc-links a:hover img { filter: invert(1); }
.cc-mint { font-size: 9px; color: var(--ink-faint); overflow-wrap: anywhere; }

/* ═══ diary ═══ */
.diary {
  display: flex; flex-direction: column; gap: 0; max-width: 860px;
  max-height: 68vh; overflow-y: auto; padding-right: 8px;
}
.diary-entry {
  display: flex; gap: 14px; padding: 13px 6px;
  border-bottom: 1px solid rgba(22,19,15,.25);
  align-items: baseline;
}
.diary-entry:hover { background: rgba(22,19,15,.04); }
.de-date { font-size: 9.5px; color: var(--ink-faint); white-space: nowrap; min-width: 96px; }
.de-text { flex: 1; font-size: 13px; }
.de-text.greek { font-style: italic; }
.de-kind {
  font-size: 8.5px; letter-spacing: 1.5px; border: 1px solid rgba(22,19,15,.4);
  padding: 1px 6px; color: var(--ink-soft); white-space: nowrap;
}
.de-x { display: inline-flex; }
.de-x img { width: 14px; height: 14px; opacity: .75; transition: transform .15s, opacity .15s; }
.de-x:hover img { opacity: 1; transform: scale(1.25) rotate(-6deg); }

/* ═══ book: страница старой книги ═══ */
.tome { display: flex; align-items: stretch; gap: 8px; padding: 8px 0 4px; }
.pg-btn {
  font-size: 46px; padding: 0 14px; color: var(--ink-soft);
  transition: color .15s, transform .12s;
  user-select: none;
  outline: none; -webkit-tap-highlight-color: transparent;
}
.pg-btn:focus, .pg-btn:focus-visible { outline: none; box-shadow: none; }
button:focus { outline: none; }
.pg-btn:hover { color: var(--ink); transform: scale(1.15); }
.leaf {
  flex: 1; position: relative;
  background: linear-gradient(105deg, #f8f5ea, #f2eee0 55%, #ebe6d3);
  border: 1.5px solid var(--line);
  box-shadow: inset 0 0 70px rgba(120,105,70,.16), 6px 6px 0 rgba(22,19,15,.45);
  padding: 30px clamp(24px, 6vw, 90px) 22px;
  min-height: 580px; display: flex; flex-direction: column;
}
.leaf.turn { animation: pageTurn .5s ease; }
@keyframes pageTurn {
  from { opacity: 0; transform: perspective(1100px) rotateY(-12deg); }
  to { opacity: 1; transform: none; }
}
.leaf-head {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: 2.5px;
  color: var(--ink-faint); text-transform: uppercase;
  border-bottom: 1px solid rgba(22,19,15,.3);
  padding-bottom: 9px; margin-bottom: 22px;
}
.lh-greek { font-style: italic; text-transform: none; letter-spacing: 1px; }
.leaf-body {
  flex: 1;
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 15.5px; line-height: 1.75; color: #241f16;
  text-align: justify; hyphens: auto;
}
.leaf-body .chap-no { font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--ink-faint); }
.leaf-body .chap-title {
  font-family: var(--hand); font-weight: 400;
  font-size: 36px; letter-spacing: 2px; line-height: 1.05;
  margin: 4px 0 18px;
}
.leaf-body p { margin-bottom: 12px; }
.leaf-body p:first-of-type::first-letter {
  font-family: var(--hand); font-size: 56px; line-height: .82;
  float: left; padding: 7px 10px 0 0;
}
.leaf-body .em { font-style: italic; border-bottom: 1px solid rgba(22,19,15,.35); }
.leaf-fig { margin: 6px 0 10px; width: min(46%, 340px); }
.leaf-fig.right { float: right; margin-left: 24px; }
.leaf-fig.left { float: left; margin-right: 24px; }
.leaf-fig img {
  display: block; width: 100%;
  mix-blend-mode: multiply; filter: contrast(1.05);
  border: 1px solid rgba(22,19,15,.45); padding: 5px;
  background: rgba(255,255,252,.6);
  box-shadow: 3px 3px 0 rgba(22,19,15,.25);
  transform: rotate(-.6deg);
}
.leaf-fig.left img { transform: rotate(.6deg); }
.leaf-fig figcaption {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.8px;
  color: var(--ink-faint); text-align: center; margin-top: 7px; text-transform: uppercase;
}
.leaf-folio {
  text-align: center; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 3px; color: var(--ink-soft);
  padding-top: 18px;
}
.book-refs {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 14px 6px; font-size: 11px; color: var(--ink-soft);
}
.book-refs a { display: inline-flex; gap: 5px; align-items: center; border-bottom: 1px solid rgba(22,19,15,.35); }
.book-refs img { width: 13px; height: 13px; opacity: .8; }
@media (max-width: 900px) {
  .spread { grid-template-columns: 1fr; }
  .spread::before { display: none; }
  .pg-btn { padding: 0 6px; }
}

/* ═══ модалки ═══ */
.modal {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(22, 19, 15, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: veilIn .2s ease;
}
@keyframes veilIn { from { opacity: 0; } }
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(480px, 100%);
  background: var(--paper-hi);
  border: 1.5px solid var(--line);
  padding: 20px 22px;
  box-shadow: 8px 8px 0 rgba(22,19,15,.75);
  animation: cardIn .25s ease;
}
@keyframes cardIn { from { transform: translateY(14px); opacity: 0; } }
.mc-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700; letter-spacing: 1.5px; font-size: 12px;
  border-bottom: 1.5px solid var(--line); padding-bottom: 8px; margin-bottom: 12px;
}
.mc-close { font-size: 11px; }
.mc-body { font-size: 12px; display: flex; flex-direction: column; gap: 10px; }
.mc-lore { font-style: italic; color: var(--ink-soft); }
.mc-body textarea {
  font-family: inherit; font-size: 12px; color: var(--ink);
  background: rgba(255,255,252,.7); border: 1.5px solid var(--line);
  padding: 9px; min-height: 84px; resize: vertical; outline: none;
}
.mc-body textarea:focus { box-shadow: 3px 3px 0 rgba(22,19,15,.35); }
.mc-note { font-size: 10px; color: var(--ink-faint); }
.mc-err { font-size: 11px; color: #7a1d12; min-height: 14px; }
.mc-quote { font-size: 13px; font-style: italic; padding: 8px 10px; border-left: 3px solid var(--ink); background: rgba(22,19,15,.05); overflow-wrap: anywhere; }

/* интро-окно */
.intro-card { width: min(560px, 100%); }
.intro-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.intro-links .il {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; padding: 8px 12px; letter-spacing: .6px;
}
.intro-links .il img { width: 14px; height: 14px; }
.intro-links .il:hover img { filter: invert(1); }

/* ═══ footer ═══ */
footer {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  border-top: 1.5px solid var(--line);
  padding: 12px 18px; font-size: 10.5px;
}
.f-greek { font-style: italic; letter-spacing: 1px; }
.f-dim { color: var(--ink-faint); }
.f-links { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.f-links img { width: 15px; height: 15px; opacity: .8; transition: transform .15s, opacity .15s; }
.f-links a:hover img { opacity: 1; transform: scale(1.2); }

/* скроллбары */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(22,19,15,.4); border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* ═══ адаптив ═══ */
@media (max-width: 1080px) {
  .thinking { min-height: unset; }
  .think-log { max-height: 300px; }
  .eye-view.big { height: 56vh; }
}
@media (max-width: 720px) {
  body { font-size: 12px; }
  .masthead { gap: 10px; padding: 10px 12px; }
  .brand-name { font-size: 19px; }
  .brand-sub { font-size: 9px; }
  .nav {
    order: 3; width: 100%; margin-left: 0;
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .mast-actions { margin-left: auto; }
  .btn-ink { padding: 6px 10px; font-size: 10.5px; }
  .btn-ink.big, .btn-line { padding: 9px 14px; font-size: 11.5px; }
  main { padding: 10px; }
  .hero { padding: 14px 4px 4px; }
  .hero-title { letter-spacing: 4px; }
  .hero-sub { letter-spacing: 2px; font-size: 11px; }
  .sc-head h2 { font-size: 30px; }
  .eye-wrap { padding: 8px; }
  .eye-view { height: 330px; }
  .eye-view.big { height: 52vh; min-height: 340px; }
  .quad { gap: 10px; }
  .net-grid { gap: 10px; margin-bottom: 10px; }
  .diary-entry { flex-wrap: wrap; gap: 6px 10px; padding: 10px 2px; }
  .de-date { min-width: unset; }
  .de-text { flex-basis: 100%; order: 3; }
  .tome { flex-wrap: wrap; gap: 6px; }
  .leaf { order: 1; flex-basis: 100%; min-height: unset; padding: 18px 16px 14px; }
  .pg-btn { order: 2; flex: 1; font-size: 26px; border: 1.5px solid var(--line); padding: 4px; }
  .leaf-body { font-size: 13.5px; }
  .leaf-body .chap-title { font-size: 24px; }
  .leaf-fig { float: none !important; width: 100%; margin: 10px 0; }
  .offer-grid { gap: 10px; margin-bottom: 10px; }
  .brood { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .tbl { font-size: 10px; }
  .tbl th, .tbl td { padding: 4px; }
  .modal-card { padding: 14px 14px; }
  footer { font-size: 9px; gap: 8px; padding: 10px 12px; }
}
