/* =========================================================
   parumi.ru — стили сайта
   ---------------------------------------------------------
   1. Сброс и переменные
   2. Базовые стили
   3. Верхняя панель
   4. Схема сети
   5. Текстовая часть
   6. Анимация
   7. Адаптив
   ========================================================= */

/* =========================================================
   1. Сброс и переменные (цвета и шрифты меняются здесь)
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #E5E7E0;   /* light sage-grey */
  --node:  #F1F2EC;   /* node fill */
  --ink:   #000000;   /* весь текст — чёрный */
  --soft:  #000000;   /* подписи тоже чёрные, иерархия — размером и весом */
  --cable: #9AA096;   /* idle cable */
  --live:  #000000;   /* иконки, ссылки, активный кабель */
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
/* =========================================================
   2. Базовые стили
   ========================================================= */
html { scroll-behavior: smooth; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; border-radius: 6px; }

/* =========================================================
   3. Верхняя панель: домен и переключатель языка
   ========================================================= */
.topbar {
  max-width: 1120px; margin: 0 auto; padding: 22px 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.domain { font-weight: 600; text-decoration: none; }
.lang { display: flex; gap: 4px; }
.lang button {
  font: 500 14px var(--sans); color: var(--soft);
  background: none; border: 1px solid transparent; border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); border-color: var(--cable); }

/* =========================================================
   4. Схема сети: контакты-узлы и кабели
   ========================================================= */
.topo {
  position: relative;
  max-width: 1120px; margin: 0 auto;
  padding: 40px 28px 24px;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px) 1fr;
  gap: 120px;
  align-items: center;
}
.cables { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.cables path { fill: none; stroke: var(--cable); stroke-width: 1.5; transition: stroke .2s; }
.cables path.on { stroke: var(--live); stroke-width: 2; }

.group { display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 1; }
.group-left { align-items: flex-end; }
.group-title { font-size: 14px; color: var(--soft); }
.group-left .group-title { text-align: right; }
.group-title { font-weight: 500; }

.node {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 270px;
  padding: 12px 16px;
  background: var(--node);
  border: 1px solid var(--cable);
  border-radius: 10px;
  text-decoration: none;
  position: relative;
}
.node:hover, .node:focus-visible { border-color: var(--live); }
.node svg { width: 20px; height: 20px; flex: none; color: var(--live); }
.n-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.n-label { font-size: 13px; color: var(--soft); }
.n-handle { font-weight: 500; overflow-wrap: anywhere; }
.port {
  position: absolute; top: 50%; transform: translateY(-50%);
  font: 400 11px var(--mono); color: var(--soft);
  background: var(--paper); padding: 0 4px;
}
.port { top: calc(50% - 11px); background: none; }
.group-left .port { right: -44px; }
.group-right .port { left: -44px; }

.copy {
  font: 500 14px var(--sans); color: var(--live);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  margin-top: -10px;
}

/* --- Центр схемы: портрет --- */
.host { text-align: center; position: relative; z-index: 1; }
.host-frame {
  width: 100%; aspect-ratio: 1;
  border-radius: 50%; overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--cable);
}
.host-frame img { width: 100%; height: 100%; display: block; object-fit: cover; mix-blend-mode: multiply; filter: grayscale(1) brightness(1.1) contrast(1.12); }
.host h1 { font-size: 34px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; margin-top: 14px; }
.host-role { color: var(--soft); }
.host-ip { font: 400 13px var(--mono); color: var(--soft); margin-top: 6px; }

/* =========================================================
   5. Текстовая часть: о себе, навыки, проекты
   ========================================================= */
.content { max-width: 720px; margin: 0 auto; padding: 56px 28px 64px; }
.lead { font-size: clamp(24px, 3vw, 30px); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; }
.lead + p { margin-top: 16px; color: var(--soft); font-size: 18px; }

section { margin-top: 64px; }
h2 { font-size: 22px; font-weight: 600; margin-bottom: 18px; }

.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 36px; }
.skills dt { font-weight: 600; }
.skills dd { color: var(--soft); font-size: 16px; margin-top: 2px; }

.projects { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.projects a {
  display: block; height: 100%;
  padding: 18px 20px; background: var(--node);
  border: 1px solid var(--cable); border-radius: 10px; text-decoration: none;
}
.projects a:hover { border-color: var(--live); }
.p-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.p-name { font-weight: 600; font-size: 18px; }
.p-url { font: 400 13px var(--mono); color: var(--soft); }
.p-desc { display: block; color: var(--soft); font-size: 16px; margin-top: 6px; }

footer {
  max-width: 720px; margin: 0 auto; padding: 20px 28px 40px;
  border-top: 1px solid var(--cable); font-size: 14px; color: var(--soft);
}

/* =========================================================
   6. Анимация: кабели прорисовываются один раз при загрузке
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .cables.draw path { animation: draw 1.1s ease-out both; }
}
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

/* =========================================================
   7. Адаптив: на телефоне схема становится вертикальной линией
   ========================================================= */
@media (max-width: 860px) {
  .topo { grid-template-columns: 1fr; gap: 32px !important; padding: 24px 20px; }
  .cables { display: none; }
  .host { order: -1; max-width: 260px; margin: 0 auto; }
  .group, .group-left { align-items: stretch; }
  .group-left .group-title { text-align: left; }
  .group { padding-left: 22px; border-left: 1.5px solid var(--cable); }
  .node { max-width: none; }
  .node::before {
    content: ''; position: absolute; left: -24px; top: 50%;
    width: 23px; border-top: 1.5px solid var(--cable);
  }
  .port { display: none; }
  .copy { align-self: flex-start; }
  .content { padding: 40px 20px 48px; }
  .skills, .projects { grid-template-columns: 1fr; }
}
