/* IBM Plex Mono / Sans — свои копии, без обращений к Google.
   Файлы разбиты по алфавитам: браузер качает только нужный. */

/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-400-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-500-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-600-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-700-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexMono-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-400-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-500-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ground:   #0A0C0A;
    --surface:  #101310;
    --line:     #1C211C;
    --line-lit: #2A322A;
    /* Граница полей и кнопок: по WCAG 1.4.11 нужен контраст 3:1 к фону,
       а у --line-lit его 1,48 — поля было почти не видно. Здесь 3,02. */
    --edge:     #556155;
    --text:     #EDE9DE;
    --muted:    #8B9088;
    --dim:      #767F74;   /* контраст к фону 4,73:1 — минимум для мелкого текста 4,5 */
    --accent:   #35D97A;
    --accent-d: #0F2419;
    --critical: #FF4438;

    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --pad: clamp(24px, 6vw, 120px);
    --maxw: 1320px;
  }

  * { box-sizing: border-box; }

  /* без этого display:flex у панели чата перебивает браузерное [hidden] */
  [hidden] { display: none !important; }

  body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  a { color: var(--accent); text-decoration: none; }
  a:hover { color: var(--text); }

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

  /* Подпись только для тех, кто слушает страницу голосом. Класс был в разметке
     поиска, а правила под него не было — и подпись «Что ищем» висела на виду. */
  .visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }

  h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.035em; text-wrap: balance; }

  p { margin: 0; }

  .wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: var(--pad);
    padding-right: var(--pad);
  }

  .rule { border-bottom: 1px solid var(--line); }

  /* ── prompt line ─────────────────────────────────── */
  .prompt {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 13.5px;
    color: var(--muted);
  }
  .prompt span:first-child { color: var(--accent); }

  .label {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--dim);
    text-transform: uppercase;
  }

.lede {
    font-size: clamp(19px, 2.4vw, 26px);
    line-height: 1.35;
    letter-spacing: -0.015em;
    margin-bottom: 24px;
    max-width: 22ch;
    text-wrap: balance;
  }
  .prose {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--muted);
    max-width: 62ch;
    text-wrap: pretty;
  }

  /* ── header ──────────────────────────────────────── */
  header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--ground) 94%, transparent);
    border-bottom: 1px solid var(--line);
  }
  .head-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .brand { display: flex; align-items: center; gap: 13px; min-height: 44px; }
  .mark {
    position: relative;
    width: 28px; height: 28px;
    border-radius: 9px;
    background: var(--text);
    display: grid; place-items: center;
    flex: none;
  }
  .mark b {
    color: var(--ground);
    font-size: 18px; font-weight: 700; line-height: 1;
    margin-top: -2px;
  }
  .mark i {
    position: absolute; top: -3px; right: -3px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--ground);
  }
  .host { font-size: 13px; color: var(--muted); }

  nav { display: flex; align-items: center; gap: 28px; font-size: 13px; }
  nav a { color: var(--muted); padding: 8px 0; }
  nav a:hover { color: var(--text); }

  .lang { display: flex; border: 1px solid var(--line); flex: none; }
  .lang button {
    font: inherit;
    font-size: 12px;
    padding: 6px 11px;
    min-height: 32px;
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
  }
  .lang button[aria-pressed="true"] {
    background: var(--accent);
    color: var(--ground);
    font-weight: 600;
  }
  .lang button:hover:not([aria-pressed="true"]) { color: var(--text); }

  /* ── hero ────────────────────────────────────────── */
  .hero {
    padding-top: clamp(48px, 7vw, 80px); padding-bottom: 84px;
    position: relative; overflow: hidden;
    /* было 880: между текстом и подсказкой «листайте» висело 177 пустых пикселей */
    min-height: min(calc(100svh - 73px), 760px);
    display: flex; flex-direction: column; justify-content: center;
  }
  /* ── загрузочный экран: терминал поднимает сайт и уезжает вверх ── */
  #boot { position: fixed; inset: 0; z-index: 200; background: var(--ground); display: flex; align-items: center; justify-content: center; transition: transform .7s cubic-bezier(.16,1,.3,1), opacity .5s; cursor: pointer; }
  #boot.away { transform: translateY(-100%); opacity: .6; pointer-events: none; }
  #boot pre { margin: 0; font: 14px/1.9 var(--mono); color: var(--muted); min-width: min(560px, 88vw); white-space: pre-wrap; }
  #boot .ok { color: var(--accent); }
  #boot .cur { display: inline-block; width: .6em; height: 1.1em; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
  #boot .hint { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
  .hero .card { position: relative; transform-style: preserve-3d; transition: transform .3s ease-out, opacity .7s ease; will-change: transform; }
  .hero .prompt, .hero .lede, .hero .prose, .hero .scroll-cue { transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
  .hero h1 { transition: opacity .7s cubic-bezier(.16,1,.3,1); }
  .hero.boot .prompt, .hero.boot .lede, .hero.boot .prose, .hero.boot .scroll-cue { opacity: 0; transform: translateY(14px); }
  .hero.boot h1, .hero.boot .card { opacity: 0; }
  header, .chat-fab, .progress { transition: opacity .7s ease; }
  body.entering header, body.entering .chat-fab, body.entering .progress { opacity: 0; }
  .hero .card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.09), transparent 55%); opacity: 0; transition: opacity .3s; }
  .hero .card.lit::after { opacity: 1; }
  .hero > .scroll-cue { position: absolute; left: var(--pad); bottom: 26px; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
  .scroll-cue:hover { color: var(--accent); }
  .cue-line { display: block; width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); transform-origin: top; animation: cue 1.8s ease-in-out infinite; }
  @keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
  .tick { display: inline-block; padding-left: 100%; animation: tick 46s linear infinite; }
  .ticker:hover .tick { animation-play-state: paused; }
  .tick a { color: var(--muted); }
  .tick a:hover { color: var(--accent); }
  @keyframes tick { to { transform: translateX(-100%); } }

  /* ── экранные детали: линия прокрутки, часы, растр ── */
  .progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 85; box-shadow: 0 0 10px rgba(53,217,122,.7); pointer-events: none; }
  body::after {
    content: ''; position: fixed; inset: 0; z-index: 95; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.35));
  }
  .term-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 1px solid var(--line); min-height: 32px; padding: 0 10px; cursor: pointer; letter-spacing: .04em; }
  .term-btn:hover { color: var(--accent); border-color: var(--accent); }
  .prompt { cursor: pointer; }
  .prompt:hover span:first-child { text-shadow: 0 0 10px rgba(53,217,122,.8); }

  /* ── курсор-скобки ──────────────────────────────── */
  .cur { position: fixed; left: 0; top: 0; z-index: 99; pointer-events: none; width: 12px; height: 18px; background: rgba(53,217,122,.85); opacity: 0; transition: width .22s ease, height .22s ease, background .22s ease, opacity .3s; }
  .cur.on { opacity: 1; }
  .cur.link {
    background: transparent;
    background-image:
      linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px;
    background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
  }

  /* ── терминал ───────────────────────────────────── */
  .term { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: min(46vh, 440px); background: rgba(10,12,10,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line-lit); box-shadow: 0 -30px 80px rgba(0,0,0,.6); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .45s cubic-bezier(.16,1,.3,1); }
  .term.open { transform: none; }
  .term-head { display: flex; align-items: center; justify-content: space-between; padding: 8px var(--pad); border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
  .term-head button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; min-height: 32px; }
  .term-head button:hover { color: var(--text); }
  .term-out { flex: 1; overflow-y: auto; padding: 14px var(--pad) 6px; font-size: 13.5px; line-height: 1.75; }
  .term-out .l { white-space: pre-wrap; word-break: break-word; animation: lin .25s ease both; }
  .term-out .cmd { color: var(--text); }
  .term-out .cmd::before { content: '$ '; color: var(--accent); }
  .term-out .dim { color: var(--muted); }
  .term-out .ok { color: var(--accent); }
  .term-out .err { color: #FF8B82; }
  .term-out a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-lit); }
  .term-out a:hover { color: var(--accent); }
  @keyframes lin { from { opacity: 0; transform: translateY(4px); } }
  .term-in { display: flex; gap: 10px; align-items: center; padding: 10px var(--pad) 16px; border-top: 1px solid var(--line); }
  .term-in .ps { color: var(--accent); white-space: nowrap; font-size: 13.5px; }
  .term-in input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 15px; outline: none; caret-color: var(--accent); padding: 6px 0; }

  .chat-fab::before { content: ''; position: absolute; inset: 0; border: 1px solid var(--accent); animation: ring 2.6s ease-out 3; pointer-events: none; }
  @keyframes ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35, 1.9); opacity: 0; } }

  /* ── касания: всплеск сигнала, нажатия, меню, чат ── */
  .ripple { position: absolute; width: 14px; height: 14px; border: 1px solid var(--accent); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 2; animation: ripple .9s cubic-bezier(.16,1,.3,1) forwards; }
  .ripple::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--accent); opacity: .5; animation: ripple2 1.2s cubic-bezier(.16,1,.3,1) forwards; }
  @keyframes ripple { 0% { opacity: .9; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(18); } }
  @keyframes ripple2 { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(2.4); } }
  .hero h1 { will-change: transform; }
  @media (hover: none) {
    .row:active { background: linear-gradient(90deg, rgba(53,217,122,.12), transparent 70%); transition-duration: .12s; }
    .row:active .cols { transform: translateX(10px); transition-duration: .12s; }
    .row:active::before { transform: scaleY(1); }
    .row:active .arrow { transform: translateX(6px); color: var(--text); }
    .entry:active h3 a { color: var(--accent); }
  }
  nav.open .menu-links .navlink { animation: menuIn .38s cubic-bezier(.16,1,.3,1) both; }
  nav.open .menu-links .navlink:nth-child(2) { animation-delay: .06s; }
  nav.open .menu-links .navlink:nth-child(3) { animation-delay: .12s; }
  @keyframes menuIn { from { opacity: 0; transform: translateX(-14px); } }
  .chat-panel { animation: chatIn .45s cubic-bezier(.16,1,.3,1) both; }
  @keyframes chatIn { from { opacity: 0; transform: translateY(28px) scale(.98); } }
  .term-chips { display: none; gap: 8px; padding: 10px var(--pad) 0; overflow-x: auto; scrollbar-width: none; }
  .term-chips::-webkit-scrollbar { display: none; }
  .term-chips button { flex: none; font: inherit; font-size: 12.5px; min-height: 36px; padding: 0 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line-lit); cursor: pointer; }
  .term-chips button:active { color: var(--ground); background: var(--accent); }
  @media (hover: none) { .term-chips { display: flex; } }

  .post-body figure, .entry-cover { clip-path: inset(0 100% 0 0); transition: clip-path .9s cubic-bezier(.16,1,.3,1); }
  .post-body figure.wiped, .entry-cover.wiped { clip-path: inset(0 0 0 0); }

  .hero > * { position: relative; z-index: 1; }
  #wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .6; z-index: 0; }
  .hero h1 { font-variant-ligatures: none; }
  .hero h1 .g { display: inline-block; min-width: .62em; }
  .hero h1 .g.rnd { color: var(--dim); }
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
    margin-top: 40px;
  }
  .hero h1 {
    font-size: clamp(54px, 11.5vw, 150px);
    line-height: 0.92;
    margin-bottom: 26px;
  }
  .caret {
    color: var(--accent);
    animation: blink 1.15s steps(1) infinite;
  }
  @keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

  .card {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 22px 24px;
  }
  .spec {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 13px 20px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }
  .spec dt { color: var(--dim); }
  .spec dd { margin: 0; color: var(--text); }
  .dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: var(--accent);
    margin-right: 8px;
    vertical-align: 1px;
  }

  /* ── section ─────────────────────────────────────── */
  section { padding-top: clamp(52px, 8vw, 84px); padding-bottom: clamp(52px, 8vw, 84px); }
  /* Одинаковые отступы у всех разделов делали страницу ровной и безлицей.
     Список проектов держим плотнее, приглашение в чат — просторнее. */
  section#work { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px); }
  section#contact { padding-top: clamp(72px, 11vw, 128px); padding-bottom: clamp(72px, 11vw, 128px); }
  section#tools { padding-top: clamp(30px, 4vw, 44px); padding-bottom: clamp(30px, 4vw, 44px); }
  /* панель чата и терминал — тоже section, но отступы секций страницы им не нужны */
  section.chat-panel, section.term { padding: 0; }
  .sec-head { margin-bottom: 36px; }
  /* Раньше размер прыгал от гигантского имени сразу к тексту в 15px:
     приглашение раздела теперь читается как заголовок, а не как сноска. */
  .sec-head span:last-child { font-size: clamp(15px, 1.5vw, 17px); }

  /* ── project table ───────────────────────────────── */
  .cols {
    display: grid;
    grid-template-columns: 84px minmax(0, 190px) minmax(0, 1fr) 180px 28px;
    gap: 24px;
    align-items: center;
  }
  .thead { padding-bottom: 12px; }
  .thead span { font-size: 11px; letter-spacing: 0.1em; color: var(--dim); }

  .row {
    position: relative;
    border-top: 1px solid var(--line);
    padding: 24px 8px 24px 0;
    color: var(--text);
    transition: background .3s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font: inherit;
    background: none;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  .row:last-of-type { border-bottom: 1px solid var(--line); }
  .row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transition: transform .35s cubic-bezier(.16,1,.3,1); }
  .row .cols { transition: transform .35s cubic-bezier(.16,1,.3,1); }
  .row:hover { background: linear-gradient(90deg, rgba(53,217,122,.07), transparent 60%); }
  .row:hover .cols { transform: translateX(14px); }
  .row:hover::before { transform: scaleY(1); }
  .row:hover .arrow { transform: translateX(6px); color: var(--text); }
  .row-name { display: flex; align-items: center; gap: 12px;
              font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
  /* Знак проекта: рисуется кодом из его имени — картинок на сайте нет. */
  .mark { flex: none; width: 30px; height: 30px; color: var(--accent); opacity: .72;
          transition: opacity .3s ease, color .3s ease; }
  .row:hover .mark { opacity: 1; }
  .mark-big { display: block; margin-bottom: 18px; }
  .mark-big .mark { width: 56px; height: 56px; opacity: .9; }
  .row-what { font-size: 14px; color: var(--muted); font-family: var(--sans); }
  .row-url { font-size: 13px; color: var(--dim); }
  .arrow { color: var(--accent); transition: transform .35s cubic-bezier(.34,1.56,.64,1), color .3s; font-weight: 600; display: inline-block; }
  .s-live { text-shadow: 0 0 12px rgba(53,217,122,.45); }

  /* ── карточка проекта за курсором ─────────────────── */
  .preview {
    position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
    width: 260px; padding: 16px 18px;
    border: 1px solid var(--line-lit); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0,0,0,.6);
    opacity: 0; transition: opacity .25s;
  }
  .preview.on { opacity: 1; }
  .preview .label { display: block; margin-bottom: 8px; }
  .preview strong { display: block; font-size: 16px; letter-spacing: -.02em; margin-bottom: 6px; }
  .preview p { font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.5; }
  .preview .led { position: absolute; top: 16px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: breathe 1.6s ease-in-out infinite; }
  .preview .led.off { background: var(--dim); box-shadow: none; animation: none; }
  @keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

  /* ── появление строками, как вывод команды ──────── */
  .reveal [data-line] { opacity: 0; transform: translateY(14px); transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1); }
  .reveal.in [data-line] { opacity: 1; transform: none; }
  .reveal { position: relative; }
  .reveal::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(53,217,122,.9), transparent); opacity: 0; pointer-events: none; }
  .reveal.in::before { animation: scan 1.1s cubic-bezier(.16,1,.3,1) forwards; }
  @keyframes scan { 0% { opacity: .9; transform: translateY(0); } 100% { opacity: 0; transform: translateY(var(--h, 600px)); } }
  .reveal .sec-head span:last-child { position: relative; }
  .reveal .sec-head span:last-child::after { content: ''; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--accent); transition: width .8s cubic-bezier(.16,1,.3,1) .2s; }
  .reveal.in .sec-head span:last-child::after { width: 100%; }

  /* ── переход в кейс: название перелетает ─────────── */
  .case-head h1 { view-transition-name: case-title; }
  ::view-transition-old(case-title), ::view-transition-new(case-title) { animation-duration: .55s; animation-timing-function: cubic-bezier(.16,1,.3,1); }
  ::view-transition-old(root) { animation: vt-out .3s ease both; }
  ::view-transition-new(root) { animation: vt-in .45s ease both; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; } }
  @view-transition { navigation: auto; }

  .status { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
  .s-live { color: var(--accent); }
  .s-beta { color: #C9B15C; }
  .s-lab  { color: #6E7A6C; }

  /* ── stack ───────────────────────────────────────── */
  .stack-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(24px, 3.5vw, 48px);
  }
  .stack-col .label { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .stack-col span:not(.label) { font-size: 14px; }

  /* ── contact ─────────────────────────────────────── */
  .contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    align-items: flex-start;
    justify-content: space-between;
  }
  .contact-grid h2 {
    font-size: clamp(30px, 5vw, 50px);
    line-height: 1.05;
    max-width: 14ch;
  }

  footer {
    border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center; justify-content: space-between;
    padding-top: 26px; padding-bottom: 26px;
    font-size: 12px; color: var(--dim);
  }

  /* ── case page ───────────────────────────────────── */
  .back {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--muted); min-height: 44px;
  }
  .back:hover { color: var(--accent); }

  .case-head { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(44px, 7vw, 64px); }
  .case-head h1 {
    font-size: clamp(42px, 8vw, 76px);
    line-height: 0.95;
    margin: 24px 0 28px;
  }
  /* Заголовок проекта: крупно короткое имя, следом — что это такое.
     Раньше в h1 стояло только имя вроде tropa, и поисковику было не за что зацепиться. */
  .case-h1 { display: flex; flex-direction: column; gap: 10px; }
  .case-h1 .case-id { display: block; }
  .case-h1 .case-what {
    font-family: var(--sans); font-size: clamp(17px, 2.4vw, 22px); font-weight: 400;
    letter-spacing: 0; line-height: 1.4; color: var(--muted); max-width: 34ch;
  }

  .case-lede {
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.4;
    letter-spacing: -0.01em;
    max-width: 34ch;
    margin-bottom: 52px;
    text-wrap: balance;
  }
  .meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 40px);
    border-top: 1px solid var(--line);
    padding-top: 30px;
  }
  .meta div { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
  .meta p { font-size: 14px; overflow-wrap: anywhere; }
  .meta a { display: inline-block; padding: 6px 0; margin: -6px 0; }

  .two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(32px, 5vw, 72px);
  }
  .two .label { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; display: block; }

  .notes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 48px);
  }
  .note h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 12px; }
  .note p { font-family: var(--sans); font-size: 14.5px; line-height: 1.65; color: var(--muted); text-wrap: pretty; }

  .state {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 28px 26px;
    display: flex; flex-direction: column; gap: 24px;
    min-height: 268px;
  }
  .state.off { border-color: #2E1614; background: #150F0E; }
  .state.off .state-cmd { color: #7A605E; }
  .state h4 { margin: 0; font-size: clamp(22px, 2.4vw, 29px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
  .state.off .state-row { color: #7A605E; }
  .state.off .state-val { color: var(--critical); }
  .state.off .bar { background: #2E1614; }
  .state.off .bar i { background: var(--critical); }

  /* build block */
  .build {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 22px 24px;
    display: flex; flex-direction: column; gap: 14px;
  }
  .build code {
    font-family: var(--mono);
    font-size: 12.5px;
    color: #6E7A6C;
    display: block;
  }
  .build code.out { color: var(--accent); }

  .tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; }
  .tag { border: 1px solid var(--line); padding: 6px 12px; font-size: 12px; color: var(--muted); }
  /* ── арена: морской бой ─────────────────────── */
  .play-link { color: var(--accent) !important; }

  /* дуэль */
  .duel { display: grid; grid-template-columns: minmax(0,1fr) 90px minmax(0,1fr); gap: 18px; align-items: start; }
  .f-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .f-hp.low i { background: var(--critical); }
  .f-float .float {
    position: absolute; left: 50%; top: 42%; transform: translateX(-50%);
    font-size: 26px; font-weight: 700; color: var(--critical); animation: floatup 1.2s ease-out forwards;
  }
  .f-float .float.zero { font-size: 14px; color: var(--dim); }
  @keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }
  @keyframes fshake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }
  @media (prefers-reduced-motion: reduce) { .fighter.shake { animation: none; } .f-float .float { animation-duration: .01s; } }

  .acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 24px; }
  .act:hover:not(.off) { border-color: var(--accent); background: rgba(53,217,122,.08); transform: translateY(-2px); }
  .act.off { opacity: .4; cursor: default; }
  .act.chosen { border-color: var(--accent); background: rgba(53,217,122,.14); }

  @media (max-width: 760px) {
    .duel { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .duel-mid { padding: 0; flex-direction: row; gap: 14px; justify-content: center; }
    .fighter { padding: 16px 18px 18px; }
    .f-art { font-size: 13px; }
    .acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 900px) {
    .grid { max-width: 100%; }
  }

  .play-strip {
    position: relative; display: grid; gap: 10px; padding: 34px 36px;
    border: 1px solid var(--line-lit); overflow: hidden;
    background: linear-gradient(115deg, rgba(53,217,122,.06), transparent 46%);
    transition: border-color .3s, background .3s;
  }
  .play-strip:hover { border-color: rgba(53,217,122,.5); background: linear-gradient(115deg, rgba(53,217,122,.11), transparent 52%); }
  .ps-cmd { font-size: 12.5px; color: var(--dim); letter-spacing: .04em; }
  .ps-cmd span { color: var(--accent); }
  .ps-title { font-size: clamp(24px, 3.4vw, 38px); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
  .ps-note { font-family: var(--sans); font-size: 14.5px; color: var(--muted); max-width: 52ch; line-height: 1.6; }
  .ps-go { font-size: 13px; color: var(--accent); display: inline-flex; align-items: center; gap: 9px; margin-top: 6px; }
  .play-strip:hover .ps-go .arrow { transform: translateX(6px); }
  .ps-go .arrow { transition: transform .3s cubic-bezier(.2,.9,.3,1); }
  .ps-track {
    position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(53,217,122,.12); overflow: hidden;
  }
  .ps-track i { position: absolute; inset: 0 auto 0 0; width: 22%; background: var(--accent); animation: psrun 2.6s cubic-bezier(.6,.05,.4,.95) infinite; }
  @keyframes psrun { 0% { left: -24%; } 100% { left: 104%; } }
  @media (prefers-reduced-motion: reduce) { .ps-track i { animation: none; left: 0; } }
  .ach { border: 1px solid var(--line); padding: 14px 16px; display: flex; gap: 11px; align-items: baseline; font-size: 13px; color: var(--dim); }
  .ach i { font-style: normal; }
  .ach.got { border-color: rgba(53,217,122,.4); color: var(--text); background: rgba(53,217,122,.04); }
  .ach.got i { color: var(--accent); }
  .ach-toast {
    position: fixed; left: 24px; bottom: 24px; z-index: 70; border: 1px solid var(--accent);
    background: #0B120D; padding: 13px 18px; display: flex; gap: 12px; align-items: baseline;
    transform: translateY(140%); transition: transform .5s cubic-bezier(.2,.9,.3,1);
    box-shadow: 0 0 40px rgba(53,217,122,.15);
  }
  .ach-toast.in { transform: translateY(0); }
  .ach-toast em { font-style: normal; font-size: 11px; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
  .ach-toast b { font-weight: 500; font-size: 14px; }
  @media (max-width: 640px) {
    .ach-toast { left: 14px; right: 14px; bottom: 88px; }
  }

  .post-ru-note { font-size: 13px; color: var(--dim); border-left: 2px solid var(--line-lit); padding-left: 14px; margin-top: 8px; }

  /* баннер бота, повторённый вёрсткой */

  .next {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    border: 1px solid var(--line);
    padding: 32px 36px;
    color: var(--text);
  }
  .next:hover { border-color: var(--line-lit); background: var(--surface); color: var(--text); }
  .next:hover .arrow { transform: translateX(5px); }
  .next-name { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.025em; margin-top: 8px; display: block; }

  /* ── responsive ──────────────────────────────────── */

  /* ── страница записи ─────────────────────────────── */
  .post-head { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(36px, 5vw, 52px); }
  .post-head h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1.02; margin: 22px 0 20px; max-width: 20ch; }
  .post-head .entry-sum { font-size: clamp(17px, 2vw, 21px); color: var(--muted); max-width: 60ch; }
  .post-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline; margin-top: 26px; font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
  .post-meta .entry-kind { font-size: 11px; }
  .post-body { max-width: 68ch; font-family: var(--sans); font-size: 17px; line-height: 1.75; color: var(--text); }
  .post-body p { margin: 0 0 1.25em; text-wrap: pretty; }
  .post-body h3 { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 2em 0 0.7em; }
  .post-body h4 { font-family: var(--mono); font-size: 17px; font-weight: 600; margin: 1.6em 0 0.6em; }
  .post-body ul { padding-left: 1.3em; margin: 0 0 1.25em; }
  .post-body li { margin-bottom: 0.4em; }
  .post-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-lit); }
  .post-body a:hover { text-decoration-color: var(--accent); }
  .post-body code { font-family: var(--mono); font-size: 0.88em; background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; }
  .post-body pre { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; overflow-x: auto; margin: 0 0 1.4em; }
  .post-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
  .post-body blockquote { margin: 0 0 1.4em; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--muted); }
  .post-body figure { margin: 1.8em 0; max-width: none; }
  .post-body img, .post-body video { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--surface); }
  .post-body figcaption { font-family: var(--mono); font-size: 12.5px; color: var(--dim); margin-top: 10px; }
  .post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .post-nav a { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); padding: 22px 24px; color: var(--text); min-height: 44px; }
  .post-nav a:hover { border-color: var(--line-lit); background: var(--surface); color: var(--text); }
  .post-nav a.next { text-align: right; align-items: flex-end; }
  .post-nav .post-nav-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
  .entry h3 a { color: var(--text); }
  .entry h3 a:hover { color: var(--accent); }
  .entry-cover { display: block; width: 100%; max-width: 620px; height: auto; border: 1px solid var(--line); margin: 14px 0 4px; }

  /* ── мобильное меню ──────────────────────────────── */
  .menu-btn { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
  .menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: transform 180ms ease, opacity 180ms ease; }
  nav.open .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  nav.open .menu-btn span:nth-child(2) { opacity: 0; }
  nav.open .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .menu-links { display: contents; }

  @media (max-width: 980px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); }
    .card { max-width: 420px; }
    .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .notes { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .two { grid-template-columns: minmax(0, 1fr); gap: 32px; }

    /* Таблица проектов держит четыре колонки фиксированной ширины: статус 84,
       имя 190, адрес 180, стрелка 28 плюс отступы. На 768 пикселях описанию
       оставалось 97 — оно ломалось на пять строк, и строки раздувались втрое.
       Ниже тысячи переходим на ту же раскладку, что и на телефоне. */
    .thead { display: none; }
    .row .cols {
      grid-template-columns: auto minmax(0, 1fr) auto;
      grid-template-areas: "status name arrow" "what what what" "url url url";
      gap: 6px 12px;
      align-items: baseline;
    }
    .row .cols > :nth-child(1) { grid-area: status; }
    .row .cols > :nth-child(2) { grid-area: name; }
    .row .cols > :nth-child(3) { grid-area: what; font-size: 14.5px; }
    .row .cols > :nth-child(4) { grid-area: url; font-size: 12.5px; }
    .row .cols > :nth-child(5) { grid-area: arrow; }
    .row { padding: 18px 0; }
  }

  @media (max-width: 760px) {
    .preview, .clock, .cur { display: none; }
    .hero > .scroll-cue { display: none; }   /* иначе правило с большей специфичностью возвращает подсказку на телефон */
    nav { gap: 10px; }
    .head-in { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
    .host { font-size: 12px; }
    .lang button { padding: 8px 11px; min-height: 40px; }
    .term-btn { min-height: 40px; padding: 0 12px; }
    .menu-links .navlink { min-height: 52px; font-size: 16px; }
    /* строка проекта: статус · имя · стрелка, под ними описание и адрес */
    .row .cols {
      grid-template-columns: auto minmax(0, 1fr) auto;
      grid-template-areas: "status name arrow" "what what what" "url url url";
      gap: 6px 12px;
      align-items: baseline;
    }
    .row .cols > :nth-child(1) { grid-area: status; }
    .row .cols > :nth-child(2) { grid-area: name; }
    .row .cols > :nth-child(3) { grid-area: what; font-size: 14.5px; }
    .row .cols > :nth-child(4) { grid-area: url; font-size: 12.5px; }
    .row .cols > :nth-child(5) { grid-area: arrow; }
    .row { padding: 18px 0; }
    /* Дата занимала колонку в 132px, и на текст записи оставалось 182px из 342:
       заголовки ломались на четыре строки. Ставим дату над заголовком.
       Селектор из двух классов — базовое правило .entry идёт ниже по файлу. */
    .feed .entry { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .entry .entry-meta { flex-direction: row; align-items: baseline; gap: 12px; padding-top: 0; }
    .entry h3, .entry-title { font-size: 19px; }
    /* поля ввода не меньше 16px — иначе iPhone приближает страницу при фокусе */
    .chat-panel .chat-foot textarea, .chat-panel .chat-name input, .term .term-in input { font-size: 16px; }
    .chat-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .chat-head { padding-top: calc(14px + env(safe-area-inset-top)); }
    .term-in { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    .term-out { font-size: 14px; }
    body::after { display: none; }
    .hero { min-height: auto; padding-bottom: clamp(52px, 8vw, 88px); }
    .hero h1 { font-size: clamp(50px, 15vw, 96px); }
    .term { height: min(60vh, 460px); }
    .row:hover .cols { transform: none; }
    .menu-btn { display: flex; }
    .menu-links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ground); border-bottom: 1px solid var(--line); padding: 8px 0; }
    nav.open .menu-links { display: block; }
    .menu-links .navlink { display: flex; align-items: center; min-height: 48px; padding: 0 var(--pad); font-size: 15px; color: var(--text); }
    .post-nav { grid-template-columns: minmax(0, 1fr); }
    .post-nav a.next { text-align: left; align-items: flex-start; }
    .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
    .meta p { font-size: 13px; }
    .thead { display: none; }
    .cols { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .row { padding: 20px 0; }
    .row:hover { padding-left: 0; }
    .row .cols { align-items: start; }
    .r-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .row-url-line { display: flex; align-items: center; gap: 8px; }
    .lede { max-width: none; }
  }

  /* ── лента журнала ───────────────────────────────── */
  .feed { display: flex; flex-direction: column; }
  /* На широком экране колонка текста занимала меньше половины ширины,
     а справа оставалась пустота — раскладываем ленту в две колонки. */
  @media (min-width: 1180px) {
    .feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
            column-gap: clamp(40px, 4vw, 64px); }
    .feed .entry { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .feed .entry-meta { flex-direction: row; align-items: baseline; gap: 12px; padding-top: 0; }
    /* Верхняя линейка нужна только первому ряду в каждой колонке. */
    .feed .entry:nth-child(-n+2) { border-top: 1px solid var(--line); }
    .feed .entry:last-child, .feed .entry:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  }
  .entry {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 28px;
    padding: 26px 0;
    border-top: 1px solid var(--line);
  }
  .entry:last-child { border-bottom: 1px solid var(--line); }
  .entry-meta { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
  .entry-col { display: block; min-width: 0; }
  .entry-title { font-size: clamp(18px, 2.2vw, 21px); font-weight: 600;
                 letter-spacing: -0.02em; margin-bottom: 10px; }
  a.entry:hover .entry-title { color: var(--accent); }
  .entry-date { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
  .entry-kind { font-size: 11px; letter-spacing: 0.1em; color: var(--accent); }
  .entry-kind.log { color: var(--dim); }
  .entry h3 { font-size: clamp(18px, 2.2vw, 21px); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 10px; }
  .entry-sum { font-family: var(--sans); font-size: 15.5px; line-height: 1.7; color: var(--text); max-width: 62ch; text-wrap: pretty; }
  .entry-link { display: inline-block; margin-top: 8px; padding: 8px 0; font-size: 13px; }
  .feed-all { display: inline-block; margin-top: 22px; padding: 10px 0; font-size: 13px; color: var(--accent); }

  /* Инструменты на главной: подсобка, поэтому одной строкой и без веса */
  .tools-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; }
  .tools-line.recent { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
  .tools-lab { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
  .tools-list { font-size: 13.5px; line-height: 1.85; color: var(--muted); }
  .tools-list a { color: var(--muted); }
  .tools-list a:hover { color: var(--accent); }
  .tools-list i { font-style: normal; color: var(--line-lit); }
  .tools-all { font-size: 13px; color: var(--accent); white-space: nowrap; }

  /* Журнал: рубрики, страницы, лента */
  .tag-bar { display: flex; flex-wrap: wrap; gap: 8px; }
  .tag { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: transparent;
         border: 1px solid var(--line); padding: 8px 14px; min-height: 38px; cursor: pointer; }
  .tag i { font-style: normal; color: var(--dim); }
  .tag:hover { border-color: var(--accent); color: var(--text); }
  .tag.on { border-color: var(--accent); color: var(--ground); background: var(--accent); }
  .tag.on i { color: var(--ground); opacity: .65; }
  .post-temas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 22px 0; }
  .post-temas span { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
  .post-temas a { font-size: 13.5px; border: 1px solid var(--edge); padding: 6px 12px; color: var(--muted); }
  .post-temas a:hover { border-color: var(--accent); color: var(--accent); }
  .jr-temas { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
  .jr-temas span { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
  .jr-temas a { font-size: 13.5px; border: 1px solid var(--edge); padding: 6px 12px; color: var(--muted); }
  .jr-temas a:hover { border-color: var(--accent); color: var(--accent); }
  .entry-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .entry-tags span { font-size: 11.5px; letter-spacing: .06em; color: var(--tag, var(--dim));
                     text-transform: uppercase; }
  /* Сдержанные оттенки по темам: рубрику видно боковым зрением,
     но сайт не превращается в радугу. */
  [data-tag="игры"] { --tag: #7fd6a6; }
  [data-tag="хостинг"] { --tag: #8fb4d9; }
  [data-tag="производительность"] { --tag: #d9c07f; }
  [data-tag="видео"] { --tag: #c79fd6; }
  [data-tag="проекты"] { --tag: #9aa79b; }
  .tag[data-tag] { color: var(--tag, var(--muted)); }
  .tag.on[data-tag] { color: var(--ground); }
  .feed-none { padding: 34px 0; color: var(--dim); font-size: 14px; }
  .pager { display: flex; align-items: center; gap: 20px; font-size: 13px; }
  .pager span { color: var(--dim); }
  .feed-rss { font-family: var(--sans); font-size: 14px; color: var(--muted); }
  .toc { max-width: 62ch; }
  .toc ol { list-style: none; counter-reset: toc; margin-top: 14px; }
  .toc li { counter-increment: toc; margin-bottom: 10px; font-size: 14.5px; }
  .toc li::before { content: counter(toc) '. '; color: var(--dim); }
  .toc a { color: var(--muted); }
  .toc a:hover { color: var(--accent); }
  /* Отступ под шапку при переходе по якорю — прокручивает сам браузер. */
  .post-body h3, #feed, #work, #contact { scroll-margin-top: 90px; }
  .feed-empty {
    padding: 40px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--dim);
    font-size: 14px;
  }

  /* ── чат ─────────────────────────────────────────── */
  /* Плашка про статистику: показывается один раз и ничего не перекрывает —
     согласия она не спрашивает, это уведомление об обезличенном счётчике. */
  @media (max-width: 560px) {
  }

  .chat-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 60;
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px; min-height: 52px;
    background: var(--accent); color: var(--ground);
    border: 0; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
    box-shadow: 0 10px 34px rgba(0,0,0,.55);
  }
  .chat-fab:hover { background: #4BE88C; }
  /* Плашка о статистике прижата к низу во всю ширину и на телефоне
     полностью накрывала кнопку чата — поднимаем кнопку над ней. */
  .chat-fab .live { width: 8px; height: 8px; border-radius: 50%; background: var(--ground); }

  .chat-panel {
    position: fixed; right: 20px; bottom: 20px; z-index: 61;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 40px));
    background: var(--ground); border: 1px solid var(--line-lit);
    display: flex; flex-direction: column;
    box-shadow: 0 24px 70px rgba(0,0,0,.65);
  }
  .chat-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
  }
  .chat-head strong { font-size: 14px; font-weight: 600; }
  .chat-head .sub { font-size: 11.5px; color: var(--dim); display: block; margin-top: 2px; }
  .chat-close {
    background: none; border: 0; color: var(--muted); font: inherit; font-size: 20px;
    cursor: pointer; width: 44px; height: 44px; line-height: 1;
  }
  .chat-close:hover { color: var(--text); }
  .chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
  .chat-bubble {
    max-width: 84%; padding: 10px 13px;
    font-family: var(--sans); font-size: 14.5px; line-height: 1.55;
    white-space: pre-wrap; word-wrap: break-word;
  }
  .chat-bubble.me { align-self: flex-end; background: #122A1C; border: 1px solid #1F4A32; }
  .chat-bubble.him { align-self: flex-start; background: var(--surface); border: 1px solid var(--line-lit); }
  .chat-bubble.sys { align-self: center; background: none; border: 0; color: var(--dim); font-size: 13px; text-align: center; }
  .chat-bubble .t { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 5px; text-align: right; }
  .chat-bubble.him .t { text-align: left; }
  .chat-bubble.fail { border-color: #4A1F1B; }
  .chat-bubble.fail .t { color: #FF8B82; }
  .chat-bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  .chat-read { align-self: flex-end; font-family: var(--mono); font-size: 10.5px; color: var(--accent); margin-top: -6px; }
  .chat-name { padding: 10px 12px 0; }
  .chat-name input { width: 100%; font: inherit; font-size: 12.5px; min-height: 36px; padding: 6px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); }
  .chat-name input:focus { border-color: var(--accent); outline: none; }
  .chat-fab .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ground); color: var(--accent); font-size: 11px; display: grid; place-items: center; }
  .chat-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 9px; align-items: flex-end; }
  .chat-foot textarea {
    flex: 1; font: inherit; font-family: var(--sans); font-size: 14.5px;
    min-height: 44px; max-height: 120px; padding: 11px 12px; resize: none;
    background: var(--surface); color: var(--text); border: 1px solid var(--line-lit);
  }
  .chat-foot textarea:focus { border-color: var(--accent); outline: none; }
  .chat-send {
    font: inherit; font-weight: 600; font-size: 13px;
    min-height: 44px; padding: 0 16px;
    background: var(--accent); color: var(--ground); border: 0; cursor: pointer;
  }
  .chat-send:hover { background: #4BE88C; }
  .chat-send:disabled { opacity: .45; cursor: default; }

  @media (max-width: 560px) {
    .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border: 0; }
    .chat-fab { right: 14px; bottom: 14px; }
  }

  @media (max-width: 430px) {
    .host { display: none; }
    .stack-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .stack-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
    .stack-col .label { grid-column: 1 / -1; }
  }

  @media (prefers-reduced-motion: reduce) {
    #boot { display: none !important; }
    .caret { animation: none; }
    .cur, .cue-line, .chat-fab::before { display: none !important; }
    .tick { animation: none; padding-left: 0; }
    .post-body figure, .entry-cover { clip-path: none; }
    #wave, .preview { display: none !important; }
    .reveal [data-line] { opacity: 1; transform: none; filter: none; }
    .reveal::before { display: none; }
    * { transition: none !important; }
  }

  /* Видна только с клавиатуры: первый Tab на странице. */
  .skip { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 12px 18px;
          background: var(--accent); color: var(--ground); font-size: 14px;
          text-decoration: none; transform: translateY(-200%); }
  .skip:focus { transform: none; }
