/* ============================================================
   ~/gmlol — Pavel Novikov
   Code-native portfolio: IDE / terminal / repo-explorer
   Inter (текст) + JetBrains Mono (код-акценты)
   ============================================================ */

:root{
  /* Editor surfaces */
  --bg:       #0b0e14;
  --surface:  #11151d;
  --surface-2:#161b24;
  --surface-3:#1b212c;
  --border:   #222a36;
  --border-2: #2c3645;

  /* Text */
  --text:   #cdd5e0;
  --muted:  #8b97a8;
  --faint:  #7c8a9c;   /* WCAG AA (~5.4:1 on --bg) */
  --ln:     #3a4456;   /* line numbers */

  /* Syntax tokens */
  --com:    #5f8b6b;   /* comments — green-grey */
  --kw:     #c792ea;   /* keyword — purple */
  --fn:     #82aaff;   /* function — blue */
  --str:    #9ccf7a;   /* string — green */
  --key:    #56d4dd;   /* key — cyan */
  --var:    #e6c07b;   /* variable — yellow */
  --num:    #f0966b;   /* number — orange */
  --bool:   #f0966b;

  --accent: #56d4dd;
  --accent-2:#82aaff;
  --ok:     #7ee787;

  --radius:   12px;
  --radius-sm:9px;
  --shadow:   0 14px 34px -20px rgba(0,0,0,.8);

  --maxw: 1080px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
html, body{ height: 100%; }

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

img{ max-width: 100%; display: block; }

/* Тонкая editor-сетка вместо SaaS-свечения */
.bg-grid{
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(86,212,221,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86,212,221,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 35%, transparent 80%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 35%, transparent 80%);
}

.container{ width: min(var(--maxw), 92%); margin-inline: auto; }

/* Mono-токены подсветки */
.tok-kw{ color: var(--kw); }
.tok-fn{ color: var(--fn); }
.tok-str{ color: var(--str); }
.tok-key{ color: var(--key); }
.tok-var{ color: var(--var); }
.tok-num{ color: var(--num); }
.tok-bool{ color: var(--bool); }
.tok-punct{ color: var(--muted); }
.comment{ color: var(--com); font-family: var(--font-mono); font-size: 13px; margin: 0 0 16px; }

/* ============================================================
   Header
   ============================================================ */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,20,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display: flex; align-items: center; gap: 18px;
  padding: 12px 0;
}
.brand{
  display: inline-flex; align-items: baseline; gap: 0;
  text-decoration: none;
  font-family: var(--font-mono); font-weight: 700; font-size: 16px;
}
.brand-prompt{ color: var(--accent); }
.brand-name{ color: var(--text); }
.brand-caret{ color: var(--accent); margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity: 0; } }

.nav{ display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a{
  position: relative;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
  transition: color .18s ease, background .18s ease;
}
.nav a::before{ content: "/"; color: var(--faint); margin-right: 1px; }
.nav a:hover{ color: var(--accent); background: rgba(86,212,221,.08); }

/* Locale toggle */
.locale{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px;
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface);
}
.locale-key{ color: var(--faint); }
.locale-btn{
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--faint); padding: 0 2px;
  transition: color .18s ease;
}
.locale-btn:hover{ color: var(--text); }
.locale-btn.is-active{ color: var(--accent); }
.locale-sep{ color: var(--border-2); }

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  color: var(--text); text-decoration: none;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  transition: border-color .18s ease, color .18s ease, transform .12s ease, background .18s ease;
}
.btn:hover{ transform: translateY(-2px); border-color: var(--accent); color: #fff; }
.btn-glyph{ color: var(--faint); }
.btn:hover .btn-glyph{ color: var(--accent); }
.btn-primary{
  border-color: rgba(86,212,221,.5);
  background: rgba(86,212,221,.1);
  color: #d6fbff;
}
.btn-primary .btn-glyph{ color: var(--accent); }
.btn-accent{
  border-color: rgba(130,170,255,.5);
  background: rgba(130,170,255,.1);
  color: #dbe6ff;
}
.btn-accent .btn-glyph{ color: var(--accent-2); }
.btn-accent:hover{ border-color: var(--accent-2); }

/* ============================================================
   Window panel (editor chrome)
   ============================================================ */
.win{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.win-bar{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.win-dots{ display: inline-flex; gap: 6px; }
.win-dots i{ width: 11px; height: 11px; border-radius: 50%; background: #3a4456; display: block; }
.win-dots i:nth-child(1){ background: #ff5f56; }
.win-dots i:nth-child(2){ background: #ffbd2e; }
.win-dots i:nth-child(3){ background: #27c93f; }
.win-tab{
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  padding: 3px 10px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
}
.win-body{ padding: 16px 18px; }

/* ============================================================
   Hero
   ============================================================ */
.hero{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 40px; align-items: center;
  padding: 64px 0 52px;
}
.hero-intro{ min-width: 0; }
.hero-name{
  margin: 0 0 12px;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.03; font-weight: 700; letter-spacing: -.02em;
  color: #f3f6fb;
}
.hero-role{
  margin: 0 0 22px;
  font-family: var(--font-mono); font-size: clamp(16px, 2.2vw, 20px);
}
.hero-lead{
  margin: 0 0 30px; max-width: 52ch;
  color: var(--muted); font-size: 17px;
}
.hero-cta{ display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero editor panel */
.hero-win{ width: 100%; }
.profile-id{
  display: flex; align-items: center; gap: 13px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px dashed var(--border-2);
}
.avatar{
  position: relative; flex-shrink: 0;
  width: 64px; height: 64px; padding: 0;
  border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--surface-3); cursor: pointer; overflow: hidden;
  transition: border-color .2s ease;
}
.avatar img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar:hover{ border-color: var(--accent); }
.avatar-tag{
  position: absolute; right: 3px; bottom: 3px;
  width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center; font-size: 11px;
  background: rgba(11,14,20,.78); color: var(--accent);
  border: 1px solid var(--border-2);
  transition: transform .3s ease;
}
.avatar:hover .avatar-tag{ transform: rotate(180deg); }
.profile-id-text{ min-width: 0; flex: 1; line-height: 1.35; }
.pid-name{ display: block; font-weight: 600; color: var(--text); }
.pid-handle{ display: block; font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }
.pid-status{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ok);
  white-space: nowrap;
}
.led{ width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(126,231,135,.16); }

/* Code lines with gutter numbers */
.code-lines{
  counter-reset: ln;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  white-space: normal;
}
.code-lines > div{
  position: relative; padding-left: 2.6em; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.code-lines > div::before{
  counter-increment: ln; content: counter(ln);
  position: absolute; left: 0; width: 1.7em; text-align: right;
  color: var(--ln); -webkit-user-select: none; user-select: none;
}

/* ============================================================
   Section / file head
   ============================================================ */
.section{ padding: 40px 0; }
.file-head{
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.file-name{
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  color: var(--text);
}
.file-name::before{ content: "› "; color: var(--accent); }
.file-note{ font-family: var(--font-mono); font-size: 12.5px; color: var(--com); margin-left: auto; }

/* ============================================================
   Snapshot
   ============================================================ */
.stat-grid{
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px;
}
.stat-card{
  padding: 16px 16px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.stat-card:nth-child(2){ border-left-color: var(--accent-2); }
.stat-card:nth-child(3){ border-left-color: var(--kw); }
.stat-card:nth-child(4){ border-left-color: var(--str); }
.stat-key{
  display: block; font-family: var(--font-mono); font-size: 12px;
  color: var(--faint); margin-bottom: 7px;
}
.stat-key::before{ content: "▸ "; color: var(--faint); }
.stat-val{ display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.stat-unit{ color: var(--muted); font-weight: 400; }

/* ============================================================
   Projects — repo cards
   ============================================================ */
.repo-grid{
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px;
}
.repo-card{
  display: flex; flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .18s ease, transform .14s ease, background .18s ease;
}
/* passive cards: only a subtle border response (no lift = no false "clickable" cue) */
.repo-card:hover{ border-color: var(--border-2); }
/* the one card with a real link keeps the interactive lift */
.repo-card-link:hover{ transform: translateY(-3px); background: var(--surface-2); border-color: rgba(86,212,221,.4); }
.repo-top{ display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.repo-ico{
  display: grid; place-items: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 15px; color: var(--accent);
  background: rgba(86,212,221,.08); border: 1px solid rgba(86,212,221,.22);
}
.repo-name{
  margin: 0; font-family: var(--font-mono); font-size: 16px; font-weight: 600;
  color: var(--text); min-width: 0; word-break: break-word;
}
.repo-badge{
  margin-left: auto; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface-2);
}
.repo-ext{
  margin-left: auto; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  text-decoration: none; padding: 3px 9px; border-radius: 7px;
  border: 1px solid rgba(86,212,221,.3); background: rgba(86,212,221,.06);
}
.repo-ext:hover{ background: rgba(86,212,221,.14); }
.repo-role{ margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.meta-key{ font-family: var(--font-mono); font-size: 12px; color: var(--key); margin-right: 6px; }
.repo-desc{ margin: 0 0 14px; font-size: 14.5px; color: var(--muted); flex: 1; }

.tag-row{
  display: flex; flex-wrap: wrap; gap: 7px;
  list-style: none; margin: 0; padding: 0;
}
.tag-row li{
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text);
  padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--border-2); background: var(--surface-2);
  transition: border-color .18s ease, color .18s ease;
}
.tag-row li:hover{ border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Experience — changelog / git log
   ============================================================ */
.log{ list-style: none; margin: 0; padding: 0; }
.log-entry{ display: grid; grid-template-columns: 18px 1fr; gap: 16px; }
.log-rail{ position: relative; }
.log-dot{
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--faint); z-index: 1;
}
.log-rail::before{
  content: ""; position: absolute; left: 50%; top: 6px; bottom: -18px;
  width: 2px; transform: translateX(-50%);
  background: var(--border-2);
}
.log-entry:last-child .log-rail::before{ display: none; }
.log-current .log-dot{ border-color: var(--ok); box-shadow: 0 0 0 4px rgba(126,231,135,.12); }

.log-body{ padding-bottom: 26px; min-width: 0; }
.log-meta{ display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.log-date{ font-family: var(--font-mono); font-size: 12.5px; color: var(--num); }
.log-tag{
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ok);
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(126,231,135,.32); background: rgba(126,231,135,.08);
}
.log-title{ margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--text); }
.log-at{ font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--key); }
.log-desc{ margin: 0; font-size: 14.5px; color: var(--muted); }

/* ============================================================
   Stack — yaml
   ============================================================ */
.yml{ display: grid; gap: 16px; }
.yml-group{ display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.yml-key{
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--key); flex: 0 0 100%;
}
@media (min-width: 720px){
  .yml-key{ flex: 0 0 168px; }
}

/* ============================================================
   Education — markdown
   ============================================================ */
.md{
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 22px 24px;
}
.md-h{
  font-family: var(--font-mono); font-size: 14px; color: var(--kw);
  margin: 0 0 12px;
}
.md-h + .md-list{ margin-bottom: 22px; }
.md-list{ list-style: none; margin: 0; padding: 0; }
.md-list li{ padding: 5px 0; font-size: 15px; color: var(--text); }
.md-bullet{ font-family: var(--font-mono); color: var(--accent); margin-right: 8px; }
.md-list strong{ color: var(--text); font-weight: 600; }
.md-year{ font-family: var(--font-mono); font-size: 12.5px; color: var(--faint); }

/* ============================================================
   Human side
   ============================================================ */
.human-line{
  margin: 0; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 14px; line-height: 2.1;
  color: var(--muted);
}
.hobby{
  color: var(--str);
  padding: 2px 7px; border-radius: 6px;
  background: rgba(156,207,122,.08); border: 1px solid rgba(156,207,122,.18);
}

/* ============================================================
   Contact — endpoints
   ============================================================ */
.endpoints{ list-style: none; margin: 0; padding: 6px; }
.endpoints li{
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 14px;
  transition: background .16s ease;
}
.endpoints li:hover{ background: var(--surface-2); }
.endpoints li + li{ border-top: 1px solid var(--border); }
.ep-key{ flex: 0 0 92px; color: var(--key); }
.ep-arrow{ color: var(--faint); }
.endpoints a{ color: var(--text); text-decoration: none; word-break: break-all; }
.endpoints a:hover{ color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer{ border-top: 1px solid var(--border); margin-top: 36px; padding: 22px 0 40px; }
.footer-inner{ display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); }
.foot-prompt{ color: var(--accent); font-size: 13px; }
.site-footer small{ color: var(--faint); font-size: 12.5px; }
.foot-note{ color: var(--com); }

/* ============================================================
   Inline code-native links (companies, institutions, certificates)
   ============================================================ */
.inline-link{
  color: var(--key);
  text-decoration: none;
  transition: color .16s ease;
}
.inline-link:hover{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cert-link{
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--faint); text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease;
}
.cert-link:hover{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   Focus / a11y
   ============================================================ */
a:focus-visible,
.btn:focus-visible,
.locale-btn:focus-visible,
.avatar:focus-visible,
button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 7px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px){
  .stat-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px){
  .hero{ grid-template-columns: 1fr; gap: 30px; padding: 44px 0 36px; }
  .hero-win{ order: -1; }
  .repo-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 620px){
  /* keep nav reachable on phones: full-width horizontally-scrollable pill row */
  .header-inner{ flex-wrap: wrap; gap: 8px 10px; }
  .nav{
    order: 3; flex-basis: 100%; margin-left: 0;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar{ display: none; }
  .nav a{ flex: 0 0 auto; }
  .stat-grid{ grid-template-columns: 1fr; }
  .file-note{ display: none; }
  .ep-key{ flex-basis: 76px; }
}
