/* ==========================================================================
   UpGradeBook — design system
   Визуальный язык: тёплая бумага, глубокий синий, градиентные акценты,
   техническая типографика. Наследует язык competency-tree.ru / service.bt360.ru.
   ========================================================================== */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/golos-text-latin-wght-normal.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: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-cyrillic-400-normal.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: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-cyrillic-500-normal.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("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  --ink: #141a2e;
  --navy: #15225c;
  --navy-deep: #101a45;
  --navy-ink: #0b1230;
  --muted: #5b6478;
  --muted-soft: #7a8396;
  --line: #e3e2dc;
  --line-strong: #c9ccd6;
  --paper: #f6f4f0;
  --paper-deep: #efede7;
  --white: #ffffff;
  --blue: #2947d9;
  --blue-deep: #1f36a8;
  --sky: #7ec8ee;
  --cyan: #0e9bd8;
  --amber: #f0a128;
  --magenta: #c62e71;
  --red: #cf3b45;
  --violet: #6b4fd8;
  --teal: #1f8a70;
  --green: #2f7d5b;
  --rose: #b23a48;

  --grad: linear-gradient(112deg, #7ec8ee 0%, #2947d9 42%, #c62e71 76%, #f0a128 100%);
  --grad-soft: linear-gradient(112deg, rgba(126, 200, 238, .18), rgba(41, 71, 217, .12) 44%, rgba(198, 46, 113, .1) 76%, rgba(240, 161, 40, .14));
  --grad-text: linear-gradient(100deg, #2947d9 0%, #6b4fd8 38%, #c62e71 72%, #f0a128 100%);
  --grad-cool: linear-gradient(135deg, #7ec8ee 0%, #2947d9 58%, #15225c 100%);

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --shadow-sm: 0 1px 2px rgba(20, 26, 46, .04), 0 2px 8px rgba(20, 26, 46, .03);
  --shadow: 0 1px 2px rgba(20, 26, 46, .04), 0 18px 40px -24px rgba(20, 26, 46, .22);
  --shadow-lg: 0 2px 4px rgba(20, 26, 46, .04), 0 32px 64px -32px rgba(20, 26, 46, .3);

  --header-h: 74px;
  --max: 1240px;
  --gutter: 22px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --role-accent: #2947d9;
  --role-accent-2: #6b4fd8;
  --role-soft: rgba(41, 71, 217, .08);
}

@media (min-width: 768px) {
  :root { --gutter: 34px; --header-h: 82px; }
}
@media (min-width: 1280px) {
  :root { --gutter: 44px; --max: 1280px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

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

body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, h5, p, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(41, 71, 217, .16); color: var(--navy); }

body::-webkit-scrollbar, .scroll-area::-webkit-scrollbar { width: 10px; height: 10px; }
body::-webkit-scrollbar-thumb, .scroll-area::-webkit-scrollbar-thumb {
  background: #cfd2da; border-radius: 999px; border: 3px solid var(--paper);
}

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.15em;
}
.icon--xs { width: 14px; height: 14px; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }
.icon--fill { fill: currentColor; stroke: none; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mono--tight { letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  padding: 10px 16px; border-radius: 10px; background: var(--navy);
  color: #fff; text-decoration: none; font-size: 14px;
}
.skip:focus { left: 8px; }

/* ---------- Typography ---------- */
.h1, .h2, .h3, .h4 { color: var(--navy); font-weight: 700; }
.h1 { font-size: clamp(2.5rem, 4.8vw, 4.5rem); line-height: .99; letter-spacing: -.045em; text-wrap: balance; }
.h2 { font-size: clamp(2rem, 3.8vw, 3.35rem); line-height: 1.04; letter-spacing: -.038em; font-weight: 650; text-wrap: balance; }
.h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); line-height: 1.18; letter-spacing: -.022em; font-weight: 650; }
.h4 { font-size: 1.08rem; line-height: 1.3; letter-spacing: -.012em; font-weight: 650; }
.lead { font-size: clamp(1.02rem, 1.5vw, 1.2rem); line-height: 1.58; color: var(--muted); max-width: 62ch; }
.body-muted { color: var(--muted); }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.balance { text-wrap: balance; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--navy);
  --btn-fg: #fff;
  --btn-border: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--btn-border); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font); font-size: 14.5px; font-weight: 600;
  line-height: 1; text-decoration: none; white-space: nowrap;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
    background .22s var(--ease), border-color .22s var(--ease), color .22s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -14px rgba(16, 26, 69, .5); }
.btn:active { transform: translateY(0); }
.btn--primary {
  --btn-bg: var(--blue);
  --btn-border: var(--blue);
  --btn-fg: #fff;
  background-image: linear-gradient(112deg, #2947d9, #4453c4 58%, #6b4fd8);
  box-shadow: 0 10px 24px -16px rgba(41, 71, 217, .7);
}
.btn--primary:hover { box-shadow: 0 16px 34px -16px rgba(41, 71, 217, .75); }
.btn--dark { --btn-bg: var(--navy-deep); --btn-border: var(--navy-deep); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-border: var(--line-strong);
  --btn-fg: var(--ink);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .7); border-color: var(--navy); }
.btn--soft {
  --btn-bg: var(--role-soft, rgba(41, 71, 217, .08));
  --btn-border: transparent;
  --btn-fg: var(--role-accent, var(--blue));
}
.btn--soft:hover { background: rgba(41, 71, 217, .13); }
.btn--danger {
  --btn-bg: #b02c35;
  --btn-border: #b02c35;
  --btn-fg: #fff;
  background-image: linear-gradient(112deg, #cf3b45, #b02c35);
}
.btn--white {
  --btn-bg: #fff;
  --btn-border: #fff;
  --btn-fg: var(--navy);
}
.btn--outline-white {
  --btn-bg: transparent;
  --btn-border: rgba(255, 255, 255, .28);
  --btn-fg: #fff;
}
.btn--outline-white:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .55); }
.btn--sm { min-height: 36px; padding: 0 13px; font-size: 13px; gap: 7px; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn--icon { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
.btn .icon { width: 17px; height: 17px; }
.btn:disabled { opacity: .55; transform: none; box-shadow: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--navy); text-decoration: none;
}
.link-arrow .icon { transition: transform .22s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Chips & tags ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 4px rgba(41, 71, 217, .1);
}
.eyebrow--light { color: rgba(255, 255, 255, .66); }
.eyebrow--light::before { background: var(--sky); box-shadow: 0 0 0 4px rgba(126, 200, 238, .14); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 6px;
  background: var(--paper); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.tag--blue { background: rgba(41, 71, 217, .07); border-color: rgba(41, 71, 217, .16); color: var(--blue-deep); }
.tag--teal { background: rgba(31, 138, 112, .08); border-color: rgba(31, 138, 112, .18); color: var(--teal); }
.tag--amber { background: rgba(240, 161, 40, .1); border-color: rgba(240, 161, 40, .22); color: #9a620d; }
.tag--magenta { background: rgba(198, 46, 113, .08); border-color: rgba(198, 46, 113, .18); color: var(--magenta); }
.tag--violet { background: rgba(107, 79, 216, .08); border-color: rgba(107, 79, 216, .18); color: var(--violet); }
.tag--green { background: rgba(47, 125, 91, .08); border-color: rgba(47, 125, 91, .18); color: var(--green); }
.tag--light { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .76); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--active { background: rgba(47, 125, 91, .1); color: #256a4c; }
.status--recruiting { background: rgba(41, 71, 217, .09); color: var(--blue-deep); }
.status--draft { background: rgba(122, 131, 150, .11); color: var(--muted); }
.status--completed { background: rgba(107, 79, 216, .1); color: #5840bc; }
.status--closed { background: rgba(198, 46, 113, .09); color: var(--magenta); }
.status--warning { background: rgba(240, 161, 40, .13); color: #91600e; }
.status--info { background: rgba(14, 155, 216, .1); color: #087ba9; }
.status--danger { background: rgba(207, 59, 69, .1); color: #b02c35; }

/* ---------- Avatars ---------- */
.avatar {
  --av-bg: linear-gradient(135deg, #2947d9, #6b4fd8);
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--av-bg); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(20, 26, 46, .12);
}
.avatar--sm { width: 28px; height: 28px; font-size: 10px; }
.avatar--lg { width: 52px; height: 52px; font-size: 16px; }
.avatar--xl { width: 74px; height: 74px; font-size: 22px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -9px; }
.avatar-stack__more {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  margin-left: -9px; border-radius: 50%; border: 2px solid #fff;
  background: var(--paper-deep); color: var(--muted);
  font-size: 10px; font-weight: 700;
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- Ribbon / progress ---------- */
.ribbon {
  height: 3px;
  background: var(--grad);
  background-size: 200% 100%;
  animation: ribbon 20s linear infinite;
}
@keyframes ribbon {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.progress {
  position: relative; height: 6px; border-radius: 999px;
  background: var(--paper-deep); overflow: hidden;
}
.progress > span {
  display: block; height: 100%; border-radius: inherit;
  background: var(--grad-cool);
  transition: width .5s var(--ease-out);
}
.progress--thin { height: 4px; }
.progress--accent > span { background: linear-gradient(90deg, var(--teal), var(--blue)); }
.progress--amber > span { background: linear-gradient(90deg, var(--amber), var(--magenta)); }

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Tooltip ---------- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  padding: 6px 9px; border-radius: 7px; background: var(--navy-ink); color: #fff;
  font-size: 11px; font-weight: 500; line-height: 1.3; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease);
  z-index: 50;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--paper-deep) 25%, #f7f6f3 50%, var(--paper-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 125, 91, .35); }
  50% { box-shadow: 0 0 0 5px rgba(47, 125, 91, 0); }
}
