/* ── tern@site — янтарный фосфор ─────────────────────────────── */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../font/plexmono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../font/plexmono-400-symbols2.woff2') format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../font/plexmono-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;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../font/plexmono-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../font/plexmono-600-symbols2.woff2') format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../font/plexmono-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;
}

:root {
  --bg:        #16120C;   /* тёплый почти-чёрный, страница        */
  --bg-screen: #0F0C07;   /* экран терминала, чуть глубже         */
  --bg-raised: #221B10;   /* панели, инлайн-код                   */
  --text:      #E8DCC4;   /* основной тёплый светлый              */
  --dim:       #A69878;   /* второстепенный текст                 */
  --faint:     #7E7158;   /* совсем тихое: рамки, $ в промпте     */
  --amber:     #FFB000;   /* фосфор: промпт, ссылки, курсор       */
  --amber-hi:  #FFCE54;   /* светлейший янтарь: акцент в выводе   */
  --amber-dim: #8A6A1C;   /* рамки окон, разделители              */
  --err:       #E06C5A;   /* stderr                               */
  --font: 'IBM Plex Mono', 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scrollbar-color: var(--amber-dim) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 72ch;
  margin: 0 auto;
  padding: 1.2rem 1.4rem 3rem;
}

/* ── навигация ────────────────────────────────────────────────── */

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  padding: 0.9rem 0 2.2rem;
  font-size: 0.95rem;
}

.nav a { color: var(--dim); text-decoration-color: var(--faint); }
.nav a:hover { color: var(--amber); background: none; }
.nav .nav-here { color: var(--text); text-decoration: none; cursor: default; }

/* ── терминал (хиро) ──────────────────────────────────────────── */

.term {
  border: 1px solid var(--amber-dim);
  background: var(--bg-screen);
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 4px 4px 0 rgba(0,0,0,.35);
}

.term-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.32rem 0.8rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--amber-dim);
  color: var(--dim);
  font-size: 0.85rem;
}

.term-screen {
  height: 25em;               /* ≈ 24 строки вывода */
  max-height: 62vh;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  cursor: text;
  background:
    repeating-linear-gradient(0deg, rgba(255,176,0,.016) 0 1px, transparent 1px 3px),
    var(--bg-screen);
}

.t-line { white-space: pre-wrap; word-break: break-word; }
.t-line.t-dim   { color: var(--dim); }
.t-line.t-amber { color: var(--amber-hi); }
.t-line.t-err   { color: var(--err); }

.term-live {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.45rem;
  align-items: baseline;
  min-height: 1.6em;
}
.prompt { color: var(--amber); font-weight: 600; }
.prompt .tilde { color: var(--faint); font-weight: 400; }
.term-input-text { white-space: pre-wrap; word-break: break-all; }

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.15em;
  margin-left: 1px;
  background: var(--amber);
  vertical-align: text-bottom;
  animation: blink 1.15s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

#term-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  border: 0; padding: 0;
  background: transparent;
  color: transparent;
}
#term-input:focus { outline: none; }

.term-hint {
  padding: 0.4rem 1.1rem 0.6rem;
  border-top: 1px dashed var(--faint);
  color: var(--faint);
  font-size: 0.8rem;
}
.term-hint kbd {
  font-family: inherit;
  color: var(--dim);
  border: 1px solid var(--faint);
  border-radius: 3px;
  padding: 0 0.3em;
}

/* ── секции ────────────────────────────────────────────────────── */

section { margin-top: 3rem; }

h2 {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.1rem;
}
h2.cmd::before { content: '$ '; color: var(--faint); font-weight: 400; }

h1 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.4rem;
}

p { margin: 0 0 1.1rem; }

a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 3px;
}
a:hover { background: var(--amber); color: var(--bg); text-decoration: none; }

hr.sep {
  border: 0;
  border-top: 1px dashed var(--faint);
  margin: 2.6rem 0;
}

.meta { color: var(--dim); font-size: 0.9rem; margin: 0 0 0.9rem; }

/* списки проектов и заметок */

.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { padding: 0.55rem 0; border-top: 1px dashed var(--faint); }
.item-list li:first-child { border-top: 0; padding-top: 0; }
.item-desc { color: var(--dim); margin: 0.1rem 0 0; font-size: 0.95rem; }
.item-name { font-weight: 600; }
.item-date { color: var(--faint); font-size: 0.9rem; }

/* статья-заметка */

.note-body p { max-width: 66ch; }
.note-body h2 { margin-top: 2.4rem; }
.note-body ul, .note-body ol { margin: 0 0 1.1rem; padding-left: 1.6rem; }
.note-body li { margin-bottom: 0.35rem; }

code {
  background: var(--bg-raised);
  border: 1px solid #322917;
  border-radius: 3px;
  padding: 0.05em 0.34em;
  font-size: 0.92em;
  color: var(--amber-hi);
}
pre {
  background: var(--bg-screen);
  border: 1px solid #322917;
  border-left: 2px solid var(--amber-dim);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.9rem;
}
pre code { background: none; border: 0; padding: 0; color: var(--text); }

/* страница 404 */

.p404 { margin-top: 4rem; }
.p404 .big { font-size: 1.06rem; }

/* ── футер ─────────────────────────────────────────────────────── */

footer {
  margin-top: 4rem;
  border-top: 1px solid var(--amber-dim);
  padding-top: 0.9rem;
  color: var(--faint);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 2ch;
}

/* ── доступность и мелочи ──────────────────────────────────────── */

::selection { background: var(--amber); color: var(--bg); }

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

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .page { padding: 0.8rem 1rem 2.4rem; }
  .term-screen { height: 19em; padding: 0.8rem 0.85rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  * { transition: none !important; }
}
