/* ============ ТОКЕНЫ ============ */
:root{
  --bg:#0b0e14;
  --bg-soft:#0f141c;
  --card:#111720;
  --card-2:#161d28;
  --border:#202a38;
  --border-soft:#19212c;
  --text:#e6edf3;
  --text-dim:#9aa7b8;
  --text-mute:#6b7a8d;
  --accent:#58a6ff;
  --accent-soft:rgba(88,166,255,.12);
  --accent-line:rgba(88,166,255,.35);
  --green:#3fb950;
  --header-bg:rgba(11,14,20,.78);
  --shadow:0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.9);
  --radius:14px;
  --radius-sm:10px;
  --mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="light"]{
  --bg:#f6f8fa;
  --bg-soft:#eef1f5;
  --card:#ffffff;
  --card-2:#f1f4f8;
  --border:#d8dee6;
  --border-soft:#e6ebf0;
  --text:#1f2328;
  --text-dim:#59636e;
  --text-mute:#7a8591;
  --accent:#0969da;
  --accent-soft:rgba(9,105,218,.10);
  --accent-line:rgba(9,105,218,.32);
  --green:#1a7f37;
  --header-bg:rgba(246,248,250,.82);
  --shadow:0 1px 2px rgba(31,35,40,.06), 0 12px 28px -16px rgba(31,35,40,.22);
}

/* ============ БАЗА ============ */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
body::before{
  content:'';
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(700px 420px at 12% -8%, var(--accent-soft), transparent 65%),
    radial-gradient(600px 380px at 100% -4%, rgba(63,185,80,.07), transparent 60%);
}
a{color:inherit}
.mono{font-family:var(--mono)}
img,svg{display:block;max-width:100%}
::selection{background:var(--accent);color:#fff}

::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:20px;border:3px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:var(--text-mute)}

/* ============ ПАНЕЛЬ СОСТОЯНИЯ ============ */
.statusbar{
  position:sticky; top:0; z-index:100;
  height:56px;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:0 22px;
  background:var(--header-bg);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--border);
}
.logo{
  display:flex; align-items:center; gap:9px;
  font-family:var(--mono); font-size:14px; font-weight:500;
  text-decoration:none; color:var(--text); letter-spacing:-.01em;
}
.logo b{color:var(--accent); font-weight:600}
.logo .cursor{
  display:inline-block; width:8px; height:16px; margin-left:2px;
  background:var(--accent); border-radius:2px;
  animation:blink 1.2s steps(1) infinite;
}
@keyframes blink{50%{opacity:0}}

.statusbar__right{display:flex; align-items:center; gap:10px}

.seg{
  display:flex; gap:2px; padding:3px;
  background:var(--card); border:1px solid var(--border); border-radius:999px;
}
.seg button{
  border:0; background:transparent; color:var(--text-dim);
  font:600 12px/1 var(--sans); letter-spacing:.02em;
  padding:6px 11px; border-radius:999px; cursor:pointer;
  transition:.15s ease;
}
.seg button:hover{color:var(--text)}
.seg button.active{background:var(--accent-soft); color:var(--accent)}

.icon-btn{
  width:34px; height:34px; display:grid; place-items:center;
  background:var(--card); border:1px solid var(--border); border-radius:10px;
  color:var(--text-dim); cursor:pointer; transition:.15s ease;
}
.icon-btn:hover{color:var(--accent); border-color:var(--accent-line)}
.icon-btn svg{width:17px; height:17px}
[data-theme="dark"] .i-sun{display:none}
[data-theme="light"] .i-moon{display:none}

/* ============ СЕТКА ============ */
.layout{
  display:grid;
  grid-template-columns:236px minmax(0,1fr) 306px;
  gap:26px;
  max-width:1560px;
  margin:0 auto;
  padding:24px 22px 64px;
  align-items:start;
}
.sidebar{
  position:sticky; top:80px;
  max-height:calc(100vh - 104px);
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:2px;
}
.sidebar::-webkit-scrollbar{width:6px}

/* ============ ЛЕВОЕ МЕНЮ ============ */
.block-title{
  font-family:var(--mono);
  font-size:10.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase;
  color:var(--text-mute);
  margin:0 0 10px 4px;
}
.nav{display:flex; flex-direction:column; gap:3px; margin-bottom:26px}
.nav a{
  display:flex; align-items:center; gap:11px;
  padding:9px 12px; border-radius:10px;
  color:var(--text-dim); text-decoration:none;
  font-size:14px; font-weight:500;
  border:1px solid transparent;
  transition:.15s ease;
}
.nav a svg{width:17px; height:17px; flex:none; opacity:.85}
.nav a:hover{background:var(--card); color:var(--text)}
.nav a.active{
  background:var(--accent-soft); color:var(--accent);
  border-color:var(--accent-line);
}
.nav a.active svg{opacity:1}

.sidebar-note{
  padding:12px;
  border:1px dashed var(--border);
  border-radius:var(--radius-sm);
  font-family:var(--mono);
  font-size:11px; color:var(--text-mute);
  line-height:1.7;
}
.sidebar-note b{color:var(--text-dim); font-weight:600}

/* ============ ПРАВАЯ ПАНЕЛЬ / ПРОФИЛЬ ============ */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.profile{padding:18px}
.profile__top{display:flex; align-items:center; gap:13px; margin-bottom:14px}
.avatar{width:60px; height:60px; flex:none; border-radius:16px; border:1px solid var(--border)}
.profile__name{font-size:16px; font-weight:700; letter-spacing:-.01em; line-height:1.25}
.profile__nick{font-size:12px; color:var(--text-mute); margin-top:2px}

.status{
  display:inline-flex; align-items:center; gap:7px;
  font-size:12px; font-weight:600; color:var(--green);
  background:rgba(63,185,80,.10);
  border:1px solid rgba(63,185,80,.28);
  padding:4px 10px; border-radius:999px;
  margin-bottom:12px;
}
.status .dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 3px rgba(63,185,80,.18);
  animation:pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{50%{box-shadow:0 0 0 6px rgba(63,185,80,0)}}

.profile__role{font-size:13px; font-weight:600; color:var(--text); margin-bottom:8px}
.profile__bio{font-size:13px; color:var(--text-dim); line-height:1.6; margin:0 0 12px}
.profile__loc{font-size:11.5px; color:var(--text-mute); margin-bottom:18px}
.profile__loc::before{content:'›'; margin-right:6px; color:var(--accent)}

.socials{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:7px;
  margin-bottom:18px;
}
.socials a{
  aspect-ratio:1;
  display:grid; place-items:center;
  background:var(--card-2);
  border:1px solid var(--border);
  border-radius:9px;
  color:var(--text-dim);
  font:600 10.5px/1 var(--mono);
  text-decoration:none;
  transition:.16s ease;
}
.socials a:hover{
  background:var(--brand, var(--accent));
  border-color:transparent;
  color:#fff;
  transform:translateY(-2px);
}
.socials a[data-net="github"]{--brand:#2d333b}
.socials a[data-net="telegram"]{--brand:#229ED9}
.socials a[data-net="vk"]{--brand:#0077FF}
.socials a[data-net="hh"]{--brand:#D6001C}
.socials a[data-net="habr"]{--brand:#65A3BE}
.socials a[data-net="youtube"]{--brand:#FF0033}
.socials a[data-net="rutube"]{--brand:#EF2D2D}
.socials a[data-net="twitter"]{--brand:#1DA1F2}
.socials a[data-net="facebook"]{--brand:#1877F2}
.socials a[data-net="linkedin"]{--brand:#0A66C2}

.qr{
  display:flex; align-items:center; gap:12px;
  padding:11px;
  background:var(--card-2);
  border:1px dashed var(--border);
  border-radius:12px;
}
#qr-code-styling{
  flex:none;
  text-decoration:none;
  cursor:pointer;
}
#qr-code-styling:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.qr svg{
  width:68px; height:68px; flex:none;
  background:#fff; border-radius:8px;
}
.qr__title{font-size:12px; font-weight:600; line-height:1.35; margin-bottom:5px}
.qr__sub{font-size:10.5px; color:var(--text-mute); line-height:1.5}

/* ============ КОНТЕНТ ============ */
.page-head{margin:0 0 22px}
.page-head h1{
  font-size:26px; font-weight:700; letter-spacing:-.025em;
  margin:0 0 6px; line-height:1.2;
}
.page-head p{margin:0; color:var(--text-dim); font-size:14px; max-width:62ch}
.page-head .actions{margin-top:16px; display:flex; flex-wrap:wrap; gap:9px}
.page-head .tags{margin-top:14px}

.back-link{
  display:inline-flex; align-items:center; gap:6px;
  font-family:var(--mono); font-size:12px;
  color:var(--text-mute); text-decoration:none;
  margin-bottom:16px; transition:.15s;
}
.back-link:hover{color:var(--accent)}

.feed{display:flex; flex-direction:column; gap:13px}
.news{padding:17px 19px; transition:border-color .18s}
.news:hover{border-color:var(--border-soft)}
.news__meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  font-family:var(--mono); font-size:11.5px;
  color:var(--text-mute); margin-bottom:9px;
}
.news__meta .sep{opacity:.5}
.news__proj{color:var(--accent); text-decoration:none; font-weight:500}
.news__proj:hover{text-decoration:underline}
.news h3{margin:0 0 7px; font-size:16.5px; font-weight:600; letter-spacing:-.01em; line-height:1.35}
.news p{margin:0; color:var(--text-dim); font-size:14px; line-height:1.62}

.tag{
  display:inline-block;
  font:500 11px/1.5 var(--mono);
  padding:2px 8px; border-radius:999px;
  background:var(--card-2); border:1px solid var(--border);
  color:var(--text-dim); white-space:nowrap;
}
.tag--accent{background:var(--accent-soft); border-color:transparent; color:var(--accent)}
.tags{display:flex; flex-wrap:wrap; gap:6px}

/* карточки проектов */
.projects-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(290px, 1fr));
  gap:16px;
}
.project-card{
  display:flex; flex-direction:column; gap:14px;
  padding:14px;
  text-decoration:none;
  transition:.2s ease;
}
.project-card:hover{
  border-color:var(--accent-line);
  transform:translateY(-2px);
}
.project-card h3{margin:0 0 6px; font-size:16px; font-weight:600; letter-spacing:-.01em}
.project-card p{margin:0 0 11px; font-size:13px; color:var(--text-dim); line-height:1.6}

/* мокап-скриншот */
.shot{
  border:1px solid var(--border);
  border-radius:10px;
  overflow:hidden;
  background:var(--bg-soft);
}
.shot__bar{
  display:flex; gap:5px; padding:7px 10px;
  background:var(--card-2);
  border-bottom:1px solid var(--border);
}
.shot__bar i{width:7px; height:7px; border-radius:50%; background:var(--border)}
.shot__bar i:nth-child(1){background:#ff5f57}
.shot__bar i:nth-child(2){background:#febc2e}
.shot__bar i:nth-child(3){background:#28c840}
.shot__body{padding:11px; display:flex; flex-direction:column; gap:7px}
.shot__body .l{height:7px; border-radius:4px; background:var(--card-2); display:block}
.shot__grid{
  display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:3px;
}
.shot__grid span{
  height:34px; border-radius:7px;
  background:linear-gradient(135deg, var(--accent-soft), var(--card-2));
  border:1px solid var(--border-soft);
}
.shot--1 .shot__grid span{height:26px}
.shot--2 .shot__grid span{height:42px}

/* галерея на странице проекта */
.gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
  gap:12px;
  margin:26px 0 30px;
}
.section-title{
  font-size:16px; font-weight:600; letter-spacing:-.01em;
  margin:0 0 14px;
  padding-bottom:10px;
  border-bottom:1px solid var(--border);
}

.btn{
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius:10px;
  font-size:13px; font-weight:600; text-decoration:none;
  background:var(--card-2);
  border:1px solid var(--border);
  color:var(--text);
  transition:.15s ease;
}
.btn:hover{border-color:var(--accent-line); color:var(--accent)}
.btn--primary{
  background:var(--accent); border-color:transparent; color:#fff;
}
.btn--primary:hover{filter:brightness(1.08); color:#fff}

.empty{
  padding:26px; text-align:center;
  color:var(--text-mute); font-family:var(--mono); font-size:13px;
}

/* ============ АДАПТИВ ============ */
@media (max-width:1240px){
  .layout{grid-template-columns:220px minmax(0,1fr); gap:22px}
  .sidebar--right{
    grid-column:1 / -1;
    position:static; max-height:none;
  }
  .sidebar--right .profile{
    display:grid;
    grid-template-columns:minmax(240px, 1fr) minmax(240px, 1fr);
    gap:0 26px;
    align-items:start;
  }
  .sidebar--right .profile__top{grid-column:1}
  .sidebar--right .profile .block-title,
  .sidebar--right .profile .socials,
  .sidebar--right .profile .qr{grid-column:2}
}
@media (max-width:860px){
  .layout{grid-template-columns:1fr; padding:18px 16px 48px; gap:18px}
  .sidebar--left{position:sticky; top:56px; z-index:40; max-height:none; padding:8px 0;
    background:var(--header-bg); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
    border-bottom:1px solid var(--border); margin:-18px -16px 0; padding:8px 16px;
  }
  .sidebar--left .block-title, .sidebar-note{display:none}
  .nav{flex-direction:row; overflow-x:auto; gap:6px; margin:0}
  .nav a{white-space:nowrap; padding:8px 12px; font-size:13px}
  .nav::-webkit-scrollbar{display:none}
  .sidebar--right .profile{display:block}
  .page-head h1{font-size:22px}
  .statusbar{padding:0 14px}
  .logo span.hide-sm{display:none}
}
@media (max-width:420px){
  .socials{grid-template-columns:repeat(5,1fr)}
  .qr{flex-direction:column; text-align:center}
}